Commit Graph

3281 Commits

Author SHA1 Message Date
Simon Farnsworth
d6cdf14b5e config: set blockedtag when invoking configuration edit 2017-03-06 03:27:24 -08:00
Simon Farnsworth
63ca96dec0 bisect: set a blockedtag when running the check command
So that the hg bisect data clearly shows the bisect command separately to the
main data set.
2017-03-06 03:26:30 -08:00
Yuya Nishihara
7ca440fb7f branches: populate all template keywords in formatter
This is a usage example of fm.context().
2017-02-25 17:08:42 +09:00
Martin von Zweigbergk
5b3eb48725 update: accept --merge to allow merging across topo branches (issue5125) 2017-02-13 12:58:37 -08:00
Pierre-Yves David
a29094b506 color: update main documentation
Now that the feature no longer lives in the extension, we document it in the
help of the core config. This include the new 'ui.color' option introduced in
the previous changesets.

As a result the color extensions can now be deprecated.

This is a documentation patch only; color is still disabled by default.
2017-02-21 20:04:55 +01:00
Pierre-Yves David
b29eb57306 color: add a 'ui.color' option to control color behavior
This new option control whether or not color will be used. It mirror the behavior
of '--color'. I usually avoid adding new option to '[ui]' as the section is
already filled with many option. However, I feel like 'color' is central enough
to deserves a spot in this '[ui]' section.

For now the option is not documented so it is still marked as experimental. Once
it get documented and official, we should be able to deprecate the color
extensions.

There is more cleanup to do before that documentation is written, but we need
this option early to made them. Having that option will allow for more cleanup
of the initialisation process and proper separation between color
configuration.
2017-02-25 19:44:23 +01:00
Pierre-Yves David
e5d5db7cf5 color: add the definition of '--color' in core
If we want to be able to move the initialisation in core, we need core to be
aware of that '--color' flag at all time. So we now have the definition in core. That flag
is currently unprocessed without the extensions (will be fixed soon). In
addition the default value for this flag in core is 'never'. Enabling the
extensions change that default value to 'auto'.
2017-02-21 18:09:21 +01:00
Jun Wu
6faada5b11 serve: mark --stdio and --cmdserver as "(ADVANCED)" flags
This will hide them from the default --help output.
2017-02-22 18:26:12 -08:00
Augie Fackler
01f8d0793b help: move rst formatting of help documents into help.py
This slight refactor will help me improve the 'unknown command'
experience in our new glorious pager future.
2017-02-21 14:17:31 -05:00
Augie Fackler
dfa0dfc344 outgoing: avoid running pager until we're actually showing changes
Consistent with the new behavior of incoming in the previous patch.
2017-02-21 11:06:02 -05:00
Augie Fackler
4aaf8fb8de incoming: delay pager activation until right before printing changes
This prevents authentication and other brief status messages from
being paged.
2017-02-21 10:53:13 -05:00
Augie Fackler
2370f84a66 version: enable pager if --verbose is specified
`hg version` output is very short without --verbose, but with
--verbose it tends to scroll off the user's screen.
2017-02-06 23:08:49 -05:00
Augie Fackler
fde1794204 tags: enable pager 2017-02-06 23:07:16 -05:00
Augie Fackler
c5a4c5d201 summary: enable pager 2017-02-06 23:06:59 -05:00
Augie Fackler
2d27058975 status: enable pager 2017-02-06 23:06:32 -05:00
Augie Fackler
209ab0d249 resolve: enable pager 2017-02-06 23:06:10 -05:00
Augie Fackler
985790e307 paths: enable pager 2017-02-06 23:06:01 -05:00
Augie Fackler
7b68f2b1da outgoing: enable pager
The structure here is similar to incoming, and requires similar treatment.
2017-02-06 23:04:44 -05:00
Augie Fackler
9d43fd6ddc manifest: enable pager 2017-02-06 23:04:26 -05:00
Augie Fackler
01454df49d locate: enable pager 2017-02-06 23:04:10 -05:00
Augie Fackler
9db50905cf incoming: enable pager
The design of incoming means we have to activate the pager in several
places, depending on which codepath gets chosen.
2017-02-06 23:03:48 -05:00
Augie Fackler
046fd9f790 help: enable pager 2017-02-06 23:09:21 -05:00
Augie Fackler
d2ebbe816e grep: enable pager 2017-02-06 23:09:15 -05:00
Augie Fackler
8163007f6e files: enable pager 2017-02-06 23:02:48 -05:00
Augie Fackler
bc44ae0cf0 config: activate pager if not starting an editor
This demonstrates the power of the non-attend-based pager API.
2017-02-06 23:01:42 -05:00
Augie Fackler
31938f0650 log: migrate to modern pager API 2017-02-06 22:59:25 -05:00
Augie Fackler
776882e795 export: migrate to modern pager API 2017-02-06 22:58:54 -05:00
Augie Fackler
a057b6046c diff: migrate to modern pager API 2017-02-06 22:58:26 -05:00
Augie Fackler
4452f8a320 cat: migrate to modern pager API 2017-02-06 22:57:52 -05:00
Augie Fackler
7488e11fe2 annotate: start pager after we're sure we wont abort
This avoids needlessly putting a short error message into the pager.
2017-02-19 15:09:41 -05:00
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
Yuya Nishihara
f5002345c5 help: add pointer how to narrow list of resolved/unresolved files (issue5469) 2017-02-18 18:00:01 +09:00
Augie Fackler
c7eae9f3c3 annotate: migrate to modern pager API 2017-02-06 22:52:47 -05:00
Augie Fackler
3967c4ed9b pager: move more behavior into core
This moves the global flag and the --pager=yes logic into core. Only
functionality change is that users now always get a --pager flag and
can enable the pager via the flag without the extension active.

