diff --git a/swh/loader/mercurial/from_disk.py b/swh/loader/mercurial/from_disk.py --- a/swh/loader/mercurial/from_disk.py +++ b/swh/loader/mercurial/from_disk.py @@ -16,7 +16,7 @@ from swh.loader.mercurial.utils import get_minimum_env, parse_visit_date from swh.model import identifiers from swh.model.from_disk import Content, DentryPerms, Directory -from swh.model.hashutil import hash_to_bytehex +from swh.model.hashutil import hash_to_bytehex, hash_to_bytes from swh.model.model import ( ExtID, ObjectType, @@ -450,7 +450,11 @@ for bookmark_name, node_id in branching_info.bookmarks.items(): name = b"bookmarks/%s" % bookmark_name - target = self.get_revision_id_from_hg_nodeid(node_id) + # hack as the input received is not aligned with the rest + # received: b'8f55d284a9d4d7d211f04cbc678e9f215b304404' + # expected: b'\x8fU\xd2\x84\xa9\xd4\xd7\xd2\x11\xf0L\xbcg\x8e\x9f![0D\x04' + node_id_bytes = hash_to_bytes(node_id.decode()) + target = self.get_revision_id_from_hg_nodeid(node_id_bytes) snapshot_branches[name] = SnapshotBranch( target=target, target_type=TargetType.REVISION ) 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"