Commit Graph

85 Commits

Author SHA1 Message Date
Pierre-Yves David
1e95d66c06 debugcommands: move 'debugrebuildfncache' in the new module 2017-02-02 10:01:00 +01:00
Pierre-Yves David
74184e0c1e debugcommands: move 'debugrebuilddirstate' in the new module 2017-02-02 10:00:26 +01:00
Pierre-Yves David
4ce21eab61 debugcommands: move 'debugpvec' in the new module 2017-02-02 09:59:47 +01:00
Pierre-Yves David
76f079037b debugcommands: move 'debugpushkey' in the new module 2017-02-01 17:48:30 +01:00
Pierre-Yves David
b9a9f5a1dd debugcommands: move 'debugpathcomplete' in the new module 2017-02-01 17:47:35 +01:00
Pierre-Yves David
28c82b2cb9 debugcommands: move 'debugobsolete' in the new module 2017-02-01 17:46:21 +01:00
Pierre-Yves David
9303dddfba debugcommands: move 'debuglocks' in the new module 2017-02-01 17:42:49 +01:00
Pierre-Yves David
28987a9a4d debugcommands: move 'debugnamecomplete' in the new module 2017-02-01 17:41:12 +01:00
Pierre-Yves David
fa71d3be28 debugcommands: move 'debugmergestate' in the new module 2017-02-01 17:40:20 +01:00
Pierre-Yves David
33363270fe debugcommands: move 'debuglabelcomplete' in the new module 2017-02-01 17:39:31 +01:00
Pierre-Yves David
7530639d94 debugcommands: move 'debugknown' in the new module 2017-02-01 17:33:46 +01:00
Pierre-Yves David
efc08d5147 debugcommands: extract debuginstall in the debugcommands module 2017-02-01 17:31:05 +01:00
Gregory Szorc
f42e2dcaac 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.
2016-12-18 16:16:54 -08:00
Gregory Szorc
16568ee7f0 debugcommands: stub for debugupgraderepo command
Currently, if Mercurial introduces a new repository/store feature or
changes behavior of an existing feature, users must perform an
`hg clone` to create a new repository with hopefully the
correct/optimal settings. Unfortunately, even `hg clone` may not
give the correct results. For example, if you do a local `hg clone`,
you may get hardlinks to revlog files that inherit the old state.
If you `hg clone` from a remote or `hg clone --pull`, changegroup
application may bypass some optimization, such as converting to
generaldelta.

Optimizing a repository is harder than it seems and requires more
than a simple `hg` command invocation.

This commit starts the process of changing that. We introduce
`hg debugupgraderepo`, a command that performs an in-place upgrade
of a repository to use new, optimal features. The command is just
a stub right now. Features will be added in subsequent commits.

This commit does foreshadow some of the behavior of the new command,
notably that it doesn't do anything by default and that it takes
arguments that influence what actions it performs. These will be
explained more in subsequent commits.
2016-11-24 16:24:09 -08:00
Remi Chaintron
6d11b9177b revlog: add 'raw' argument to revision and _addrevision
This patch introduces a new 'raw' argument (defaults to False) to revlog's
revision() and _addrevision() methods.
When the 'raw' argument is set to True, it indicates the revision data should be
handled as raw data by the flagprocessor.

Note: Given revlog.addgroup() calls are restricted to changegroup generation, we
can always set raw to True when calling revlog._addrevision() from
revlog.addgroup().
2017-01-05 17:16:07 +00:00
Gregory Szorc
d5c4807106 debugcommands: sort command order
The diff is a bit large but it is straight code moving without any
logical modifications.
2016-11-25 09:59:39 -08:00
Gregory Szorc
275bf7db29 debugcommands: move 'debugdeltachain' in the new module 2016-08-17 21:01:02 -07:00
Gregory Szorc
df02df41b0 debugcommands: move 'debugindex' and 'debugindexdot' in the new module 2016-08-17 21:00:11 -07:00
Gregory Szorc
56f5ef7ff5 debugcommands: move 'debugignore' in the new module 2016-08-17 20:59:13 -07:00
Gregory Szorc
1ec64ddf29 debugcommands: move 'debuggetbundle' in the new module 2016-11-10 09:44:47 -08:00
Gregory Szorc
a47dd1170a debugcommands: move 'debugfsinfo' in the new module 2016-08-17 20:58:16 -07:00
Gregory Szorc
c3736a6fe2 debugcommands: move 'debugfileset' in the new module 2016-08-17 20:57:57 -07:00
Pulkit Goyal
97f340e354 py3: use pycompat.getcwd() instead of os.getcwd()
We have pycompat.getcwd() which returns bytes path on Python 3. This patch
changes most of the occurences of the os.getcwd() with pycompat one.
2016-11-23 00:03:11 +05:30
Gregory Szorc
06abee55d2 debugcommands: move 'debugextensions' to the new module 2016-08-17 20:57:15 -07:00
Gregory Szorc
ba40ffc6e2 debugcommands: move 'debugdiscovery' in the module
And a lot of imports with it.
2016-08-17 20:56:11 -07:00
Gregory Szorc
7264f083ae debugcommands: move 'debugdate' in the new module 2016-08-17 20:43:31 -07:00
Gregory Szorc
cf8519801e debugcommands: move 'debugrevlogopts' into the new module
This move contains the first reference to debugrevlogopts in
debugcommands.py. We'll eventually want to move that over. We
hold off for now because it would introduce a module import cycle.
2016-08-17 20:43:05 -07:00
Gregory Szorc
2ba0f93ffa debugcommands: move 'debugdag' into the new module 2016-08-17 20:41:54 -07:00
Gregory Szorc
303aeb84db debugcommands: move 'debugcomplete' in the new module 2016-08-17 20:41:05 -07:00
Gregory Szorc
7f445fcd9f debugcommands: move 'debugcommands' in the new module
The commit message isn't an illusion. There is a "debugcommands"
module and command.
2016-08-17 20:40:13 -07:00
Gregory Szorc
a42f62ddd5 debugcommands: move 'debugcheckstate' in the new module 2016-08-17 20:38:29 -07:00
Gregory Szorc
cc37221bd3 debugcommands: move debug{create,apply}streambundleclone to the new module 2016-08-17 20:37:54 -07:00
Gregory Szorc
424411ae17 debugcommands: move 'debugbundle' in the new module 2016-08-17 21:07:22 -07:00
Gregory Szorc
190f2e7fdb debugcommands: move debugbuilddag
And we drop some now unused imports from commands.py.
2016-11-10 09:45:42 -08:00
Gregory Szorc
f70b24b885 debugcommands: introduce standalone module for debug commands
commands.py is our largest .py file by nearly 2x. Debug commands live
in a world of their own. So let's extract them to their own module.

We start with "debugancestor."

We currently reuse the commands table with commands.py and have a hack
in dispatch.py for loading debugcommands.py. In the future, we could
potentially use a separate commands table and avoid the import of
debugcommands.py.
2016-08-17 21:07:38 -07:00