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

login
register
mail settings
Submitter phabricator
Date April 4, 2018, 1:57 a.m.
Message ID <differential-rev-PHID-DREV-gg4ufekvl6uyj2vn3aj3-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/30238/
State Superseded
Headers show

Comments

phabricator - April 4, 2018, 1:57 a.m.
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




To: indygreg, #hg-reviewers
Cc: mercurial-devel
phabricator - April 4, 2018, 5:56 p.m.
indygreg abandoned this revision.
indygreg added a comment.


  I'm just going to disable fncache with the simple store. All test functionality for `hg debugrebuildfncache` will be disabled unless an fncache is in play.

REPOSITORY
  rHG Mercurial

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

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

Patch

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)