Page MenuHomeSoftware Heritage

D6329.id.diff
No OneTemporary

D6329.id.diff

diff --git a/swh/loader/mercurial/hgutil.py b/swh/loader/mercurial/hgutil.py
--- a/swh/loader/mercurial/hgutil.py
+++ b/swh/loader/mercurial/hgutil.py
@@ -100,9 +100,16 @@
for branch in branches_with_one_head:
del branch_open_heads[branch]
+ # for bookmarks, the ids listed are not aligned with the rest, it's human
+ # readable id as bytes string instead of bytes string. Hence the extra mapping.
+ branch_bookmarks = {
+ branch: HgNodeId(bytes.fromhex(node_id.decode()))
+ for branch, node_id in all_bookmarks.items()
+ }
+
return BranchingInfo(
tips=branch_tips,
- bookmarks=all_bookmarks,
+ bookmarks=branch_bookmarks,
open_heads=branch_open_heads,
closed_heads=branch_closed_heads,
default_branch_alias=default_rev_alias,
diff --git a/swh/loader/mercurial/tests/test_from_disk.py b/swh/loader/mercurial/tests/test_from_disk.py
--- a/swh/loader/mercurial/tests/test_from_disk.py
+++ b/swh/loader/mercurial/tests/test_from_disk.py
@@ -725,9 +725,8 @@
assert visit_status2.snapshot == visit_status.snapshot
-@pytest.mark.xfail
-def test_loader_missing_hgnodeid_mapping(swh_storage, datadir, tmp_path):
- """TODO: Analyze this issue and update the comment about the proper behavior.
+def test_loader_repository_with_bookmark_information(swh_storage, datadir, tmp_path):
+ """Repository with bookmark information should be ingested correctly
"""
archive_name = "anomad-d"

File Metadata

Mime Type
text/plain
Expires
Wed, Sep 17, 4:55 PM (12 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3219186

Event Timeline