diff mercurial/upgrade.py @ 43134:75ad8af9c95e

upgrade: allow upgrade to repository using sidedata Repository can now be migrated to support sidedata. More requirements and migration will be needed to actual side-data usage. This is a step in that direction. To test the feature, we leverage the test extension. It make sure the `update` part of the side-data migration actually works. Differential Revision: https://phab.mercurial-scm.org/D6942
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sun, 06 Oct 2019 23:36:51 -0400
parents 8ff1ecfadcd1
children 6e3dc1eff5c7
line wrap: on
line diff
--- a/mercurial/upgrade.py	Sun Oct 06 23:36:51 2019 -0400
+++ b/mercurial/upgrade.py	Sun Oct 06 23:36:51 2019 -0400
@@ -31,6 +31,7 @@
 RECLONES_REQUIREMENTS = {
     b'generaldelta',
     localrepo.SPARSEREVLOG_REQUIREMENT,
+    localrepo.SIDEDATA_REQUIREMENT,
 }
 
 
@@ -100,6 +101,7 @@
         b'revlogv1',
         b'store',
         localrepo.SPARSEREVLOG_REQUIREMENT,
+        localrepo.SIDEDATA_REQUIREMENT,
     }
     for name in compression.compengines:
         engine = compression.compengines[name]
@@ -125,6 +127,7 @@
         b'fncache',
         b'generaldelta',
         localrepo.SPARSEREVLOG_REQUIREMENT,
+        localrepo.SIDEDATA_REQUIREMENT,
     }
     for name in compression.compengines:
         engine = compression.compengines[name]
@@ -676,6 +679,10 @@
 )
 
 
+def getsidedatacompanion(srcrepo, destrepo):
+    return None
+
+
 def matchrevlog(revlogfilter, entry):
     """check is a revlog is selected for cloning
 
@@ -779,6 +786,8 @@
     def oncopiedrevision(rl, rev, node):
         progress.increment()
 
+    sidedatacompanion = getsidedatacompanion(srcrepo, dstrepo)
+
     # Do the actual copying.
     # FUTURE this operation can be farmed off to worker processes.
     seen = set()
@@ -870,6 +879,7 @@
                 addrevisioncb=oncopiedrevision,
                 deltareuse=deltareuse,
                 forcedeltabothparents=forcedeltabothparents,
+                sidedatacompanion=sidedatacompanion,
             )
         else:
             msg = _(b'blindly copying %s containing %i revisions\n')