hg: backout optimizing for treemanifests
authorDurham Goode <durham@fb.com>
Mon, 15 May 2017 18:55:58 -0700
changeset 32296 7e07d5836063
parent 32295 b9135f191d8a
child 32297 d7efaf6275a7
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.
mercurial/repair.py
--- 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.