Commit Graph

124 Commits

Author SHA1 Message Date
Matt Mackall
dd45bff834 help: allow -k to find debug commands 2014-03-22 14:46:55 -05:00
Mads Kiilerich
a57ca0591a help: let 'hg help debug' show the list of secret debug commands
The names of the debug commands are not easy to remember and they are not easy
to find.
2014-03-15 16:14:04 +01:00
Simon Heimberg
eb788ff3c1 help: filter out deprecated options with untranslated descriptions
When using a different language than English, deprecated options were only
removed from the output of `hg help anycmd` when "DEPRECATED" in the options
description was translated.
2014-02-17 07:39:53 +01:00
Augie Fackler
9f1555e9f5 help: exclude deprecated extensions in the disabled part of 'help extensions' 2014-02-27 15:39:07 -05:00
Augie Fackler
9f876f6c89 cleanup: move stdlib imports to their own import statement
There are a few warnings still produced by my import checker, but
those are false positives produced by modules that share a name with
stdlib modules.
2013-11-06 16:48:06 -05:00
FUJIWARA Katsunori
af33f66d43 help: use full name of extensions to look up them for keyword search
Before this patch, "hg help -k KEYWORD" fails, if there is the
extension of which name includes ".", because "extensions.load()"
invoked from "help.topicmatch()" fails to look such extension up, even
though it is already loaded in.

"help.topicmatch()" invokes "extensions.load()" with the name gotten
from "extensions.enabled()". The former expects full name of extension
(= key in '[extensions]' section), but the latter returns names
shortened by "split('.')[-1]". This difference causes failure of
looking extension up.

This patch adds "shortname" argument to "extensions.enabled()" to make
it return shortened names only if it is True. "help.topicmatch()"
turns it off to get full name of extensions.

Then, this patch shortens full name of extensions by "split('.')[-1]"
for showing them in the list of extensions.

Shortening is also applied on names gotten from
"extensions.disabled()" but harmless, because it returns only
extensions directly under "hgext" and their names should not include
".".
2013-09-23 20:23:25 +09:00
Dan Villiom Podlaski Christiansen
d045d03b91 help: use a full header for topic titles
...for prettier HTML!
2013-02-10 12:58:57 +01:00
Dan Villiom Podlaski Christiansen
3950055bca help: move the majority of the help command to the help module
We move the logic for generating the unformatted ReST source to the
help module, in order to eventually avoid calling commands.help_()
from hgweb.

No functionality change.
2013-02-09 21:51:21 +00:00
FUJIWARA Katsunori
477c2590ac help: indicate help omitting if help document is not fully displayed
Before this patch, there is no information about whether help document
is fully displayed or not.

So, some users seem to misunderstand "-v" for "hg help" just as "the
option to show list of global options": experience on "hg help -v" for
some commands not containing verbose containers may strengthen this
misunderstanding.

Such users have less opportunity for noticing omitted help document,
and this may cause insufficient understanding about Mercurial.

This patch indicates help omitting, if help document is not fully
displayed.

For command help, the message below is displayed at the end of help
output, if help document is not fully displayed:

    use "hg -v help xxxx" to show more complete help and the global
    options

and otherwise:

    use "hg -v help xxxx" to show the global options

For topics and extensions help, the message below is displayed, only
if help document is not fully displayed:

    use "hg help -v xxxx" to show more complete help

This allows users to know whether there is any omitted information or
not exactly, and can trigger "hg help -v" invocation.

This patch causes formatting help document twice, to switch messages
one for omitted help, and another for not omitted. This decreases
performance of help document formatting, but it is not mainly focused
at help command invocation, so this wouldn't become problem.
2012-10-18 10:31:15 +09:00
Mads Kiilerich
21e1a1a932 help: add 'mergetools' alias for the 'merge-tools' help topic
The '-' in 'merge-tools' is surprising but necessary in the configuration.
Let's help those who forget that and are looking for help.
2012-08-01 00:20:10 +02:00
Mads Kiilerich
4d30442bbe help: use the first topic name from helptable, not the longest alias
This makes the 'additional help topics' list consistent with the output from
keyword search (for instance subrepo/subrepos).

