comparison 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
comparison
equal deleted inserted replaced
30774:eaa5607132a2 30775:513d68a90398
32 fileset, 32 fileset,
33 hg, 33 hg,
34 localrepo, 34 localrepo,
35 lock as lockmod, 35 lock as lockmod,
36 pycompat, 36 pycompat,
37 repair,
37 revlog, 38 revlog,
38 scmutil, 39 scmutil,
39 setdiscovery, 40 setdiscovery,
40 simplemerge, 41 simplemerge,
41 streamclone, 42 streamclone,
871 repository data is swapped in. This window will be as long as it takes to 872 repository data is swapped in. This window will be as long as it takes to
872 rename some directories inside the ``.hg`` directory. On most machines, this 873 rename some directories inside the ``.hg`` directory. On most machines, this
873 should complete almost instantaneously and the chances of a consumer being 874 should complete almost instantaneously and the chances of a consumer being
874 unable to access the repository should be low. 875 unable to access the repository should be low.
875 """ 876 """
876 raise error.Abort(_('not yet implemented')) 877 return repair.upgraderepo(ui, repo, run=run, optimize=optimize)