Patchwork D6905: upgrade: also register copied `.d` files to fncache

login
register
mail settings
Submitter phabricator
Date Sept. 28, 2019, 8:29 p.m.
Message ID <84248b7d07b88295a8eaf2276025a6f9@localhost.localdomain>
Download mbox | patch
Permalink /patch/41825/
State Not Applicable
Headers show

Comments

phabricator - Sept. 28, 2019, 8:29 p.m.
Closed by commit rHG373749982924: upgrade: also register copied `.d` files to fncache (authored by marmoute).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6905?vs=16667&id=16674

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

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

AFFECTED FILES
  mercurial/upgrade.py
  tests/test-upgrade-repo.t

CHANGE DETAILS




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

Patch

diff --git a/tests/test-upgrade-repo.t b/tests/test-upgrade-repo.t
--- a/tests/test-upgrade-repo.t
+++ b/tests/test-upgrade-repo.t
@@ -604,10 +604,7 @@ 
   checking manifests
   crosschecking files in changesets and manifests
   checking files
-   warning: revlog 'data/f2.d' not in fncache!
   checked 3 changesets with 3 changes to 3 files
-  1 warnings encountered!
-  hint: run "hg debugrebuildfncache" to recover from corrupt fncache
 
 Check we can select negatively
 
@@ -699,10 +696,7 @@ 
   checking manifests
   crosschecking files in changesets and manifests
   checking files
-   warning: revlog 'data/f2.d' not in fncache!
   checked 3 changesets with 3 changes to 3 files
-  1 warnings encountered!
-  hint: run "hg debugrebuildfncache" to recover from corrupt fncache
 
 Check that we can select filelog only
 
diff --git a/mercurial/upgrade.py b/mercurial/upgrade.py
--- a/mercurial/upgrade.py
+++ b/mercurial/upgrade.py
@@ -561,12 +561,15 @@ 
         pass # create all the directories
 
     util.copyfile(oldindex, newindex)
-    if oldrl.opener.exists(oldrl.datafile):
+    copydata = oldrl.opener.exists(oldrl.datafile)
+    if copydata:
         util.copyfile(olddata, newdata)
 
     if not (unencodedname.endswith('00changelog.i')
             or unencodedname.endswith('00manifest.i')):
         destrepo.svfs.fncache.add(unencodedname)
+        if copydata:
+            destrepo.svfs.fncache.add(unencodedname[:-2] + '.d')
 
 UPGRADE_CHANGELOG = object()
 UPGRADE_MANIFEST = object()