Page MenuHomeSoftware Heritage

D7115.diff
No OneTemporary

D7115.diff

diff --git a/swh/loader/mercurial/identify.py b/swh/loader/mercurial/identify.py
--- a/swh/loader/mercurial/identify.py
+++ b/swh/loader/mercurial/identify.py
@@ -16,9 +16,10 @@
from swh.loader.mercurial.utils import get_minimum_env
from swh.model.cli import identify_object
+from swh.model.git_objects import normalize_timestamp
from swh.model.hashutil import hash_to_bytehex
-from swh.model.identifiers import CoreSWHID, ObjectType, normalize_timestamp
from swh.model.model import RevisionType
+from swh.model.swhids import CoreSWHID, ObjectType
TAG_PATTERN = re.compile(b"([0-9A-Fa-f]{40}) +(.+)")
diff --git a/swh/loader/mercurial/loader.py b/swh/loader/mercurial/loader.py
--- a/swh/loader/mercurial/loader.py
+++ b/swh/loader/mercurial/loader.py
@@ -20,7 +20,7 @@
from swh.loader.core.loader import BaseLoader
from swh.loader.core.utils import clean_dangling_folders
from swh.loader.mercurial.utils import get_minimum_env
-from swh.model import identifiers
+from swh.model import swhids
from swh.model.from_disk import Content, DentryPerms, Directory
from swh.model.hashutil import hash_to_bytehex
from swh.model.model import (
@@ -278,7 +278,7 @@
"""Get all Mercurial ExtIDs for the targets in the latest snapshot"""
extids = []
for extid in self.storage.extid_get_from_target(
- identifiers.ObjectType.REVISION,
+ swhids.ObjectType.REVISION,
targets,
extid_type=EXTID_TYPE,
extid_version=EXTID_VERSION,
@@ -612,8 +612,8 @@
self.storage.revision_add([revision])
# Save the mapping from SWHID to hg id
- revision_swhid = identifiers.CoreSWHID(
- object_type=identifiers.ObjectType.REVISION, object_id=revision.id,
+ revision_swhid = swhids.CoreSWHID(
+ object_type=swhids.ObjectType.REVISION, object_id=revision.id,
)
self.storage.extid_add(
[
diff --git a/swh/loader/mercurial/tests/test_loader.py b/swh/loader/mercurial/tests/test_loader.py
--- a/swh/loader/mercurial/tests/test_loader.py
+++ b/swh/loader/mercurial/tests/test_loader.py
@@ -21,8 +21,8 @@
)
from swh.model.from_disk import Content, DentryPerms
from swh.model.hashutil import hash_to_bytes, hash_to_hex
-from swh.model.identifiers import ObjectType
from swh.model.model import RevisionType, Snapshot, SnapshotBranch, TargetType
+from swh.model.swhids import ObjectType
from swh.storage import get_storage
from swh.storage.algos.snapshot import snapshot_get_latest

File Metadata

Mime Type
text/plain
Expires
Thu, Jul 3, 5:33 PM (3 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3216546

Event Timeline