D6794: repair: extract a helper for generating all manifest revlogs

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

D6794: repair: extract a helper for generating all manifest revlogs

martinvonz (Martin von Zweigbergk)
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  We'll need to walk the manifest revlogs also to figure out which
  manifests have linkrevs out of order (for fixing the bug shown in the
  previous patch).
 
  By the way, perhaps it would be more efficient in many cases to find
  only the relevant directory manifest revlogs based on the files
  instead of walking the entire store, but that can be changed later.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6794

AFFECTED FILES
  mercurial/repair.py

CHANGE DETAILS

diff --git a/mercurial/repair.py b/mercurial/repair.py
--- a/mercurial/repair.py
+++ b/mercurial/repair.py
@@ -364,11 +364,11 @@
     callback.addnodes(nodelist)
 
 def stripmanifest(repo, striprev, tr, files):
-    revlog = repo.manifestlog.getstorage(b'')
-    revlog.strip(striprev, tr)
-    striptrees(repo, tr, striprev, files)
+    for revlog in manifestrevlogs(repo):
+        revlog.strip(striprev, tr)
 
-def striptrees(repo, tr, striprev, files):
+def manifestrevlogs(repo):
+    yield repo.manifestlog.getstorage(b'')
     if 'treemanifest' in repo.requirements:
         # This logic is safe if treemanifest isn't enabled, but also
         # pointless, so we skip it if treemanifest isn't enabled.
@@ -376,7 +376,7 @@
             if (unencoded.startswith('meta/') and
                 unencoded.endswith('00manifest.i')):
                 dir = unencoded[5:-12]
-                repo.manifestlog.getstorage(dir).strip(striprev, tr)
+                yield repo.manifestlog.getstorage(dir)
 
 def rebuildfncache(ui, repo):
     """Rebuilds the fncache file from repo history.



To: martinvonz, #hg-reviewers
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

D6794: repair: extract a helper for generating all manifest revlogs

martinvonz (Martin von Zweigbergk)
Closed by commit rHG6d0fdba635e5: repair: extract a helper for generating all manifest revlogs (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6794?vs=16399&id=16463

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6794/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6794

AFFECTED FILES
  mercurial/repair.py

CHANGE DETAILS

diff --git a/mercurial/repair.py b/mercurial/repair.py
--- a/mercurial/repair.py
+++ b/mercurial/repair.py
@@ -364,11 +364,11 @@
     callback.addnodes(nodelist)
 
 def stripmanifest(repo, striprev, tr, files):
-    revlog = repo.manifestlog.getstorage(b'')
-    revlog.strip(striprev, tr)
-    striptrees(repo, tr, striprev, files)
+    for revlog in manifestrevlogs(repo):
+        revlog.strip(striprev, tr)
 
-def striptrees(repo, tr, striprev, files):
+def manifestrevlogs(repo):
+    yield repo.manifestlog.getstorage(b'')
     if 'treemanifest' in repo.requirements:
         # This logic is safe if treemanifest isn't enabled, but also
         # pointless, so we skip it if treemanifest isn't enabled.
@@ -376,7 +376,7 @@
             if (unencoded.startswith('meta/') and
                 unencoded.endswith('00manifest.i')):
                 dir = unencoded[5:-12]
-                repo.manifestlog.getstorage(dir).strip(striprev, tr)
+                yield repo.manifestlog.getstorage(dir)
 
 def rebuildfncache(ui, repo):
     """Rebuilds the fncache file from repo history.



To: martinvonz, #hg-reviewers, pulkit
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel