Mercurial > public > mercurial-scm > hg-stable
diff mercurial/debugcommands.py @ 30775:513d68a90398
repair: implement requirements checking for upgrades
This commit introduces functionality for upgrading a repository in
place. The first part that's implemented is testing for upgrade
"compatibility." This is done by examining repository requirements.
There are 5 functions returning sets of requirements that control
upgrading. Why so many functions? Mainly to support extensions.
Functions are easier to monkeypatch than module variables.
Astute readers will see that we don't support "manifestv2" and
"treemanifest" requirements in the upgrade mechanism. I don't have
a great answer for why other than this is a complex set of patches
and I don't want to deal with the complexity of these experimental
features just yet. We can teach the upgrade mechanism about them
later, once the basic upgrade mechanism is in place.
This commit also introduces the "upgraderepo" function. This will be
our main routine for performing an in-place upgrade. Currently, it
just implements requirements checking. The structure of some code in
this function may look a bit weird (e.g. the inline function that is
only called once). But this will make sense after future commits.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sun, 18 Dec 2016 16:16:54 -0800 |
parents | eaa5607132a2 |
children | fec3dbaa7f83 |
line wrap: on
line diff
--- a/mercurial/debugcommands.py Thu Nov 24 16:24:09 2016 -0800 +++ b/mercurial/debugcommands.py Sun Dec 18 16:16:54 2016 -0800 @@ -34,6 +34,7 @@ localrepo, lock as lockmod, pycompat, + repair, revlog, scmutil, setdiscovery, @@ -873,4 +874,4 @@ should complete almost instantaneously and the chances of a consumer being unable to access the repository should be low. """ - raise error.Abort(_('not yet implemented')) + return repair.upgraderepo(ui, repo, run=run, optimize=optimize)