Commit Graph

189 Commits

Author SHA1 Message Date
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
Augie Fackler
8843ab4c98 help: mark boolean flags with [no-] to explain that they can be negated
That is, help gets tweaked thus:

  global options ([+] can be repeated):
   -v --[no-]verbose      enable additional output


Other proposals have included:

  global options ([+] can be repeated, options marked [?] are boolean flags):
   -v --verbose[?]        enable additional output

and

  global options ([+] can be repeated, options marked [^] are boolean flags):
   -v --verbose[^]        enable additional output

which avoid the unfortunate visual noise in this patch. In this
version's favor, it's consistent with what I'm used to seeing in man
pages and similar documentation venues.
2016-09-13 22:58:12 -04:00
Anton Shestakov
9edbb61202 hgweb: make anchor name actually match its href on help index page 2016-09-26 16:12:40 +08:00
Hannes Oldenburg
d853961750 templates: add built-in files() function
We already support multiple primitive for listing files, which were
affected by the current changeset.
This patch adds files() which returns files of the current changeset
matching a given pattern or fileset query via the "set:" prefix.
2016-09-23 08:15:05 +00:00
timeless
129b8093c7 tests: favor single quotes for wrapping hg help ... 2016-09-20 23:49:20 +00:00
timeless
5fd9e9e1b5 help: use single quotes in use warning 2016-09-20 23:47:46 +00:00
Gregory Szorc
9c6bc630a3 ui: path option to declare which revisions to push by default
Now that we have a mechanism for declaring path sub-options, we can
start to pile on features!

Many power users have expressed frustration that bare `hg push`
attempts to push all local revisions to the remote. This patch
introduces the "pushrev" path sub-option to control which revisions
are pushed when no "-r" argument is specified.

The value of this sub-option is a revset, naturally.

A future feature addition could potentially introduce a "pushnames"
sub-options that declares the list of names (branches, bookmarks,
topics, etc) to push by default. The entire "what to push by default"
feature should probably be considered before this patch lands.
2016-06-26 07:59:02 -07:00
Matt Mackall
a24591e84c merge with stable 2016-05-17 11:28:46 -05:00
FUJIWARA Katsunori
17fa5d0520 help: search section of help topic by translated section name correctly
Before this patch, "hg help topic.section" might show unexpected
section of help topic in some encoding.

It applies str.lower() instead of encoding.lower(str) on translated
message to search section case-insensitively, but some encoding uses
0x41(A) - 0x5a(Z) as the second or later byte of multi-byte character
(for example, ja_JP.cp932), and str.lower() causes unexpected result.

To search section of help topic by translated section name correctly,
this patch replaces str.lower() by encoding.lower(str) for both query
string (in commands.help()) and translated help text (in
minirst.getsections()).
2016-05-13 07:19:59 +09:00
Jun Wu
1c8f26818c hgcia: remove hgcia (BC)
As discussed at:
https://www.mercurial-scm.org/pipermail/mercurial-devel/2016-March/081018.html,
cia service is down for years. It also uses socket.setdefaulttimeout() which
will break chg. This patch removes the extension.
2016-05-12 01:03:19 +01:00
Jun Wu
de167181c6 ui: add new config option for help text width
Before this patch, when printing help text using `hg help`, or `hg log -h`,
the output will wrap at 78 chars even if the user has a bigger terminal width
and there is no config option to change it, making the experience different
from the commonly used `man` tool.

This patch introduces a new config option `ui.textwidth`, which replaces the
hardcoded number. It's set to 78 by default to maintain compatibility. When
set to 0, `hg help` will behave more like `man`.
2016-05-04 18:18:24 +01:00
liscju
3f71c6cdfa help: show content for explicitly disabled extension (issue5228) 2016-09-01 22:06:42 +02:00
Gregory Szorc
5c136c2209 help: internals topic for wire protocol
The Mercurial wire protocol is under-documented. This includes a lack
of source docstrings and comments as well as pages on the official
wiki.

