Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9696306
D3306.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D3306.diff
View Options
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
@@ -58,6 +58,7 @@
)
from swh.loader.core.loader import DVCSLoader
from swh.loader.core.utils import clean_dangling_folders
+from swh.storage.algos.origin import origin_get_latest_visit_status
from . import converters
from .archive_extract import tmp_extract
@@ -117,6 +118,7 @@
self.bundle_path = None
self.heads = {}
self.releases = {}
+ self.last_snapshot_id: Optional[bytes] = None
def pre_cleanup(self):
"""Cleanup potential dangling files from prior runs (e.g. OOM killed
@@ -168,9 +170,14 @@
if isinstance(visit_date, str): # visit_date can be string or datetime
visit_date = parser.parse(visit_date)
self.visit_date = visit_date
- self.last_visit = self.storage.origin_visit_get_latest(
- self.origin_url, require_snapshot=True
+ visit_and_status = origin_get_latest_visit_status(
+ self.storage, self.origin_url, require_snapshot=True
)
+ if visit_and_status is None:
+ self.last_snapshot_id = None
+ else:
+ _, visit_status = visit_and_status
+ self.last_snapshot_id = visit_status.snapshot
@staticmethod
def clone_with_timeout(log, origin, destination, timeout):
@@ -598,7 +605,7 @@
def load_status(self):
snapshot = self.get_snapshot()
load_status = "eventful"
- if self.last_visit is not None and self.last_visit["snapshot"] == snapshot.id:
+ if self.last_snapshot_id is not None and self.last_snapshot_id == snapshot.id:
load_status = "uneventful"
return {
"status": load_status,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Aug 17, 7:47 PM (1 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3217758
Attached To
D3306: loader: Read snapshot out of the last origin visit status
Event Timeline
Log In to Comment