The sorting by longest name was introduced in 4cbe49492ad3. There might have
been a good reason for it back then, but now it seems like a better idea to
place the preferred name first in the list in helptable.
2012-08-01 14:59:15 +02:00
Mads Kiilerich
ae7b3c7a3b help: fix helptable indentation 2012-08-01 00:18:23 +02:00
epriestley
182772cb75 templatekw/help: document the {parents} keyword
The {parents} keyword does not appear in the generated documentation for
templates because it is added by `changeset_templater` (and this is because
its behavior depends on `ui`, so it can't be defined as a normal template
keyword; see comments in `changeset_templater._show()`).

Add it to the documentation synthetically by creating a stub documentation
function.

Test plan: built the docs and examined the man page to verify that this
keyword is now documented. I'm not sure how to test the i18n extraction part,
but assume it will just work given that this patch doesn't do anything too
crazy.
2012-07-10 09:11:53 -07:00
Olav Reinert
7c9defd0db help: fix extension commands help in keyword search
This patch fixes the synopsis shown for extension commands in keyword search
results. A previous patch erroneously caused the extension synopsis to be shown
instead.

Test cases for keyword search are missing, so I added a one.
2012-06-07 01:42:50 +02:00
Thomas Arendsen Hein
b3cb4187dd help: fix 'hg help -k' matching an extension without docs
getattr is not needed, __doc__ always exists and defaults to None
2012-06-07 15:54:40 +02:00
Olav Reinert
f234123b57 help: fix keyword search output for extension commands
This patch fixes the help keyword search "hg help -k" to show correct results
in the section listing extension commands.
2012-06-03 17:49:04 +02:00
Olav Reinert
8cf6a50897 help: format extension lists using RST
This change is a move towards generating all help text as a list of strings
marked up with RST.
2012-06-02 11:22:33 +02:00
Nikolaj Sjujskij
a32492fbe8 help: fix search with -k option in non-ASCII locales
Keyword search in help (introduced in d455a324f54f and ff267c569bea by Augie
Fackler) tries to translate already translated strings, which results in
Unicode errors in gettext when non-ASCII locale is used. Also command
descriptions should be translated before searching there (thanks to FUJIWARA
Katsunori for pointing this out and actual fix), (issue3482).
2012-06-04 10:45:56 +04:00
Olav Reinert
243a5a590a help: inline helper function used once only 2012-06-01 12:01:33 +02:00
Olav Reinert
70c42374e2 minirst: generate tables as a list of joined lines 2012-06-01 11:58:23 +02:00
Olav Reinert
b372d3da28 help: move some helper functions to help.py 2012-05-22 22:08:41 +02:00
Augie Fackler
c94e6f7b05 help: add --keyword (-k) for searching help 2012-05-13 06:03:11 -05:00
Augie Fackler
a21ee7f93d help: introduce topicmatch for finding topics matching a keyword 2012-05-13 04:27:08 -05:00
A. S. Budden
95a9277375 help: add reference to template help (issue3413)
There is currently no clear link between the help for log
and the help on templates.  The log option is --template
but the template help is 'help templating' or 'help templates'.
This patch makes 'hg help template' work and also adds a
note into the log help explaining where to find more info.
2012-05-01 22:14:51 +01:00
Martin Geisler
63259931d2 help: consistently use title capitalization for help topics 2012-04-30 11:51:24 +02:00
Yann E. MORIN
fa26f04b05 help: strip doctest from dochelp
When a dochelp string contains doctest code, the doctest
code is not stripped, so the help also displays the doctest.

