mercurial/upgrade.py
changeset 43148 843da18386d5
parent 43138 f9dc98a97cdb
child 43823 ad84fc97d120
--- a/mercurial/upgrade.py	Sun Oct 06 23:36:51 2019 -0400
+++ b/mercurial/upgrade.py	Sun Oct 06 23:36:52 2019 -0400
@@ -13,6 +13,7 @@
 from .pycompat import getattr
 from . import (
     changelog,
+    copies,
     error,
     filelog,
     hg,
@@ -31,7 +32,6 @@
 RECLONES_REQUIREMENTS = {
     b'generaldelta',
     localrepo.SPARSEREVLOG_REQUIREMENT,
-    localrepo.SIDEDATA_REQUIREMENT,
 }
 
 
@@ -77,6 +77,7 @@
     supported = {
         localrepo.SPARSEREVLOG_REQUIREMENT,
         localrepo.SIDEDATA_REQUIREMENT,
+        localrepo.COPIESSDC_REQUIREMENT,
     }
     for name in compression.compengines:
         engine = compression.compengines[name]
@@ -103,6 +104,7 @@
         b'store',
         localrepo.SPARSEREVLOG_REQUIREMENT,
         localrepo.SIDEDATA_REQUIREMENT,
+        localrepo.COPIESSDC_REQUIREMENT,
     }
     for name in compression.compengines:
         engine = compression.compengines[name]
@@ -129,6 +131,7 @@
         b'generaldelta',
         localrepo.SPARSEREVLOG_REQUIREMENT,
         localrepo.SIDEDATA_REQUIREMENT,
+        localrepo.COPIESSDC_REQUIREMENT,
     }
     for name in compression.compengines:
         engine = compression.compengines[name]
@@ -698,6 +701,7 @@
 def getsidedatacompanion(srcrepo, dstrepo):
     sidedatacompanion = None
     removedreqs = srcrepo.requirements - dstrepo.requirements
+    addedreqs = dstrepo.requirements - srcrepo.requirements
     if localrepo.SIDEDATA_REQUIREMENT in removedreqs:
 
         def sidedatacompanion(rl, rev):
@@ -706,6 +710,10 @@
                 return True, (), {}
             return False, (), {}
 
+    elif localrepo.COPIESSDC_REQUIREMENT in addedreqs:
+        sidedatacompanion = copies.getsidedataadder(srcrepo, dstrepo)
+    elif localrepo.COPIESSDC_REQUIREMENT in removedreqs:
+        sidedatacompanion = copies.getsidedataremover(srcrepo, dstrepo)
     return sidedatacompanion