Mercurial > public > mercurial-scm > hg
diff mercurial/upgrade.py @ 43148:843da18386d5
sidedatacopies: deal with upgrading and downgrading to that format
This is quite useful to test this on real life data.
Differential Revision: https://phab.mercurial-scm.org/D6955
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sun, 06 Oct 2019 23:36:52 -0400 |
parents | f9dc98a97cdb |
children | ad84fc97d120 |
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: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