Moving the flag into core exposes a defect in the ro localization,
which will have to be corrected later.
2017-02-15 17:47:57 -05:00
Martin von Zweigbergk
a305f5d310 update: clarify that -C and -c are mutually exclusive
This makes it clear in both the synopsis and in the verbose output
that -C and -c are mutually exclusive. It also restructures the
verbose output a little so it's better prepared for a third option
(--merge).

This patch also reorders the options to match the flag table.
2017-02-13 15:04:46 -08:00
Martin von Zweigbergk
645fe27a5b update: move check for dirty wdir into hg.updatetotally()
The function has a "check" parameter that's currently unused, and it
makes sense to me to have it honor it. That way other callers than
commands.update() could set it if they needed.
2017-02-13 11:58:02 -08:00
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
Martin von Zweigbergk
2b641873b5 merge with stable 2017-02-13 09:44:16 -08:00
FUJIWARA Katsunori
2afd920706 misc: update year in copyright lines
This patch also makes some expected output lines in tests glob-ed for
persistence of them.

BTW, files below aren't yet changed in 2017, but this patch also
updates copyright of them, because:

    - mercurial/help/hg.1.txt

      almost all of "man hg" output comes from online help of hg
      command, and is already changed in 2017

    - mercurial/help/hgignore.5.txt
    - mercurial/help/hgrc.5

      "copyright 2005-201X Matt Mackall" in them mentions about
      copyright of Mercurial itself
2017-02-12 02:23:33 +09:00
Martin von Zweigbergk
98ebae390c import: mention "stdin" (abbreviated) and add example
I actually didn't even think it was possible because I searched the
help text for "stdin", and didn't even think of searching for
"standard input". Let's mention the abbreviated form too to help
others like me. (When importing from stdin, we actually print a
message saying "applying patch from stdin".)

This patch also adds an example showing how to import from stdin.
2017-02-10 15:26:03 -08:00
Pulkit Goyal
d8a99dbaf7 py3: convert os.__file__ to bytes
os.__file__ returns unicode path on Python 3. We need to have bytespath. This
patch uses pycompat.fsencode() to encode unicode path to bytes path.
2017-02-07 22:47:24 +05:30
Pulkit Goyal
f38d10e539 help: update help for hg update which was misleading (issue5427) 2017-01-18 03:44:19 +05:30
Martin von Zweigbergk
9e63f2d21c bisect: refer directly to bisect() revset predicate in help
We have specific syntax for displaying the help text for a particular
revset predicate, so let's refer directly to the bisect() revset in
the verbose bisect help. It seems likely that the user doesn't care
about other revsets at that point, so they will probably not miss the
text about the other revset predicates.
2017-01-12 12:05:23 -08:00
Martin von Zweigbergk
029203f29d help: remove now-redundant pointer to revsets help
"hg help revisions" and "hg help revsets" now point to the same text,
so drop the revsets reference.
2017-01-12 11:52:05 -08:00
Gregory Szorc
a95fb0b61b wireproto: advertise supported media types and compression formats
This commit introduces support for advertising a server's support for
media types and compression formats in accordance with the spec defined
in internals.wireproto.

The bulk of the new code is a helper function in wireproto.py to
obtain a prioritized list of compression engines available to the
wire protocol. While not utilized yet, we implement support
for obtaining the list of compression engines advertised by the
client.

The upcoming HTTP protocol enhancements are a bit lower-level than
existing tests (most existing tests are command centric). So,
this commit establishes a new test file that will be appropriate
for holding tests around the functionality of the HTTP protocol
itself.

Rounding out this change, `hg debuginstall` now prints compression
engines available to the server.
2016-12-24 15:21:46 -07:00
Gregory Szorc
45174d8965 commands: config option to control bundle compression level
Currently, bundle compression uses the default compression level
for the active compression engine. The default compression level
is tuned as a compromise between speed and size.

Some scenarios may call for a different compression level. For
example, with clone bundles, bundles are generated once and used
several times. Since the cost to generate is paid infrequently,
server operators may wish to trade extra CPU time for better
compression ratios.

This patch introduces an experimental and undocumented config
option to control the bundle compression level. As the inline
comment says, this approach is a bit hacky. I'd prefer for
the compression level to be encoded in the bundle spec. e.g.
"zstd-v2;complevel=15." However, given that the 4.1 freeze is
imminent, I'm not comfortable implementing this user-facing
change without much time to test and consider the implications.
So, we're going with the quick and dirty solution for now.

Having this option in the 4.1 release will enable Mozilla to
easily produce and test zlib and zstd bundles with non-default
compression levels in production. This will help drive future
development of the feature and zstd integration with Mercurial.
2017-01-10 11:20:32 -08:00
Denis Laxalde
6dab59dff8 summary: use ui.label and join to write evolution troubles
Follow-up on da7b2bf5ad52 to avoid a convoluted loop.
2017-01-07 12:24:15 +01:00
Denis Laxalde
5e3ca8d1ab summary: add evolution "troubles" information to summary output
Extend the "parent: " lines in summary with the list of evolution "troubles"
in parentheses, when the parent is troubled.
2017-01-06 14:35:22 +01:00
Denis Laxalde
8ebbb5679b summary: use the same labels as log command in "parent: " line
Re-use the cmdutil._changesetlabels function introduced in c400c86d547f to
have consistent labels between the "changeset: " line in log command and the
"parent: " line in summary.
2017-01-06 14:34:34 +01:00
Yuya Nishihara
2e50d5587f smartset: move set classes and related functions from revset module (API)
These classes are pretty large and independent from revset computation.

  2961 mercurial/revset.py
   973 mercurial/smartset.py
  3934 total

revset.prettyformatset() is renamed to smartset.prettyformat(). Smartset
classes are aliased since they are quite common in revset.py.
2016-10-16 17:28:51 +09:00
Yuya Nishihara
da936af562 help: show section that couldn't be found
For better error indication.
2017-02-05 18:57:19 +09:00
Pulkit Goyal
d310fba3dd py3: have a bytes version of shlex.split()
shlex.split() only accepts unicodes on Python 3. After this patch we will be
using pycompat.shlexsplit(). This patch also replaces existing occurences of
shlex.split with pycompat.shlexsplit.
2016-12-25 03:06:55 +05:30
Pulkit Goyal
007bf9e678 py3: replace sys.executable with pycompat.sysexecutable
sys.executable returns unicodes on Python 3. This patch replaces occurences of
sys.executable with pycompat.sysexecutable.
2016-12-20 00:20:07 +05:30
Pulkit Goyal
8edc9540ee py3: replace sys.platform with pycompat.sysplatform (part 1 of 2)
sys.platform returns unicode on python 3 world. Our code base has most of the
things bytes because of the transformer. So we have a bytes version of this as
pycompat.sysplatform. This series of 2 patches replaces occurences of
sys.platform with pycompat.sysplatform.
2016-12-19 02:15:24 +05:30
Yuya Nishihara
26dd8d740c ui: do not translate empty configsource() to 'none' (API)
It should be processed when displaying data, so we can get "source": "" in
JSON output.
2016-10-23 17:47:00 +09:00
Pulkit Goyal
f18da7ce65 py3: replace os.sep with pycompat.ossep (part 1 of 4)
os.sep returns unicodes on Python 3. We have pycompat.ossep which returns
bytes. This patch is a part of 4 patch series which will replace all the
occurrences of os.sep to pycompat.ossep
2016-12-17 19:56:30 +05:30
Pulkit Goyal
28d96dbde6 py3: use %d instead of %s for integers
Python 3 returns an error if we use %s as type specifiers for integers.
2016-12-17 19:36:40 +05:30
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
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