Commit Graph

57 Commits

Author SHA1 Message Date
Jun Wu
c20843c592 debugfsinfo: print fstype information
Since we have osutil.getfstype, it'll be handy if "debugfsinfo" prints it.
2017-03-12 01:34:17 -08:00
Ryan McElroy
0030afb0ce debug: use tryunlink 2017-03-21 06:50:28 -07:00
Yuya Nishihara
264083dae7 debugtemplate: pass ui to templater so label() works
Follows up 64cf8f39aac2.
2017-03-18 19:59:47 +09:00
Yuya Nishihara
02022fc3c5 util: wrap s.encode('string_escape') call for future py3 compatibility 2017-03-15 23:06:50 +09:00
Kyle Lippincott
a0eab21ffc debuglabelcomplete: fix to call debugnamecomplete in new location
debugnamecomplete was moved in a9aa67ba from commands to debugcommands, but
debuglabelcomplete was not modified to call it in its new location.
2017-03-14 13:10:30 -07:00
Pierre-Yves David
518f3459b5 vfs: use 'vfs' module directly in 'mercurial.debugcommand'
Now that the 'vfs' classes moved in their own module, lets use the new module
directly. We update code iteratively to help with possible bisect needs in the
future.
2017-03-02 13:31:07 +01:00
Pierre-Yves David
e5cb48ac36 vfs: replace 'scmutil.opener' usage with 'scmutil.vfs'
The 'vfs' class is the first class citizen for years. We remove all usages of
the older API. This will let us remove the old API eventually.
2017-03-02 03:52:36 +01:00
Pierre-Yves David
bfa78d1064 color: cleanup 'debugcolor' logic
Now that style are carried by the 'ui' object, we no longer need complicated
logic to restore the original style. We just need to copy the 'ui' and work on
the copied version.
2017-02-25 19:43:14 +01:00
Pierre-Yves David
394a984c5e color: move 'debugcolor' into the 'debugcommands' modules
This is the last bits we needed to move out of the extensions. 'hgext/color.py'
now only contains logic to changes the default color behavior to 'auto'.

However, more cleanups are on the way and we need to document the new config
directly in core.
2017-02-21 18:41:37 +01:00
Pulkit Goyal
22dbb9466c py3: use pycompat.fsencode() to convert __file__ to bytes
__file__ returns unicodes on Python 3. This patch uses pycompat.fsencode() to
convert them to bytes.
2017-02-20 18:40:42 +05:30
Yuya Nishihara
b2229f5117 revset: split language services to revsetlang module (API)
New revsetlang module hosts parser, tokenizer, and miscellaneous functions
working on parsed tree. It does not include functions for evaluation such as
getset() and match().

  2288 mercurial/revset.py
   684 mercurial/revsetlang.py
  2972 total

get*() functions are aliased since they are common in revset.py.
2017-02-19 18:19:33 +09:00
Pulkit Goyal
7f47e65fef py3: convert the mode argument of os.fdopen to unicodes
Couple of these from the earlier series got lost while rebasing. So this patch
converts them again.
2017-02-16 17:30:35 +05:30
Pierre-Yves David
8a9827fe5f debugcommands: move 'debugwireargs' in the new module 2017-02-02 10:07:53 +01:00
Pierre-Yves David
1bbc8f9ef7 debugcommands: move 'debugwalk' in the new module 2017-02-02 10:07:28 +01:00
Pierre-Yves David
68e72c9e9f debugcommands: move 'debugtemplate' in the new module 2017-02-02 10:06:01 +01:00
Pierre-Yves David
5413311102 debugcommands: move 'debugsuccessorssets' in the new module 2017-02-02 10:05:22 +01:00
Pierre-Yves David
eb978b57f3 debugcommands: move 'debugsub' in the new module 2017-02-02 10:04:55 +01:00
Pierre-Yves David
389ca05060 debugcommands: move 'debugstate' in the new module 2017-02-02 10:04:34 +01:00
Pierre-Yves David
1aad61ce3a debugcommands: move 'debugsetparents' in the new module 2017-02-02 10:04:02 +01:00
Pierre-Yves David
05add5088d debugcommands: move 'debugrevspec' in the new module 2017-02-02 10:03:31 +01:00
Pierre-Yves David
45e4019b63 debugcommands: move 'debugrevlog' in the new module 2017-02-02 10:02:40 +01:00
Pierre-Yves David
83109d4530 debugcommands: move 'debugrename' in the new module 2017-02-02 10:01:54 +01:00
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