This patch adds the beginnings of "internals" documentation on the
wire protocol.

The documentation should have nearly complete coverage on the
lower-level parts of the protocol, such as the different transport
mechanims, how commands and arguments are sent, capabilities, and,
of course, the commands themselves.

As part of writing this documentation, I discovered a number of
deficiencies in the protocol and bugs in the implementation. I've
started sending patches for some of the issues. I hope to send a lot
more.

This patch starts with the scaffolding for a new internals page.
2016-08-22 19:46:39 -07:00
Gregory Szorc
efb3c4ff63 help: don't try to render a section on sub-topics
This patch subtly changes the behavior of the parsing of "X.Y" values
to not set the "section" variable when rendering a known sub-topic.
Previously, "section" would be the same as the sub-topic name. This
required the sub-topic RST to have a section named the same as the
sub-topic name.

When I made this change, the descriptions from help.internalstable
started being rendered in command line output. This didn't look correct
to me, as it didn't match the formatting of main help pages. I
corrected this by moving the top section to help.internalstable and
changing the section levels of all the "internals" topics.

The end result is that "internals" topics now match the rendering of
main topics on both the CLI and HTML. And, "internals" topics no longer
require a main section matching the name of the topic.
2016-08-06 17:04:22 -07:00
liscju
22e1e3529b remove: fix --force option help description (issue5177)
Before this commit --force option help description stated
that file was removed and deleted even if file was added
or modified which is not true. Force option removes added
file only from dirstate, it doesn't delete it from the
filesystem.
2016-04-13 09:56:51 +02:00
timeless
4fdfca9cff help: report source of aliases 2016-04-08 18:35:49 +00:00
Pierre-Yves David
6fceb4873e record: deprecate the extension
The feature has been moved into core behind the -i flag. We can safely
deprecated the extension and point people at the --interactive flag in core.
2016-03-28 12:50:56 -07:00
timeless
81737a7154 filemerge: use revset notation for p1/p2 of local/other descriptions 2016-03-17 00:36:01 +00:00
Yuya Nishihara
8968749681 tests: make config/help tests pass even if chgserver extension is loaded
It isn't important for these tests if "extensions.chgserver=" is set or not.
So let's make them ignore such lines.
2016-03-20 12:25:46 -07:00
timeless
a136072319 filemerge: indicate that local/other are p1/p2 2016-03-17 00:36:01 +00:00
Yuya Nishihara
7d5bdcf68d templater: add debugtemplate command
This is useful for debugging template parsing. Several tests are ported to
this command.
2016-02-14 01:06:12 +09:00
Gregory Szorc
891be7d008 help: document requirements
We didn't have unified documentation of the various repository
requirements. This patch changes that.
2016-03-12 18:51:07 -08:00
timeless
7c2842e773 copyright: update to 2016 2016-01-21 21:15:52 +00:00
timeless
308696c2c1 help: add --system flag to get help for various platform(s) 2016-01-10 08:03:58 +00:00
Gregory Szorc
5732d02b64 exchange: make clone bundles non-experimental and enabled by default
The clone bundles feature was introduced in Mercurial 3.6 behind an
experimental and disabled by default flag. The feature has been enabled
on hg.mozilla.org for a few months and has served many terabytes of
clones. Users have been encouraged to use the feature and reception
has been very positive (mainly due to faster clones as a result of
connecting to a CDN). I have heard no feedback about changing the
feature other than inquiries about when it will be enabled by default.
So, I think the feature is ready to be enabled by default.

This patch renames experimental.clonebundles to ui.clonebundles,
documents the option, and enables it by default. References to the
experimental state of clone bundles have been removed. The remaining
config option docs in clonebundles.py have been removed because they
are redudant with `hg help config`.

