D3065: repair: use repo.file().files() to rebuild fncache

indygreg (Gregory Szorc) phabricator at mercurial-scm.org
Wed Apr 4 01:57:33 UTC 2018


indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Previously, the fncache code assumed that .i and .d revlog
  files were being used.
  
  The file storage interface has a files() API to declare the
  paths of underlying files that are backing storage. It will
  always return the .i file. And depending on whether the revlog
  is inline, it will return the .d.
  
  This change will make rebuilding the fncache a bit slower since
  we now have to open revlogs. But this is the only reasonable
  way to support multiple storage backends with fncache at this
  juncture. This code is only called from debug* commands, so the
  perf hit shouldn't matter.

REPOSITORY
  rHG Mercurial

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

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
@@ -367,13 +367,10 @@
                     continue
                 seenfiles.add(f)
 
-                i = 'data/%s.i' % f
-                d = 'data/%s.d' % f
-
-                if repo.store._exists(i):
-                    newentries.add(i)
-                if repo.store._exists(d):
-                    newentries.add(d)
+                fl = repo.file(f)
+                for path in fl.files():
+                    if repo.store._exists(path):
+                        newentries.add(path)
 
         ui.progress(_('rebuilding'), None)
 



To: indygreg, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list