Details
Details
- Reviewers
yuja - Group Reviewers
hg-reviewers - Commits
- rHGdce0e0f78f0f: help: displaying extension commands by default
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
yuja |
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
for c, e in commands.table.iteritems(): | for c, e in commands.table.iteritems(): | ||||
fs = cmdutil.parsealiases(c) | fs = cmdutil.parsealiases(c) | ||||
f = fs[0] | f = fs[0] | ||||
syns[f] = ', '.join(fs) | syns[f] = ', '.join(fs) | ||||
func = e[0] | func = e[0] | ||||
alias = getattr(func, 'alias', False) | alias = getattr(func, 'alias', False) | ||||
if select and not select(f): | if select and not select(f): | ||||
continue | continue | ||||
# Only list built-in commands (defined in commands.py) and aliases | |||||
# (defined in dispatch.py), but not any other extensions. | |||||
# We don't want a circular dependency between this file and | |||||
# dispatch, so reference that by name. | |||||
# TODO(rdamazio): Just show commands from all extensions. | |||||
if (not select and name != 'shortlist' and | |||||
func.__module__ != commands.__name__ and | |||||
func.__module__ != 'mercurial.dispatch'): | |||||
continue | |||||
doc = pycompat.getdoc(func) | doc = pycompat.getdoc(func) | ||||
if filtercmd(ui, f, func, name, doc): | if filtercmd(ui, f, func, name, doc): | ||||
continue | continue | ||||
doc = gettext(doc) | doc = gettext(doc) | ||||
if not doc: | if not doc: | ||||
doc = _("(no help text available)") | doc = _("(no help text available)") | ||||
h[f] = doc.splitlines()[0].rstrip() | h[f] = doc.splitlines()[0].rstrip() | ||||
> b'hg nohelp', | > b'hg nohelp', | ||||
> norepo=True) | > norepo=True) | ||||
> @command(b'debugoptADV', [(b'', b'aopt', None, b'option is (ADVANCED)')]) | > @command(b'debugoptADV', [(b'', b'aopt', None, b'option is (ADVANCED)')]) | ||||
> @command(b'debugoptDEP', [(b'', b'dopt', None, b'option is (DEPRECATED)')]) | > @command(b'debugoptDEP', [(b'', b'dopt', None, b'option is (DEPRECATED)')]) | ||||
> @command(b'debugoptEXP', [(b'', b'eopt', None, b'option is (EXPERIMENTAL)')]) | > @command(b'debugoptEXP', [(b'', b'eopt', None, b'option is (EXPERIMENTAL)')]) | ||||
> def nohelp(ui, *args, **kwargs): | > def nohelp(ui, *args, **kwargs): | ||||
> pass | > pass | ||||
> | > | ||||
> @command(b'hashelp', [], b'hg hashelp', norepo=True) | |||||
> def hashelp(ui, *args, **kwargs): | |||||
> """Extension command's help""" | |||||
> pass | |||||
> | |||||
> def uisetup(ui): | > def uisetup(ui): | ||||
> ui.setconfig(b'alias', b'shellalias', b'!echo hi', b'helpext') | > ui.setconfig(b'alias', b'shellalias', b'!echo hi', b'helpext') | ||||
> ui.setconfig(b'alias', b'hgalias', b'summary', b'helpext') | > ui.setconfig(b'alias', b'hgalias', b'summary', b'helpext') | ||||
> ui.setconfig(b'alias', b'hgalias:doc', b'My doc', b'helpext') | > ui.setconfig(b'alias', b'hgalias:doc', b'My doc', b'helpext') | ||||
> ui.setconfig(b'alias', b'hgalias:category', b'navigation', b'helpext') | > ui.setconfig(b'alias', b'hgalias:category', b'navigation', b'helpext') | ||||
> ui.setconfig(b'alias', b'hgaliasnodoc', b'summary', b'helpext') | > ui.setconfig(b'alias', b'hgaliasnodoc', b'summary', b'helpext') | ||||
> | > | ||||
> EOF | > EOF | ||||
-n -- normal desc | -n -- normal desc | ||||
--newline VALUE line1 line2 | --newline VALUE line1 line2 | ||||
--callableopt VALUE adds foo | --callableopt VALUE adds foo | ||||
--customopt VALUE adds bar | --customopt VALUE adds bar | ||||
--customopt-withdefault VALUE adds bar (default: foo) | --customopt-withdefault VALUE adds bar (default: foo) | ||||
(some details hidden, use --verbose to show complete help) | (some details hidden, use --verbose to show complete help) | ||||
Test that default list of commands includes extension commands that have help, | |||||
but not those that don't, except in verbose mode, when a keyword is passed, or | |||||
when help about the extension is requested. | |||||
#if no-extraextensions | |||||
$ hg help | grep hashelp | |||||
hashelp Extension command's help | |||||
$ hg help | grep nohelp | |||||
[1] | |||||
$ hg help -v | grep nohelp | |||||
nohelp (no help text available) | |||||
$ hg help -k nohelp | $ hg help -k nohelp | ||||
Commands: | Commands: | ||||
nohelp hg nohelp | nohelp hg nohelp | ||||
Extension Commands: | Extension Commands: | ||||
nohelp (no help text available) | nohelp (no help text available) | ||||
Test that default list of commands omits extension commands | $ hg help helpext | ||||
helpext extension - no help text available | |||||
#if no-extraextensions | |||||
$ hg help | |||||
Mercurial Distributed SCM | |||||
list of commands: | list of commands: | ||||
Repository creation: | hashelp Extension command's help | ||||
nohelp (no help text available) | |||||
clone make a copy of an existing repository | |||||
init create a new repository in the given directory | |||||
Remote repository management: | |||||
incoming show new changesets found in source | |||||
outgoing show changesets not found in the destination | |||||
paths show aliases for remote repositories | |||||
pull pull changes from the specified source | |||||
push push changes to the specified destination | |||||
serve start stand-alone webserver | |||||
Change creation: | |||||
commit commit the specified files or all outstanding changes | |||||
Change manipulation: | |||||
backout reverse effect of earlier changeset | |||||
graft copy changes from other branches onto the current branch | |||||
merge merge another revision into working directory | |||||
Change organization: | |||||
bookmarks create a new bookmark or list existing bookmarks | |||||
branch set or show the current branch name | |||||
branches list repository named branches | |||||
phase set or show the current phase name | |||||
tag add one or more tags for the current or given revision | |||||
tags list repository tags | |||||
File content management: | |||||
annotate show changeset information by line for each file | |||||
cat output the current or given revision of files | |||||
copy mark files as copied for the next commit | |||||
diff diff repository (or selected files) | |||||
grep search revision history for a pattern in specified files | |||||
Change navigation: | |||||
bisect subdivision search of changesets | |||||
heads show branch heads | |||||
hgalias My doc | |||||
identify identify the working directory or specified revision | |||||
log show revision history of entire repository or files | |||||
Working directory management: | |||||
add add the specified files on the next commit | |||||
addremove add all new files, delete all missing files | |||||
files list tracked files | |||||
forget forget the specified files on the next commit | |||||
remove remove the specified files on the next commit | |||||
rename rename files; equivalent of copy + remove | |||||
resolve redo merges or set/view the merge status of files | |||||
revert restore files to their checkout state | |||||
root print the root (top) of the current working directory | |||||
status show changed files in the working directory | |||||
summary summarize working directory state | |||||
update update working directory (or switch revisions) | |||||
Change import/export: | |||||
archive create an unversioned archive of a repository revision | |||||
bundle create a bundle file | |||||
export dump the header and diffs for one or more changesets | |||||
import import an ordered set of patches | |||||
unbundle apply one or more bundle files | |||||
Repository maintenance: | |||||
manifest output the current or given revision of the project manifest | |||||
recover roll back an interrupted transaction | |||||
verify verify the integrity of the repository | |||||
Help: | |||||
config show combined config settings from all hgrc files | |||||
help show help for a given topic or a help overview | |||||
version output version and copyright information | |||||
enabled extensions: | |||||
helpext (no help text available) | |||||
additional help topics: | |||||
Mercurial identifiers: | |||||
filesets Specifying File Sets | |||||
hgignore Syntax for Mercurial Ignore Files | |||||
patterns File Name Patterns | |||||
revisions Specifying Revisions | |||||
urls URL Paths | |||||
Mercurial output: | |||||
color Colorizing Outputs | |||||
dates Date Formats | |||||
diffs Diff Formats | |||||
templating Template Usage | |||||
Mercurial configuration: | |||||
config Configuration Files | |||||
environment Environment Variables | |||||
extensions Using Additional Features | |||||
flags Command-line flags | |||||
hgweb Configuring hgweb | |||||
merge-tools Merge Tools | |||||
pager Pager Support | |||||
Concepts: | |||||
bundlespec Bundle File Formats | |||||
glossary Glossary | |||||
phases Working with Phases | |||||
subrepos Subrepositories | |||||
Miscellaneous: | |||||
deprecated Deprecated Features | |||||
internals Technical implementation topics | |||||
scripting Using Mercurial from scripts and automation | |||||
(use 'hg help -v' to show built-in aliases and global options) | (use 'hg help -v helpext' to show built-in aliases and global options) | ||||
#endif | #endif | ||||
Test list of internal help commands | Test list of internal help commands | ||||
$ hg help debug | $ hg help debug | ||||
debug commands (internal and unsupported): | debug commands (internal and unsupported): | ||||
| | | | | | | | | | ||||
+------------------------------------------------------+ | +------------------------------------------------------+ | ||||
That is, a *chunk* consisting of the filename (not terminated or padded) | That is, a *chunk* consisting of the filename (not terminated or padded) | ||||
followed by N chunks constituting the *delta group* for this file. The | followed by N chunks constituting the *delta group* for this file. The | ||||
*empty chunk* at the end of each *delta group* denotes the boundary to the | *empty chunk* at the end of each *delta group* denotes the boundary to the | ||||
next filelog sub-segment. | next filelog sub-segment. | ||||
Test list of commands with command with no help text | |||||
$ hg help helpext | |||||
helpext extension - no help text available | |||||
list of commands: | |||||
nohelp (no help text available) | |||||
(use 'hg help -v helpext' to show built-in aliases and global options) | |||||
test advanced, deprecated and experimental options are hidden in command help | test advanced, deprecated and experimental options are hidden in command help | ||||
$ hg help debugoptADV | $ hg help debugoptADV | ||||
hg debugoptADV | hg debugoptADV | ||||
(no help text available) | (no help text available) | ||||
options: | options: | ||||
<tr><td> | <tr><td> | ||||
<a href="/help/grep"> | <a href="/help/grep"> | ||||
grep | grep | ||||
</a> | </a> | ||||
</td><td> | </td><td> | ||||
search revision history for a pattern in specified files | search revision history for a pattern in specified files | ||||
</td></tr> | </td></tr> | ||||
<tr><td> | <tr><td> | ||||
<a href="/help/hashelp"> | |||||
hashelp | |||||
</a> | |||||
</td><td> | |||||
Extension command's help | |||||
</td></tr> | |||||
<tr><td> | |||||
<a href="/help/heads"> | <a href="/help/heads"> | ||||
heads | heads | ||||
</a> | </a> | ||||
</td><td> | </td><td> | ||||
show branch heads | show branch heads | ||||
</td></tr> | </td></tr> | ||||
<tr><td> | <tr><td> | ||||
<a href="/help/help"> | <a href="/help/help"> |