There are some oddities with behavior of clone bundles. Because clones
with clone bundles are effectively 2 `hg pull` operations, there may be
2 transactions. This could result in hooks running twice. If the
subsequent pull is aborted, it could result in partial rollback and an
incomplete clone. This behavior is a bit wonky and should probably
be documented. If this patch is accepted, I'll send a follow-up to
document it. I don't think this behavior should prevent the feature
being enabled by default. Reworking the clone mechanism to support
interrupted or multi-part clones feels like a major new feature and
something that when implemented can change the hook and rollback
semantics of clone bundles. Besides, partial clone is better than
full rollback and hooks running on initial clone are likely rare, so I
think the impact is minimal.
2016-01-08 10:58:04 -08:00
timeless
45b895c57d minirst: change hgrole to use single quotes
We decided to reserve double quotes for arguments to hg because cmd
does not like single quotes, so switch the outer quotes to single
2016-01-12 06:03:36 +00:00
Laurent Charignon
f5214fc7b3 debugignore: find out if a file is being ignored
Before this patch debugignore was just displaying the list of ignore patterns.
This patch makes it support a list of filename as argument and tells the user
if those given files are ignored or not.
2016-01-05 07:47:08 -08:00
Gregory Szorc
8e5f315fff internals: document revlog format
It seems like a good idea to document the revlog format.

There is a lot more that could be added to this documentation.
But you have to start somewhere.
2015-12-30 16:21:57 -07:00
Bryan O'Sullivan
ca96e23cd1 dispatch: report similar names consistently 2016-01-04 21:52:44 -08:00
timeless
c09ee5764f help: include section heading if section depth changes
This makes it easier to distinguish between:

"format"
--------
"usestore"
...
    Enabled by default.

and

"progress.format"
    Format of the progress bar.
2016-01-01 16:59:13 +00:00
Gregory Szorc
a3e59a30b6 hgweb: support rendering a sub-topic
If the requested topic contains a "." we assume a sub-topic is
requested and display it.
2015-12-30 17:15:10 -07:00
Gregory Szorc
a320e743a7 hgweb: support rendering sub-topic indexes
If the requested topic name is the name of a sub-topic, we now render
an index of topics within that sub-topic.
2015-12-30 17:34:51 -07:00
Gregory Szorc
627d3b55af templates: make earlycommands and othercommands optional
We now have sub-topics in the help system. The "helptopics" template
serves as a mechanism for displaying an index of help topics.
Previously, it was only used to show the top-level list of help topics,
which includes special groupings of topics.

In the near future, we'll adapt "helptopics" for showing the index
of sub-topics. In this patch, we optionally render {earlycommands} and
{othercommands} since they aren't present on sub-topics.
2015-12-30 17:12:59 -07:00
timeless
c754b0afd2 remove: quote --force in never deletes note
Split Note into a note container
2015-12-22 06:02:01 +00:00
timeless
a433b637d1 commands: the first word of each note should be capital or hg 2015-12-22 02:24:16 +00:00
timeless
78ff92a147 diff: clarify comparison as first parent 2015-12-18 18:52:25 +00:00
Augie Fackler
e4e988fdf5 changegroups: add documentation for cg3 2015-12-18 09:57:35 -05:00
timeless
86a42ddbf7 add: mention .hgignore in help 2015-12-17 14:53:40 +00:00
timeless
8e17ef3397 help: filter extension commands 2015-12-14 05:29:55 +00:00
timeless
37c2440209 test-help: tighten grep patterns
Help should output section headings, but no debug commands
2015-12-14 06:00:32 +00:00
Gregory Szorc
aaa8195abf help: support loading sub-topics
If a sub-topic/section is requested and the main topic corresponds to
a topic with sub-topics, we now look for and return content for a
sub-topic if found.

