Commit Graph

3150 Commits

Author SHA1 Message Date
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
Yuya Nishihara
ba8dd9e4a1 server: add public function to select either cmdserver or hgweb 2016-10-15 14:19:16 +09:00
Yuya Nishihara
cd5b8b18a0 server: move service factory from hgweb 2016-10-15 14:09:36 +09:00
Yuya Nishihara
e90ef2b652 server: move service table and factory from commandserver
This is necessary to solve future dependency cycle between commandserver.py
and chgserver.py.

'cmd' prefix is added to table and function names to avoid conflicts with
hgweb.
2016-10-15 13:57:17 +09:00
Yuya Nishihara
dce6c5ba27 server: move cmdutil.service() to new module (API)
And call it runservice() because I'll soon add createservice().

The main reason I'm going to introduce the 'server' module is to solve
future dependency cycle between chgserver.py and commandserver.py.

The 'server' module sits at the same layer as the cmdutil. I believe it's
generally good to get rid of things from the big cmdutil module.
2016-10-15 13:47:43 +09: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
Augie Fackler
a75bde8c64 commands: refer to dirstateguard by its new name 2016-11-21 21:06:22 -05:00
Gregory Szorc
11e688b3a4 debuginstall: print compression engine support
Since compression engines may be provided by extensions and since
not all registered compression engines may be available to use,
it seems useful to provide a mechanism to see the state of known
compression engines.

This commit teaches `hg debuginstall` to print info on known and
available compression engines.
2016-11-19 10:54:21 -08:00
Gregory Szorc
e9b25e1f4b commands: print chunk type in debugrevlog
Each data entry ("chunk") in a revlog has a type based on the first
byte of the data. This type indicates how to interpret the data.

This seems like a useful thing to be able to query through a debug
command. So let's add that to `hg debugrevlog`.

This does make `hg debugrevlog` slightly slower, as it has to read
more than just the index. However, even on the mozilla-unified
manifest (which is ~200MB spread over ~350K revisions), this takes
<400ms.
2016-11-17 20:30:00 -08: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
Mads Kiilerich
38cb771268 spelling: fixes of non-dictionary words 2016-10-17 23:16:55 +02:00
Pulkit Goyal
af51d6f213 py3: use pycompat.ossep at certain places
Certain instances of os.sep has been converted to pycompat.ossep where it was
sure to use bytes only. There are more such instances which needs some more
attention and will get surely.
2016-11-06 04:10:33 +05:30
Nathan Goldbaum
cd41ee4190 tag: clarify warning about making a tag on a branch head
Currently the warning is ambiguous about whether the new tag (possibly specified
via --rev) is being added on a branch head or whether the working directory is
based on a branch head. Clarify the error message to eliminate this ambiguity.
2016-10-31 17:12:32 -05:00
FUJIWARA Katsunori
15640c5749 help: replace selenic.com by mercurial-scm.org in command examples
Source code repository service of Mercurial itself has been already
migrated to mercurial-scm.org domain.
2016-11-01 20:39:35 +09:00
Gregory Szorc
3f32afbd84 commands: print security protocol support in debuginstall
Over the past week I've had to instruct multiple people to run
Python code to query the ssl module to see what TLS protocol support
is present. I think it would be useful for `hg debuginstall` to print
this info to make it easier to access and debug why Mercurial is
complaining about using an insecure TLS 1.0 protocol.

