changeset 32336:7e07d5836063

hg: backout optimizing for treemanifests It turns out that the files list is not sufficient to identify with revlogs have changed. In a merge commit, no files could've changed but directories would have. For now let's just backout this optimization.
author Durham Goode <durham@fb.com>
date Mon, 15 May 2017 18:55:58 -0700
parents b9135f191d8a
children d7efaf6275a7
files mercurial/repair.py
diffstat 1 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/repair.py	Mon May 15 13:29:18 2017 -0700
+++ b/mercurial/repair.py	Mon May 15 18:55:58 2017 -0700
@@ -238,12 +238,11 @@
 def striptrees(repo, tr, striprev, files):
     if 'treemanifest' in repo.requirements: # safe but unnecessary
                                             # otherwise
-        treerevlog = repo.manifestlog._revlog
-        for dir in util.dirs(files):
-            # If the revlog doesn't exist, this returns an empty revlog and is a
-            # no-op.
-            rl = treerevlog.dirlog(dir)
-            rl.strip(striprev, tr)
+        for unencoded, encoded, size in repo.store.datafiles():
+            if (unencoded.startswith('meta/') and
+                unencoded.endswith('00manifest.i')):
+                dir = unencoded[5:-12]
+                repo.manifestlog._revlog.dirlog(dir).strip(striprev, tr)
 
 def rebuildfncache(ui, repo):
     """Rebuilds the fncache file from repo history.