changeset 43002:373749982924

upgrade: also register copied `.d` files to fncache Oops, we forgot to register data file when blanky copying revlog. Now that we are actually copying these `.d` files, we should also register them. Differential Revision: https://phab.mercurial-scm.org/D6905
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 27 Sep 2019 19:59:53 +0200
parents 675a925b556d
children bbf77341a956
files mercurial/upgrade.py tests/test-upgrade-repo.t
diffstat 2 files changed, 4 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/upgrade.py	Fri Sep 27 21:32:56 2019 +0200
+++ b/mercurial/upgrade.py	Fri Sep 27 19:59:53 2019 +0200
@@ -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()
--- a/tests/test-upgrade-repo.t	Fri Sep 27 21:32:56 2019 +0200
+++ b/tests/test-upgrade-repo.t	Fri Sep 27 19:59:53 2019 +0200
@@ -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