With this patch, `hg help internals.X` now works. hgweb does not yet
render sub-topics, however.
2015-12-13 11:19:55 -08:00
Gregory Szorc
82617319e9 help: add "internals" topic
We introduce the "internals" help topic, which renders an index of
available sub-topics. The sub-topics themselves are still not
reachable via the help system.
2015-12-13 10:35:03 -08:00
timeless
65f4d64bf2 help: fix help -c/help -e/help -k
Before, hg help -c was the same as hg help, now it only shows commands.
Before, hg help -e was the same as hg help, now it only shows extensions.
Before, hg help -k crashed, now it shows all topics.
2015-12-09 05:56:54 +00:00
timeless
2d7d422638 help: call filtercmd from topicmatch
update test coverage to explicitly define when help -c should
list debug/deprecated items.
2015-12-09 19:09:35 +00:00
Gregory Szorc
e2ea48dfff ui: support declaring path push urls as sub-options
Power users often want to apply per-path configuration options. For
example, they may want to declare an alternate URL for push operations
or declare a revset of revisions to push when `hg push` is used
(as opposed to attempting to push all revisions by default).

This patch establishes the use of sub-options (config options with
":" in the name) to declare additional behavior for paths.

New sub-options are declared by using the new ``@ui.pathsuboption``
decorator. This decorator serves multiple purposes:

* Declaring which sub-options are registered
* Declaring how a sub-option maps to an attribute on ``path``
  instances (this is needed to `hg paths` can render sub-options
  and values properly)
* Validation and normalization of config options to attribute
  values
* Allows extensions to declare new sub-options without monkeypatching
* Allows extensions to overwrite built-in behavior for sub-option
  handling

As convenient as the new option registration decorator is, extensions
(and even core functionality) may still need an additional hook point
to perform finalization of path instances. For example, they may wish
to validate that multiple options/attributes aren't conflicting with
each other. This hook point could be added later, if needed.

To prove this new functionality works, we implement the "pushurl"
path sub-option. This option declares the URL that `hg push` should
use by default.

We require that "pushurl" is an actual URL. This requirement might be
controversial and could be dropped if there is opposition. However,
objectors should read the complicated code in ui.path.__init__ and
commands.push for resolving non-URL values before making a judgement.

We also don't allow #fragment in the URLs. I intend to introduce a
":pushrev" (or similar) option to define a revset to control which
revisions are pushed when "-r <rev>" isn't passed into `hg push`.
This is much more powerful than #fragment and I don't think #fragment
is useful enough to continue supporting.

The [paths] section of the "config" help page has been updated
significantly. `hg paths` has been taught to display path sub-options.

The docs mention that "default-push" is now deprecated. However, there
are several references to it that need to be cleaned up. A large part
of this is converting more consumers to the new paths API. This will
happen naturally as more path sub-options are added and more and more
components need to access them.
2015-12-05 21:11:04 -08:00
Gregory Szorc
d25e6f2fdc commands: add debugdeltachain command
We have debug commands for displaying overall revlog statistics
(debugrevlog) and for dumping a revlog index (debugindex). As part
of investigating various aspects of revlog behavior and performance,
I found it important to have an understanding of how revlog
delta chains behave in practice.

This patch implements a "debugdeltachain" command. For each revision
in a revlog, it dumps information about the delta chain. Which delta
chain it is part of, length of the delta chain, distance since base
revision, info about base revision, size of the delta chain, etc. The
generic formatting facility is used, which means we can templatize
output and get machine readable output like JSON.

This command has already uncovered some weird history in
mozilla-central I didn't know about. So I think it's valuable.
2015-12-05 23:37:46 -08:00
Mathias De Maré
ef88a42655 commands: add example for 'hg add' 2015-11-25 18:10:31 +01:00
Yuya Nishihara
c0b0cd8366 test-help: don't use progress extension for the test of argument parsing
The next patch will remove the progress extension completely, so we have
to pick another extension. The schemes is picked arbitrary.

This test was introduced at 57703c45ed60.
2015-11-27 23:10:48 +09:00
Gregory Szorc
508a4655f7 clonebundles: rewrite documentation
There are a lot of considerations server operators need to know before
deploying clone bundles. They should be documented. So I rewrote the
extension docs to contain this information.
2015-10-17 11:23:54 -07:00