Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9348350
D6188.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
D6188.diff
View Options
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
@@ -321,24 +321,23 @@
"""Return the hg revision numbers to load."""
assert self._repo is not None
repo: hgutil.Repository = self._repo
- if self._latest_heads:
- existing_heads = [] # heads that still exist in the repository
- for hg_nodeid in self._latest_heads:
- try:
- rev = repo[hg_nodeid].rev()
- existing_heads.append(rev)
- except KeyError: # the node does not exist anymore
- pass
-
- # select revisions that are not ancestors of heads
- # and not the heads themselves
- new_revs = repo.revs("not ::(%ld)", existing_heads)
-
- if new_revs:
- self.log.info("New revisions found: %d", len(new_revs))
- return new_revs
- else:
- return repo.revs("all()")
+ existing_heads = [] # heads that still exist in the repository
+ revs = self._latest_heads if self._latest_heads else repo.revs("all()")
+
+ for hg_nodeid in revs:
+ try:
+ rev = repo[hg_nodeid].rev()
+ existing_heads.append(rev)
+ except KeyError: # the node does not exist anymore
+ pass
+
+ # select revisions that are not ancestors of heads
+ # and not the heads themselves
+ new_revs = repo.revs("not ::(%ld)", existing_heads)
+
+ if new_revs:
+ self.log.info("New revisions found: %d", len(new_revs))
+ return new_revs
def store_data(self):
"""Store fetched data in the database."""
@@ -425,7 +424,6 @@
snapshot = Snapshot(branches=snapshot_branches)
self.storage.snapshot_add([snapshot])
- self.flush()
self.loaded_snapshot_id = snapshot.id
def load_status(self) -> Dict[str, str]:
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Jul 3 2025, 6:25 PM (5 w, 2 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3227637
Attached To
D6188: mercurial.from_disk: Filter out globally already seen hg_nodeid
Event Timeline
Log In to Comment