Just stop parsing dochelp at the first hint of a doctest
section (starting with >>>).

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2012-03-09 22:54:17 +01:00
FUJIWARA Katsunori
4629df01c9 filemerge: create detail of internal merge tools from documentation string
this patch introduces 'internaltoolsmarker' which creates detail of
each internal merge tools from documentation string for 'hg help merge-tools'.
2012-02-12 21:38:12 +09:00
Matt Mackall
578253989c help: add phases topic 2012-01-26 11:23:14 -06:00
Augie Fackler
c1bfd9e71f windows: check util.mainfrozen() instead of ad-hoc checks everywhere 2011-07-25 16:14:02 -05:00
Matt Mackall
c8c26720e0 fileset: add a help topic
Add crosslinking with patterns topic.
2011-06-18 16:53:49 -05:00
Matt Mackall
1d5abac148 help: consolidate topic hooks in help.py
This removes loops like cmdutil->revset->help->extensions->cmdutil and
simplifies the code.
2011-05-13 12:57:27 -05:00
Matt Mackall
9fd29f01e9 extensions: move moduledoc to break import loop with help 2011-05-13 11:04:51 -05:00
Matt Mackall
d184ed2af2 extensions: drop maxlength from enabled and disabled
This is a bad/silly API. Instead calculate maxlength in one place in help
it's used and simplify all the callers.
2011-05-13 11:04:51 -05:00
Dan Villiom Podlaski Christiansen
511c941422 prevent transient leaks of file handle by using new helper functions
These leaks may occur in environments that don't employ a reference
counting GC, i.e. PyPy.

This implies:
 - changing opener(...).read() calls to opener.read(...)
 - changing opener(...).write() calls to opener.write(...)
 - changing open(...).read(...) to util.readfile(...)
 - changing open(...).write(...) to util.writefile(...)
2011-05-02 10:11:18 +02:00
Yun Lee
c6804b1629 help: move hgignore man page into built-in help (issue2769) 2011-04-17 23:08:35 +08:00
Yun Lee
fd8965dcbb help: sort help topics to make the output more readable (issue2751) 2011-04-05 12:40:47 +08:00
Patrick Mezard
d297dd65c7 help: extract items doc generation function 2011-03-12 12:46:31 +01:00
Patrick Mezard
4f21d24f6f Add subrepos help topic
Edited by:
Martin Geisler <mg@lazybytes.net>
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
2010-10-24 19:28:44 +02:00
Patrick Mezard
88087f644b help: add topic rewriting hooks
They are useful when updating help topics dynamically from extensions.
2010-10-23 19:21:49 +02:00
Martin Geisler
5afa27a390 help: add "revset" alias for "revsets" help topic 2010-10-23 17:45:49 +02:00
Erik Zielke
9ef6ae89b7 help: help topic for merge tools
I have made a help topic for merge tools. The text in the topic is
based on the http://mercurial.selenic.com/wiki/MergeProgram page from
the wiki, along with some extra information on the internal merge tools.
2010-10-20 16:54:34 +02:00
Matt Mackall
51b3b09c8f backout most of 26e0b9a8ce0d 2010-09-24 12:46:54 -05:00
Brodie Rao
7362459729 cleanup: use x in (a, b) instead of x == a or x == b 2010-09-23 00:02:31 -05:00
Martin Geisler
76b0f88494 help: make "hg help hgrc" an alias for "hg help config" 2010-09-02 12:53:28 +02:00
Martin Geisler
4e818c92d7 help: make helptable a list instead of a tuple
The table should always have been a list so that extensions can append
their own help topics -- hgsubversion would like to do this now.
2010-07-22 21:43:45 +02:00
Martin Geisler
66a319e69f help: new revsets topic
Based on a patch by timeless which in turn is based on

  http://selenic.com/pipermail/mercurial-devel/2010-June/021638.html
2010-06-17 17:21:39 +03:00
Faheem Mitha
45dd4bd055 help: add "glossary" topic
Joint work with Vishakh Harikumar, Pradeepkumar Gayam, David Champion,
Mark Booth, timeless, Matt Mackall, Heinrik Stuart, Greg Ward, and
Martin Geisler.
2010-06-16 15:20:22 +05:30
Matt Mackall
6f4ee16a11 help: add some help for hgweb.config files 2010-04-26 11:03:40 -05:00
Benoit Boissinot
f11d48adc1 help: it's not necessary to escape quotes 2010-03-16 16:41:22 +01:00
Brodie Rao
91c6eab10f dispatch: provide help for disabled extensions and commands
Before a command is declared unknown, each extension in hgext is searched,
starting with hgext.<cmdname>. If there's a matching command, a help message
suggests the appropriate extension and how to enable it.

Every extension could potentially be imported, but for cases like rebase,
relink, etc. only one extension is imported.

For the case of "hg help disabledext", if the extension is in hgext, the
extension description is read and a similar help suggestion is printed.
No extension import occurs.
2010-02-07 14:01:43 +01:00