Ideally we'd also print the path to the CA cert bundle. But the APIs
for querying that in sslutil can emit warnings, making it slightly
more difficult to integrate into `hg debuginstall`. That work will
have to wait for another day.
2016-10-19 15:07:11 -07:00
Philippe Pepiot
82dc121fd0 commit: return 1 for interactive commit with no changes (issue5397)
For consistency with non interactive commit
2016-10-14 09:52:38 +02:00
Pierre-Yves David
023c7518b5 bisect: extra a small initialisation outside of a loop
Having initialisation done during the first iteration is cute, but can be
avoided.
2016-08-24 05:09:46 +02:00
Augie Fackler
88491409f0 debuginstall: use %d instead of %s for formatting an int
% formatting on bytes on Python 3 is pickier about which % character
we specify.
2016-10-09 09:42:46 -04:00
Pierre-Yves David
a3ad6827e4 bisect: build a displayer only once
There is multiple spot using this, building it early will help to extract more
of the logic into the bisect module.
2016-08-24 05:06:21 +02:00
Pierre-Yves David
440aae6fd1 bisect: factor commonly update sequence
For now, This remains a closure in the module to avoid circular import with used
module.
2016-08-24 05:04:46 +02:00
Pierre-Yves David
7afebe8fb3 bisect: move check_state into the bisect module
Now that the function is simpler, we resume our quest to move the logic into the
bisect module. In the process, we add basic documentation.
2016-08-24 04:25:20 +02:00
Pierre-Yves David
1864a91d18 bisect: simplify conditional in 'check_state'
Now that extra code about "updating" flag have been removed, we can simplify the
condition flow and remove a level.
2016-08-24 04:23:13 +02:00
Pierre-Yves David
d737fb6fef bisect: remove code about "update-flag" in check_state
Now that the flag dedicated to updating the flag are handled earlier, we do not
need to handle them in the 'check_state' function.
2016-08-24 04:22:40 +02:00
Pierre-Yves David
c0f3c6bafe bisect: rename 'check_code' to match our naming scheme
We need to do it early, otherwise 'check-commit' will complain every time we
touch it.
2016-10-09 03:50:55 +02:00
Pierre-Yves David
e6d1c84c27 bisect: minor movement of code handle flag updating state
The code flag handling is quite complicated, we are moving code around to
prepare further simplification.
2016-08-24 04:48:17 +02:00
Pierre-Yves David
452cc705b7 bisect: move 'printresult' in the 'hbisect' module
The logic is already extracted into a closure. We move it into the module
dedicated to bisect.

A minor change is applied: the creation of the 'displayer' is kept in the main
command function, it remove the needs to import 'cmdutil' in 'hbisect'. This
would create an import circle otherwise.
2016-08-24 04:19:11 +02:00
Pierre-Yves David
88806a61a8 bisect: move the 'extendrange' to the 'hbisect' module
We have a module ready to host any bisect logic. That logic was already isolated
in a function so we just migrate it as is.
2016-08-24 04:16:07 +02:00
Pierre-Yves David
8a0460c873 bisect: extract the 'reset' logic into its own function
This is part of small clean up movement. The bisect module seem more appropriate
to host the bisect logic. The cleanup itself is motivated by some higher level
cleanup around vfs and locking.
2016-08-24 04:13:53 +02:00
Pierre-Yves David
8e48e80491 bisect: access the filesystem through vfs when reseting
We have nice and shiny abstractions now.
2016-08-24 04:31:49 +02:00
Simon Farnsworth
3622717b76 merge: add conflict labels to merge command
Now that we present the conflict labels in prompts, it's useful to have
better names than "local" and "other" for every command.
2016-10-07 08:51:50 -07:00
Augie Fackler
8bed0bf30f merge with stable 2016-10-01 15:10:38 -04:00
Kevin Bullock
9eb7f2dc02 grep: rewrite help to better document current (confusing) behavior 2016-09-23 12:45:10 -05:00
timeless
b2cc060f3a serve: use single quotes in use warning 2016-09-20 23:47:02 +00:00
timeless
dd077e79ae bundle: use single quotes in use warning 2016-09-20 23:46:15 +00:00
timeless
872aae0d97 push: update help hint to point to config.paths section 2016-09-20 20:12:38 +00:00
FUJIWARA Katsunori
9e475c7395 doc: fix incorrect use of rst hg role in help text 2016-08-01 06:08:27 +09:00
FUJIWARA Katsunori
7d27fc4948 doc: use field rst syntax to show keywords in debugdeltachain help correctly
List of available keywords is well formatted as a list of fields in
doc string, but is formatted as just normal text in online help
output.
2016-08-01 06:08:26 +09:00