D5069: help: adding a proper declaration for shortlist/basic commands
rdamazio (Rodrigo Damazio Bovendorp)
phabricator at mercurial-scm.org
Sat Oct 13 10:48:03 UTC 2018
rdamazio updated this revision to Diff 12043.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D5069?vs=12035&id=12043
REVISION DETAIL
https://phab.mercurial-scm.org/D5069
AFFECTED FILES
contrib/perf.py
hgext/absorb.py
hgext/blackbox.py
hgext/fastannotate/commands.py
hgext/githelp.py
hgext/mq.py
hgext/record.py
hgext/sparse.py
hgext/split.py
hgext/uncommit.py
mercurial/cmdutil.py
mercurial/commands.py
mercurial/help.py
mercurial/hgweb/webcommands.py
mercurial/registrar.py
tests/test-completion.t
CHANGE DETAILS
diff --git a/tests/test-completion.t b/tests/test-completion.t
--- a/tests/test-completion.t
+++ b/tests/test-completion.t
@@ -231,31 +231,18 @@
Show all commands + options
$ hg debugcommands
add: include, exclude, subrepos, dry-run
+ addremove: similarity, subrepos, include, exclude, dry-run
annotate: rev, follow, no-follow, text, user, file, date, number, changeset, line-number, skip, ignore-all-space, ignore-space-change, ignore-blank-lines, ignore-space-at-eol, include, exclude, template
- clone: noupdate, updaterev, rev, branch, pull, uncompressed, stream, ssh, remotecmd, insecure
- commit: addremove, close-branch, amend, secret, edit, interactive, include, exclude, message, logfile, date, user, subrepos
- diff: rev, change, text, git, binary, nodates, noprefix, show-function, reverse, ignore-all-space, ignore-space-change, ignore-blank-lines, ignore-space-at-eol, unified, stat, root, include, exclude, subrepos
- export: bookmark, output, switch-parent, rev, text, git, binary, nodates, template
- forget: interactive, include, exclude, dry-run
- init: ssh, remotecmd, insecure
- log: follow, follow-first, date, copies, keyword, rev, line-range, removed, only-merges, user, only-branch, branch, prune, patch, git, limit, no-merges, stat, graph, style, template, include, exclude
- merge: force, rev, preview, abort, tool
- pull: update, force, rev, bookmark, branch, ssh, remotecmd, insecure
- push: force, rev, bookmark, branch, new-branch, pushvars, ssh, remotecmd, insecure
- remove: after, force, subrepos, include, exclude, dry-run
- serve: accesslog, daemon, daemon-postexec, errorlog, port, address, prefix, name, web-conf, webdir-conf, pid-file, stdio, cmdserver, templates, style, ipv6, certificate, print-url, subrepos
- status: all, modified, added, removed, deleted, clean, unknown, ignored, no-status, terse, copies, print0, rev, change, include, exclude, subrepos, template
- summary: remote
- update: clean, check, merge, date, rev, tool
- addremove: similarity, subrepos, include, exclude, dry-run
archive: no-decode, prefix, rev, type, subrepos, include, exclude
backout: merge, commit, no-commit, parent, rev, edit, tool, include, exclude, message, logfile, date, user
bisect: reset, good, bad, skip, extend, command, noupdate
bookmarks: force, rev, delete, rename, inactive, list, template
branch: force, clean, rev
branches: active, closed, template
bundle: force, rev, branch, base, all, type, ssh, remotecmd, insecure
cat: output, rev, decode, include, exclude, template
+ clone: noupdate, updaterev, rev, branch, pull, uncompressed, stream, ssh, remotecmd, insecure
+ commit: addremove, close-branch, amend, secret, edit, interactive, include, exclude, message, logfile, date, user, subrepos
config: untrusted, edit, local, global, template
copy: after, force, include, exclude, dry-run
debugancestor:
@@ -317,30 +304,43 @@
debugwhyunstable:
debugwireargs: three, four, five, ssh, remotecmd, insecure
debugwireproto: localssh, peer, noreadstderr, nologhandshake, ssh, remotecmd, insecure
+ diff: rev, change, text, git, binary, nodates, noprefix, show-function, reverse, ignore-all-space, ignore-space-change, ignore-blank-lines, ignore-space-at-eol, unified, stat, root, include, exclude, subrepos
+ export: bookmark, output, switch-parent, rev, text, git, binary, nodates, template
files: rev, print0, include, exclude, template, subrepos
+ forget: interactive, include, exclude, dry-run
graft: rev, continue, stop, abort, edit, log, no-commit, force, currentdate, currentuser, date, user, tool, dry-run
grep: print0, all, diff, text, follow, ignore-case, files-with-matches, line-number, rev, all-files, user, date, template, include, exclude
heads: rev, topo, active, closed, style, template
help: extension, command, keyword, system
identify: rev, num, id, branch, tags, bookmarks, ssh, remotecmd, insecure, template
import: strip, base, edit, force, no-commit, bypass, partial, exact, prefix, import-branch, message, logfile, date, user, similarity
incoming: force, newest-first, bundle, rev, bookmarks, branch, patch, git, limit, no-merges, stat, graph, style, template, ssh, remotecmd, insecure, subrepos
+ init: ssh, remotecmd, insecure
locate: rev, print0, fullpath, include, exclude
+ log: follow, follow-first, date, copies, keyword, rev, line-range, removed, only-merges, user, only-branch, branch, prune, patch, git, limit, no-merges, stat, graph, style, template, include, exclude
manifest: rev, all, template
+ merge: force, rev, preview, abort, tool
outgoing: force, rev, newest-first, bookmarks, branch, patch, git, limit, no-merges, stat, graph, style, template, ssh, remotecmd, insecure, subrepos
parents: rev, style, template
paths: template
phase: public, draft, secret, force, rev
+ pull: update, force, rev, bookmark, branch, ssh, remotecmd, insecure
+ push: force, rev, bookmark, branch, new-branch, pushvars, ssh, remotecmd, insecure
recover:
+ remove: after, force, subrepos, include, exclude, dry-run
rename: after, force, include, exclude, dry-run
resolve: all, list, mark, unmark, no-status, re-merge, tool, include, exclude, template
revert: all, date, rev, no-backup, interactive, include, exclude, dry-run
rollback: dry-run, force
root:
+ serve: accesslog, daemon, daemon-postexec, errorlog, port, address, prefix, name, web-conf, webdir-conf, pid-file, stdio, cmdserver, templates, style, ipv6, certificate, print-url, subrepos
+ status: all, modified, added, removed, deleted, clean, unknown, ignored, no-status, terse, copies, print0, rev, change, include, exclude, subrepos, template
+ summary: remote
tag: force, local, rev, remove, edit, message, date, user
tags: template
tip: patch, git, style, template
unbundle: update
+ update: clean, check, merge, date, rev, tool
verify:
version: template
diff --git a/mercurial/registrar.py b/mercurial/registrar.py
--- a/mercurial/registrar.py
+++ b/mercurial/registrar.py
@@ -170,12 +170,13 @@
def _doregister(self, func, name, options=(), synopsis=None,
norepo=False, optionalrepo=False, inferrepo=False,
- intents=None, helpcategory=None):
+ intents=None, helpcategory=None, helpbasic=False):
func.norepo = norepo
func.optionalrepo = optionalrepo
func.inferrepo = inferrepo
func.intents = intents or set()
func.helpcategory = helpcategory
+ func.helpbasic = helpbasic
if synopsis:
self._table[name] = func, list(options), synopsis
else:
diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py
+++ b/mercurial/hgweb/webcommands.py
@@ -1412,8 +1412,8 @@
if 'DEPRECATED' in doc or c.startswith('debug'):
continue
cmd = primary(c)
- if cmd.startswith('^'):
- early.append((cmd[1:], doc))
+ if getattr(e[0], 'helpbasic', False):
+ early.append((cmd, doc))
else:
other.append((cmd, doc))
diff --git a/mercurial/help.py b/mercurial/help.py
--- a/mercurial/help.py
+++ b/mercurial/help.py
@@ -502,16 +502,14 @@
f = fs[0]
syns[f] = ', '.join(fs)
func = e[0]
- p = ''
- if c.startswith("^"):
- p = '^'
- if select and not select(p + f):
+ if select and not select(f):
continue
if (not select and name != 'shortlist' and
func.__module__ != commands.__name__):
continue
- if name == "shortlist" and not p:
- continue
+ if name == "shortlist":
+ if not getattr(func, 'helpbasic', False):
+ continue
doc = pycompat.getdoc(func)
if filtercmd(ui, f, name, doc):
continue
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -131,11 +131,11 @@
# Commands start here, listed alphabetically
- at command('^add',
+ at command('add',
walkopts + subrepoopts + dryrunopts,
_('[OPTION]... [FILE]...'),
helpcategory=help.CATEGORY_WORKING_DIRECTORY,
- inferrepo=True)
+ helpbasic=True, inferrepo=True)
def add(ui, repo, *pats, **opts):
"""add the specified files on the next commit
@@ -256,7 +256,7 @@
matcher = scmutil.match(repo[None], pats, opts)
return scmutil.addremove(repo, matcher, "", opts)
- at command('^annotate|blame',
+ at command('annotate|blame',
[('r', 'rev', '', _('annotate the specified revision'), _('REV')),
('', 'follow', None,
_('follow copies/renames and list the filename (DEPRECATED)')),
@@ -272,7 +272,7 @@
] + diffwsopts + walkopts + formatteropts,
_('[-r REV] [-f] [-a] [-u] [-d] [-n] [-c] [-l] FILE...'),
helpcategory=help.CATEGORY_FILE_CONTENTS,
- inferrepo=True)
+ helpbasic=True, inferrepo=True)
def annotate(ui, repo, *pats, **opts):
"""show changeset information by line for each file
@@ -1399,7 +1399,7 @@
return cmdutil.cat(ui, repo, ctx, m, fm, fntemplate, '',
**pycompat.strkwargs(opts))
- at command('^clone',
+ at command('clone',
[('U', 'noupdate', None, _('the clone will include an empty working '
'directory (only a repository)')),
('u', 'updaterev', '', _('revision, tag, or branch to check out'),
@@ -1416,7 +1416,7 @@
] + remoteopts,
_('[OPTION]... SOURCE [DEST]'),
helpcategory=help.CATEGORY_REPO_CREATION,
- norepo=True)
+ helpbasic=True, norepo=True)
def clone(ui, source, dest=None, **opts):
"""make a copy of an existing repository
@@ -1555,7 +1555,7 @@
return r is None
- at command('^commit|ci',
+ at command('commit|ci',
[('A', 'addremove', None,
_('mark new/missing files as added/removed before committing')),
('', 'close-branch', None,
@@ -1567,7 +1567,7 @@
] + walkopts + commitopts + commitopts2 + subrepoopts,
_('[OPTION]... [FILE]...'),
helpcategory=help.CATEGORY_COMMITTING,
- inferrepo=True)
+ helpbasic=True, inferrepo=True)
def commit(ui, repo, *pats, **opts):
"""commit the specified files or all outstanding changes
@@ -1867,7 +1867,7 @@
def debugcommands(ui, cmd='', *args):
"""list all available commands and options"""
for cmd, vals in sorted(table.iteritems()):
- cmd = cmd.split('|')[0].strip('^')
+ cmd = cmd.split('|')[0]
opts = ', '.join([i[1] for i in vals[1]])
ui.write('%s: %s\n' % (cmd, opts))
@@ -1900,14 +1900,13 @@
cmdlist = [' '.join(c[0]) for c in cmdlist.values()]
ui.write("%s\n" % "\n".join(sorted(cmdlist)))
- at command('^diff',
+ at command('diff',
[('r', 'rev', [], _('revision'), _('REV')),
('c', 'change', '', _('change made by revision'), _('REV'))
] + diffopts + diffopts2 + walkopts + subrepoopts,
_('[OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...'),
helpcategory=help.CATEGORY_FILE_CONTENTS,
- inferrepo=True,
- intents={INTENT_READONLY})
+ helpbasic=True, inferrepo=True, intents={INTENT_READONLY})
def diff(ui, repo, *pats, **opts):
"""diff repository (or selected files)
@@ -1995,7 +1994,7 @@
listsubrepos=opts.get('subrepos'),
root=opts.get('root'))
- at command('^export',
+ at command('export',
[('B', 'bookmark', '',
_('export changes only reachable by given bookmark')),
('o', 'output', '',
@@ -2005,7 +2004,7 @@
] + diffopts + formatteropts,
_('[OPTION]... [-o OUTFILESPEC] [-r] [REV]...'),
helpcategory=help.CATEGORY_IMPORT_EXPORT,
- intents={INTENT_READONLY})
+ helpbasic=True, intents={INTENT_READONLY})
def export(ui, repo, *changesets, **opts):
"""dump the header and diffs for one or more changesets
@@ -2198,12 +2197,12 @@
return cmdutil.files(ui, ctx, m, fm, fmt, opts.get('subrepos'))
@command(
- '^forget',
+ 'forget',
[('i', 'interactive', None, _('use interactive mode')),
] + walkopts + dryrunopts,
_('[OPTION]... FILE...'),
helpcategory=help.CATEGORY_WORKING_DIRECTORY,
- inferrepo=True)
+ helpbasic=True, inferrepo=True)
def forget(ui, repo, *pats, **opts):
"""forget the specified files on the next commit
@@ -3549,9 +3548,9 @@
del repo._subtoppath
- at command('^init', remoteopts, _('[-e CMD] [--remotecmd CMD] [DEST]'),
- helpcategory=help.CATEGORY_REPO_CREATION,
- norepo=True)
+ at command('init', remoteopts, _('[-e CMD] [--remotecmd CMD] [DEST]'),
+ helpcategory=help.CATEGORY_REPO_CREATION,
+ helpbasic=True, norepo=True)
def init(ui, dest=".", **opts):
"""create a new repository in the given directory
@@ -3624,7 +3623,7 @@
return ret
- at command('^log|history',
+ at command('log|history',
[('f', 'follow', None,
_('follow changeset history, or file history across copies and renames')),
('', 'follow-first', None,
@@ -3650,7 +3649,7 @@
] + logopts + walkopts,
_('[OPTION]... [FILE]'),
helpcategory=help.CATEGORY_CHANGE_NAVIGATION,
- inferrepo=True,
+ helpbasic=True, inferrepo=True,
intents={INTENT_READONLY})
def log(ui, repo, *pats, **opts):
"""show revision history of entire repository or files
@@ -3878,16 +3877,16 @@
fm.write('path', '%s\n', f)
fm.end()
- at command('^merge',
+ at command('merge',
[('f', 'force', None,
_('force a merge including outstanding changes (DEPRECATED)')),
('r', 'rev', '', _('revision to merge'), _('REV')),
('P', 'preview', None,
_('review revisions to merge (no merge is performed)')),
('', 'abort', None, _('abort the ongoing merge')),
] + mergetoolopts,
_('[-P] [[-r] REV]'),
- helpcategory=help.CATEGORY_CHANGE_MANAGEMENT)
+ helpcategory=help.CATEGORY_CHANGE_MANAGEMENT, helpbasic=True)
def merge(ui, repo, node=None, **opts):
"""merge another revision into working directory
@@ -4305,7 +4304,7 @@
elif not ui.configbool('commands', 'update.requiredest'):
ui.status(_("(run 'hg update' to get a working copy)\n"))
- at command('^pull',
+ at command('pull',
[('u', 'update', None,
_('update to new branch head if new descendants were pulled')),
('f', 'force', None, _('run even when remote repository is unrelated')),
@@ -4315,7 +4314,8 @@
_('BRANCH')),
] + remoteopts,
_('[-u] [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [SOURCE]'),
- helpcategory=help.CATEGORY_REMOTE_REPO_MANAGEMENT)
+ helpcategory=help.CATEGORY_REMOTE_REPO_MANAGEMENT,
+ helpbasic=True)
def pull(ui, repo, source="default", **opts):
"""pull changes from the specified source
@@ -4435,7 +4435,7 @@
other.close()
return ret
- at command('^push',
+ at command('push',
[('f', 'force', None, _('force push')),
('r', 'rev', [],
_('a changeset intended to be included in the destination'),
@@ -4447,7 +4447,8 @@
('', 'pushvars', [], _('variables that can be sent to server (ADVANCED)')),
] + remoteopts,
_('[-f] [-r REV]... [-e CMD] [--remotecmd CMD] [DEST]'),
- helpcategory=help.CATEGORY_REMOTE_REPO_MANAGEMENT)
+ helpcategory=help.CATEGORY_REMOTE_REPO_MANAGEMENT,
+ helpbasic=True)
def push(ui, repo, dest=None, **opts):
"""push changes to the specified destination
@@ -4589,14 +4590,14 @@
return hg.verify(repo)
return 1
- at command('^remove|rm',
+ at command('remove|rm',
[('A', 'after', None, _('record delete for missing files')),
('f', 'force', None,
_('forget added files, delete modified files')),
] + subrepoopts + walkopts + dryrunopts,
_('[OPTION]... FILE...'),
helpcategory=help.CATEGORY_WORKING_DIRECTORY,
- inferrepo=True)
+ helpbasic=True, inferrepo=True)
def remove(ui, repo, *pats, **opts):
"""remove the specified files on the next commit
@@ -5132,7 +5133,7 @@
"""
ui.write(repo.root + "\n")
- at command('^serve',
+ at command('serve',
[('A', 'accesslog', '', _('name of access log file to write to'),
_('FILE')),
('d', 'daemon', None, _('run server in background')),
@@ -5161,7 +5162,7 @@
+ subrepoopts,
_('[OPTION]...'),
helpcategory=help.CATEGORY_REMOTE_REPO_MANAGEMENT,
- optionalrepo=True)
+ helpbasic=True, optionalrepo=True)
def serve(ui, repo, **opts):
"""start stand-alone webserver
@@ -5205,7 +5206,7 @@
_NOTTERSE = 'nothing'
- at command('^status|st',
+ at command('status|st',
[('A', 'all', None, _('show status of all files')),
('m', 'modified', None, _('show only modified files')),
('a', 'added', None, _('show only added files')),
@@ -5223,7 +5224,7 @@
] + walkopts + subrepoopts + formatteropts,
_('[OPTION]... [FILE]...'),
helpcategory=help.CATEGORY_WORKING_DIRECTORY,
- inferrepo=True,
+ helpbasic=True, inferrepo=True,
intents={INTENT_READONLY})
def status(ui, repo, *pats, **opts):
"""show changed files in the working directory
@@ -5409,10 +5410,11 @@
cmdutil.morestatus(repo, fm)
fm.end()
- at command('^summary|sum',
+ at command('summary|sum',
[('', 'remote', None, _('check for push and pull'))],
'[--remote]',
helpcategory=help.CATEGORY_WORKING_DIRECTORY,
+ helpbasic=True,
intents={INTENT_READONLY})
def summary(ui, repo, **opts):
"""summarize working directory state
@@ -5927,15 +5929,16 @@
return postincoming(ui, repo, modheads, opts.get(r'update'), None, None)
- at command('^update|up|checkout|co',
+ at command('update|up|checkout|co',
[('C', 'clean', None, _('discard uncommitted changes (no backup)')),
('c', 'check', None, _('require clean working directory')),
('m', 'merge', None, _('merge uncommitted changes')),
('d', 'date', '', _('tipmost revision matching date'), _('DATE')),
('r', 'rev', '', _('revision'), _('REV'))
] + mergetoolopts,
_('[-C|-c|-m] [-d DATE] [[-r] REV]'),
- helpcategory=help.CATEGORY_WORKING_DIRECTORY)
+ helpcategory=help.CATEGORY_WORKING_DIRECTORY,
+ helpbasic=True)
def update(ui, repo, node=None, **opts):
"""update working directory (or switch revisions)
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -185,7 +185,7 @@
return newlyaddedandmodifiedfiles
def parsealiases(cmd):
- return cmd.lstrip("^").split("|")
+ return cmd.split("|")
def setupwrapcolorwrite(ui):
# wrap ui.write so diff output can be labeled/colorized
@@ -673,7 +673,7 @@
debugchoice = {}
if cmd in table:
- # short-circuit exact matches, "log" alias beats "^log|history"
+ # short-circuit exact matches, "log" alias beats "log|history"
keys = [cmd]
else:
keys = table.keys()
diff --git a/hgext/uncommit.py b/hgext/uncommit.py
--- a/hgext/uncommit.py
+++ b/hgext/uncommit.py
@@ -192,7 +192,7 @@
for data in ctx.repo().obsstore.predecessors.get(ctx.node(), ()):
yield obsutil.marker(ctx.repo(), data)
- at command('^unamend', [], helpcategory=help.CATEGORY_CHANGE_MANAGEMENT)
+ at command('unamend', [], helpcategory=help.CATEGORY_CHANGE_MANAGEMENT)
def unamend(ui, repo, **opts):
"""undo the most recent amend operation on a current changeset
diff --git a/hgext/split.py b/hgext/split.py
--- a/hgext/split.py
+++ b/hgext/split.py
@@ -45,12 +45,12 @@
# leave the attribute unspecified.
testedwith = 'ships-with-hg-core'
- at command('^split',
+ at command('split',
[('r', 'rev', '', _("revision to split"), _('REV')),
('', 'rebase', True, _('rebase descendants after split')),
] + cmdutil.commitopts2,
_('hg split [--no-rebase] [[-r] REV]'),
- helpcategory=help.CATEGORY_CHANGE_MANAGEMENT)
+ helpcategory=help.CATEGORY_CHANGE_MANAGEMENT, helpbasic=True)
def split(ui, repo, *revs, **opts):
"""split a changeset into smaller ones
diff --git a/hgext/sparse.py b/hgext/sparse.py
--- a/hgext/sparse.py
+++ b/hgext/sparse.py
@@ -122,7 +122,7 @@
propname))
def _setuplog(ui):
- entry = commands.table['^log|history']
+ entry = commands.table['log|history']
entry[1].append(('', 'sparse', None,
"limit to changesets affecting the sparse checkout"))
@@ -163,7 +163,7 @@
return orig(ui, repo, *args, **opts)
def _setupclone(ui):
- entry = commands.table['^clone']
+ entry = commands.table['clone']
entry[1].append(('', 'enable-profile', [],
'enable a sparse profile'))
entry[1].append(('', 'include', [],
@@ -173,7 +173,7 @@
extensions.wrapcommand(commands.table, 'clone', _clonesparsecmd)
def _setupadd(ui):
- entry = commands.table['^add']
+ entry = commands.table['add']
entry[1].append(('s', 'sparse', None,
'also include directories of added files in sparse config'))
@@ -237,7 +237,7 @@
return orig(self, *args)
extensions.wrapfunction(dirstate.dirstate, func, _wrapper)
- at command('^debugsparse', [
+ at command('debugsparse', [
('I', 'include', False, _('include files in the sparse checkout')),
('X', 'exclude', False, _('exclude files in the sparse checkout')),
('d', 'delete', False, _('delete an include/exclude rule')),
@@ -249,7 +249,8 @@
('', 'refresh', False, _('updates the working after sparseness changes')),
('', 'reset', False, _('makes the repo full again')),
] + commands.templateopts,
- _('[--OPTION] PATTERN...'))
+ _('[--OPTION] PATTERN...'),
+ helpbasic=True)
def debugsparse(ui, repo, *pats, **opts):
"""make the current checkout sparse, or edit the existing checkout
diff --git a/hgext/record.py b/hgext/record.py
--- a/hgext/record.py
+++ b/hgext/record.py
@@ -33,7 +33,7 @@
@command("record",
# same options as commit + white space diff options
- [c for c in commands.table['^commit|ci'][1][:]
+ [c for c in commands.table['commit|ci'][1][:]
if c[1] != "interactive"] + cmdutil.diffwsopts,
_('hg record [OPTION]... [FILE]...'),
helpcategory=help.CATEGORY_COMMITTING)
@@ -139,7 +139,7 @@
(qrecord,
# same options as qnew, but copy them so we don't get
# -i/--interactive for qrecord and add white space diff options
- mq.cmdtable['^qnew'][1][:] + cmdutil.diffwsopts,
+ mq.cmdtable['qnew'][1][:] + cmdutil.diffwsopts,
_('hg qrecord [OPTION]... PATCH [FILE]...'))
_wrapcmd('qnew', mq.cmdtable, qnew, _("interactively record a new patch"))
diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -2434,10 +2434,11 @@
commands.add(ui, r)
return 0
- at command("^qinit",
+ at command("qinit",
[('c', 'create-repo', None, _('create queue repository'))],
_('hg qinit [-c]'),
- helpcategory=help.CATEGORY_REPO_CREATION)
+ helpcategory=help.CATEGORY_REPO_CREATION,
+ helpbasic=True)
def init(ui, repo, **opts):
"""init a new queue repository (DEPRECATED)
@@ -2541,7 +2542,7 @@
hg.update(repo, repo.changelog.tip())
@command("qcommit|qci",
- commands.table["^commit|ci"][1],
+ commands.table["commit|ci"][1],
_('hg qcommit [OPTION]... [FILE]...'),
helpcategory=help.CATEGORY_COMMITTING,
inferrepo=True)
@@ -2624,7 +2625,7 @@
if not opts.get('date') and opts.get('currentdate'):
opts['date'] = "%d %d" % dateutil.makedate()
- at command("^qnew",
+ at command("qnew",
[('e', 'edit', None, _('invoke editor on commit messages')),
('f', 'force', None, _('import uncommitted changes (DEPRECATED)')),
('g', 'git', None, _('use git extended diff format')),
@@ -2636,7 +2637,7 @@
_('add "Date: <DATE>" to patch'), _('DATE'))
] + cmdutil.walkopts + cmdutil.commitopts,
_('hg qnew [-e] [-m TEXT] [-l FILE] PATCH [FILE]...'),
- helpcategory=help.CATEGORY_COMMITTING,
+ helpcategory=help.CATEGORY_COMMITTING, helpbasic=True,
inferrepo=True)
def new(ui, repo, patch, *args, **opts):
"""create a new patch
@@ -2672,7 +2673,7 @@
q.savedirty()
return 0
- at command("^qrefresh",
+ at command("qrefresh",
[('e', 'edit', None, _('invoke editor on commit messages')),
('g', 'git', None, _('use git extended diff format')),
('s', 'short', None,
@@ -2687,7 +2688,7 @@
_('add/update date field in patch with given date'), _('DATE'))
] + cmdutil.walkopts + cmdutil.commitopts,
_('hg qrefresh [-I] [-X] [-e] [-m TEXT] [-l FILE] [-s] [FILE]...'),
- helpcategory=help.CATEGORY_COMMITTING,
+ helpcategory=help.CATEGORY_COMMITTING, helpbasic=True,
inferrepo=True)
def refresh(ui, repo, *pats, **opts):
"""update the current patch
@@ -2719,10 +2720,10 @@
q.savedirty()
return ret
- at command("^qdiff",
+ at command("qdiff",
cmdutil.diffopts + cmdutil.diffopts2 + cmdutil.walkopts,
_('hg qdiff [OPTION]... [FILE]...'),
- helpcategory=help.CATEGORY_FILE_CONTENTS,
+ helpcategory=help.CATEGORY_FILE_CONTENTS, helpbasic=True,
inferrepo=True)
def diff(ui, repo, *pats, **opts):
"""diff of the current patch and subsequent modifications
@@ -2957,7 +2958,7 @@
newpath = path + ".%d" % (index + 1)
return newpath
- at command("^qpush",
+ at command("qpush",
[('', 'keep-changes', None,
_('tolerate non-conflicting local changes')),
('f', 'force', None, _('apply on top of local changes')),
@@ -2972,7 +2973,8 @@
_('reorder patch series and apply only the patch')),
('', 'no-backup', None, _('do not save backup copies of files'))],
_('hg qpush [-f] [-l] [-a] [--move] [PATCH | INDEX]'),
- helpcategory=help.CATEGORY_CHANGE_ORGANIZATION)
+ helpcategory=help.CATEGORY_CHANGE_ORGANIZATION,
+ helpbasic=True)
def push(ui, repo, patch=None, **opts):
"""push the next patch onto the stack
@@ -3004,16 +3006,17 @@
keepchanges=opts.get('keep_changes'))
return ret
- at command("^qpop",
+ at command("qpop",
[('a', 'all', None, _('pop all patches')),
('n', 'name', '',
_('queue name to pop (DEPRECATED)'), _('NAME')),
('', 'keep-changes', None,
_('tolerate non-conflicting local changes')),
('f', 'force', None, _('forget any local changes to patched files')),
('', 'no-backup', None, _('do not save backup copies of files'))],
_('hg qpop [-a] [-f] [PATCH | INDEX]'),
- helpcategory=help.CATEGORY_CHANGE_ORGANIZATION)
+ helpcategory=help.CATEGORY_CHANGE_ORGANIZATION,
+ helpbasic=True)
def pop(ui, repo, patch=None, **opts):
"""pop the current patch off the stack
diff --git a/hgext/githelp.py b/hgext/githelp.py
--- a/hgext/githelp.py
+++ b/hgext/githelp.py
@@ -51,9 +51,9 @@
s = re.sub('~$', '~1', s)
return s
- at command('^githelp|git', [
+ at command('githelp|git', [
], _('hg githelp'),
- helpcategory=help.CATEGORY_HELP)
+ helpcategory=help.CATEGORY_HELP, helpbasic=True)
def githelp(ui, repo, *args, **kwargs):
'''suggests the Mercurial equivalent of the given git command
diff --git a/hgext/fastannotate/commands.py b/hgext/fastannotate/commands.py
--- a/hgext/fastannotate/commands.py
+++ b/hgext/fastannotate/commands.py
@@ -222,8 +222,8 @@
def registercommand():
"""register the fastannotate command"""
- name = '^fastannotate|fastblame|fa'
- command(name, **fastannotatecommandargs)(fastannotate)
+ name = 'fastannotate|fastblame|fa'
+ command(name, helpbasic=True, **fastannotatecommandargs)(fastannotate)
def wrapdefault():
"""wrap the default annotate command, to be aware of the protocol"""
diff --git a/hgext/blackbox.py b/hgext/blackbox.py
--- a/hgext/blackbox.py
+++ b/hgext/blackbox.py
@@ -227,11 +227,12 @@
repo._wlockfreeprefix.add('blackbox.log')
- at command('^blackbox',
+ at command('blackbox',
[('l', 'limit', 10, _('the number of events to show')),
],
_('hg blackbox [OPTION]...'),
- helpcategory=help.CATEGORY_MAINTENANCE)
+ helpcategory=help.CATEGORY_MAINTENANCE,
+ helpbasic=True)
def blackbox(ui, repo, *revs, **opts):
'''view the recent repository events
'''
diff --git a/hgext/absorb.py b/hgext/absorb.py
--- a/hgext/absorb.py
+++ b/hgext/absorb.py
@@ -941,7 +941,7 @@
ui.write(_('nothing applied\n'))
return state
- at command('^absorb',
+ at command('absorb',
[('p', 'print-changes', None,
_('print which changesets are modified by which changes')),
('i', 'interactive', None,
@@ -951,7 +951,8 @@
'(EXPERIMENTAL)')),
] + commands.dryrunopts + commands.walkopts,
_('hg absorb [OPTION] [FILE]...'),
- helpcategory=help.CATEGORY_COMMITTING)
+ helpcategory=help.CATEGORY_COMMITTING,
+ helpbasic=True)
def absorbcmd(ui, repo, *pats, **opts):
"""incorporate corrections into the stack of draft changesets
diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -149,7 +149,7 @@
# define parsealiases locally, because cmdutil.parsealiases has been
# available since 1.5 (or 6252852b4332)
def parsealiases(cmd):
- return cmd.lstrip(b"^").split(b"|")
+ return cmd.split(b"|")
if safehasattr(registrar, 'command'):
command = registrar.command(cmdtable)
To: rdamazio, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list