diff mercurial/repair.py @ 42919:a8b249b2f8cc

strip: fix bug with treemanifests and unordered linkrevs This is the treemanifest version of f45f7390c1c5 (strip: calculate list of extra nodes to save and pass it to changegroupsubset, 2008-01-19). Differential Revision: https://phab.mercurial-scm.org/D6795
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 06 Sep 2019 23:15:52 -0700
parents 6d0fdba635e5
children 2372284d9457
line wrap: on
line diff
--- a/mercurial/repair.py	Fri Sep 06 23:10:28 2019 -0700
+++ b/mercurial/repair.py	Fri Sep 06 23:15:52 2019 -0700
@@ -81,14 +81,12 @@
     _, brokenset = revlog.getstrippoint(striprev)
     return [revlog.linkrev(r) for r in brokenset]
 
-def _collectmanifest(repo, striprev):
-    return _collectrevlog(repo.manifestlog.getstorage(b''), striprev)
-
 def _collectbrokencsets(repo, files, striprev):
     """return the changesets which will be broken by the truncation"""
     s = set()
 
-    s.update(_collectmanifest(repo, striprev))
+    for revlog in manifestrevlogs(repo):
+        s.update(_collectrevlog(revlog, striprev))
     for fname in files:
         s.update(_collectrevlog(repo.file(fname), striprev))