Mercurial > hg-stable
changeset 40295:fa88170c10bb
help: adding a proper declaration for shortlist/basic commands (API)
We previously used the '^' prefix to indicate that a command
should be shown on the short list (shown for just "hg"), but
that's a horrible hack, so I'm removing it.
Differential Revision: https://phab.mercurial-scm.org/D5069
author | Rodrigo Damazio <rdamazio@google.com> |
---|---|
date | Fri, 12 Oct 2018 18:49:11 +0200 |
parents | fabbf9310025 |
children | e787d97e90ad |
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 |
diffstat | 16 files changed, 104 insertions(+), 95 deletions(-) [+] |
line wrap: on
line diff
--- a/contrib/perf.py Fri Oct 12 18:06:32 2018 +0200 +++ b/contrib/perf.py Fri Oct 12 18:49:11 2018 +0200 @@ -152,7 +152,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)
--- a/hgext/absorb.py Fri Oct 12 18:06:32 2018 +0200 +++ b/hgext/absorb.py Fri Oct 12 18:49:11 2018 +0200 @@ -982,7 +982,7 @@ ui.write(_('nothing applied\n')) return state -@command('^absorb', +@command('absorb', [('a', 'apply-changes', None, _('apply changes without prompting for confirmation')), ('p', 'print-changes', None, @@ -994,7 +994,8 @@ '(EXPERIMENTAL)')), ] + commands.dryrunopts + commands.templateopts + commands.walkopts, _('hg absorb [OPTION] [FILE]...'), - helpcategory=command.CATEGORY_COMMITTING) + helpcategory=command.CATEGORY_COMMITTING, + helpbasic=True) def absorbcmd(ui, repo, *pats, **opts): """incorporate corrections into the stack of draft changesets
--- a/hgext/blackbox.py Fri Oct 12 18:06:32 2018 +0200 +++ b/hgext/blackbox.py Fri Oct 12 18:49:11 2018 +0200 @@ -226,11 +226,12 @@ repo._wlockfreeprefix.add('blackbox.log') -@command('^blackbox', +@command('blackbox', [('l', 'limit', 10, _('the number of events to show')), ], _('hg blackbox [OPTION]...'), - helpcategory=command.CATEGORY_MAINTENANCE) + helpcategory=command.CATEGORY_MAINTENANCE, + helpbasic=True) def blackbox(ui, repo, *revs, **opts): '''view the recent repository events '''
--- a/hgext/fastannotate/commands.py Fri Oct 12 18:06:32 2018 +0200 +++ b/hgext/fastannotate/commands.py Fri Oct 12 18:49:11 2018 +0200 @@ -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"""
--- a/hgext/githelp.py Fri Oct 12 18:06:32 2018 +0200 +++ b/hgext/githelp.py Fri Oct 12 18:49:11 2018 +0200 @@ -50,9 +50,9 @@ s = re.sub('~$', '~1', s) return s -@command('^githelp|git', [ +@command('githelp|git', [ ], _('hg githelp'), - helpcategory=command.CATEGORY_HELP) + helpcategory=command.CATEGORY_HELP, helpbasic=True) def githelp(ui, repo, *args, **kwargs): '''suggests the Mercurial equivalent of the given git command
--- a/hgext/mq.py Fri Oct 12 18:06:32 2018 +0200 +++ b/hgext/mq.py Fri Oct 12 18:49:11 2018 +0200 @@ -2433,10 +2433,11 @@ commands.add(ui, r) return 0 -@command("^qinit", +@command("qinit", [('c', 'create-repo', None, _('create queue repository'))], _('hg qinit [-c]'), - helpcategory=command.CATEGORY_REPO_CREATION) + helpcategory=command.CATEGORY_REPO_CREATION, + helpbasic=True) def init(ui, repo, **opts): """init a new queue repository (DEPRECATED) @@ -2540,7 +2541,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=command.CATEGORY_COMMITTING, inferrepo=True) @@ -2623,7 +2624,7 @@ if not opts.get('date') and opts.get('currentdate'): opts['date'] = "%d %d" % dateutil.makedate() -@command("^qnew", +@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')), @@ -2635,7 +2636,7 @@ _('add "Date: <DATE>" to patch'), _('DATE')) ] + cmdutil.walkopts + cmdutil.commitopts, _('hg qnew [-e] [-m TEXT] [-l FILE] PATCH [FILE]...'), - helpcategory=command.CATEGORY_COMMITTING, + helpcategory=command.CATEGORY_COMMITTING, helpbasic=True, inferrepo=True) def new(ui, repo, patch, *args, **opts): """create a new patch @@ -2671,7 +2672,7 @@ q.savedirty() return 0 -@command("^qrefresh", +@command("qrefresh", [('e', 'edit', None, _('invoke editor on commit messages')), ('g', 'git', None, _('use git extended diff format')), ('s', 'short', None, @@ -2686,7 +2687,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=command.CATEGORY_COMMITTING, + helpcategory=command.CATEGORY_COMMITTING, helpbasic=True, inferrepo=True) def refresh(ui, repo, *pats, **opts): """update the current patch @@ -2718,10 +2719,10 @@ q.savedirty() return ret -@command("^qdiff", +@command("qdiff", cmdutil.diffopts + cmdutil.diffopts2 + cmdutil.walkopts, _('hg qdiff [OPTION]... [FILE]...'), - helpcategory=command.CATEGORY_FILE_CONTENTS, + helpcategory=command.CATEGORY_FILE_CONTENTS, helpbasic=True, inferrepo=True) def diff(ui, repo, *pats, **opts): """diff of the current patch and subsequent modifications @@ -2956,7 +2957,7 @@ newpath = path + ".%d" % (index + 1) return newpath -@command("^qpush", +@command("qpush", [('', 'keep-changes', None, _('tolerate non-conflicting local changes')), ('f', 'force', None, _('apply on top of local changes')), @@ -2971,7 +2972,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=command.CATEGORY_CHANGE_ORGANIZATION) + helpcategory=command.CATEGORY_CHANGE_ORGANIZATION, + helpbasic=True) def push(ui, repo, patch=None, **opts): """push the next patch onto the stack @@ -3003,7 +3005,7 @@ keepchanges=opts.get('keep_changes')) return ret -@command("^qpop", +@command("qpop", [('a', 'all', None, _('pop all patches')), ('n', 'name', '', _('queue name to pop (DEPRECATED)'), _('NAME')), @@ -3012,7 +3014,8 @@ ('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=command.CATEGORY_CHANGE_ORGANIZATION) + helpcategory=command.CATEGORY_CHANGE_ORGANIZATION, + helpbasic=True) def pop(ui, repo, patch=None, **opts): """pop the current patch off the stack
--- a/hgext/record.py Fri Oct 12 18:06:32 2018 +0200 +++ b/hgext/record.py Fri Oct 12 18:49:11 2018 +0200 @@ -32,7 +32,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=command.CATEGORY_COMMITTING) @@ -138,7 +138,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"))
--- a/hgext/sparse.py Fri Oct 12 18:06:32 2018 +0200 +++ b/hgext/sparse.py Fri Oct 12 18:49:11 2018 +0200 @@ -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) -@command('^debugsparse', [ +@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
--- a/hgext/split.py Fri Oct 12 18:06:32 2018 +0200 +++ b/hgext/split.py Fri Oct 12 18:49:11 2018 +0200 @@ -44,12 +44,12 @@ # leave the attribute unspecified. testedwith = 'ships-with-hg-core' -@command('^split', +@command('split', [('r', 'rev', '', _("revision to split"), _('REV')), ('', 'rebase', True, _('rebase descendants after split')), ] + cmdutil.commitopts2, _('hg split [--no-rebase] [[-r] REV]'), - helpcategory=command.CATEGORY_CHANGE_MANAGEMENT) + helpcategory=command.CATEGORY_CHANGE_MANAGEMENT, helpbasic=True) def split(ui, repo, *revs, **opts): """split a changeset into smaller ones
--- a/hgext/uncommit.py Fri Oct 12 18:06:32 2018 +0200 +++ b/hgext/uncommit.py Fri Oct 12 18:49:11 2018 +0200 @@ -191,7 +191,8 @@ for data in ctx.repo().obsstore.predecessors.get(ctx.node(), ()): yield obsutil.marker(ctx.repo(), data) -@command('^unamend', [], helpcategory=command.CATEGORY_CHANGE_MANAGEMENT) +@command('unamend', [], helpcategory=command.CATEGORY_CHANGE_MANAGEMENT, + helpbasic=True) def unamend(ui, repo, **opts): """undo the most recent amend operation on a current changeset
--- a/mercurial/cmdutil.py Fri Oct 12 18:06:32 2018 +0200 +++ b/mercurial/cmdutil.py Fri Oct 12 18:49:11 2018 +0200 @@ -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()
--- a/mercurial/commands.py Fri Oct 12 18:06:32 2018 +0200 +++ b/mercurial/commands.py Fri Oct 12 18:49:11 2018 +0200 @@ -131,11 +131,11 @@ # Commands start here, listed alphabetically -@command('^add', +@command('add', walkopts + subrepoopts + dryrunopts, _('[OPTION]... [FILE]...'), helpcategory=command.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) -@command('^annotate|blame', +@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=command.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)) -@command('^clone', +@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=command.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 -@command('^commit|ci', +@command('commit|ci', [('A', 'addremove', None, _('mark new/missing files as added/removed before committing')), ('', 'close-branch', None, @@ -1566,7 +1566,7 @@ ('i', 'interactive', None, _('use interactive mode')), ] + walkopts + commitopts + commitopts2 + subrepoopts, _('[OPTION]... [FILE]...'), - helpcategory=command.CATEGORY_COMMITTING, + helpcategory=command.CATEGORY_COMMITTING, 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))) -@command('^diff', +@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=command.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')) -@command('^export', +@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=command.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=command.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 -@command('^init', remoteopts, _('[-e CMD] [--remotecmd CMD] [DEST]'), - helpcategory=command.CATEGORY_REPO_CREATION, - norepo=True) +@command('init', remoteopts, _('[-e CMD] [--remotecmd CMD] [DEST]'), + helpcategory=command.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 -@command('^log|history', +@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=command.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,7 +3877,7 @@ fm.write('path', '%s\n', f) fm.end() -@command('^merge', +@command('merge', [('f', 'force', None, _('force a merge including outstanding changes (DEPRECATED)')), ('r', 'rev', '', _('revision to merge'), _('REV')), @@ -3887,7 +3886,7 @@ ('', 'abort', None, _('abort the ongoing merge')), ] + mergetoolopts, _('[-P] [[-r] REV]'), - helpcategory=command.CATEGORY_CHANGE_MANAGEMENT) + helpcategory=command.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")) -@command('^pull', +@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=command.CATEGORY_REMOTE_REPO_MANAGEMENT) + helpcategory=command.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 -@command('^push', +@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=command.CATEGORY_REMOTE_REPO_MANAGEMENT) + helpcategory=command.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 -@command('^remove|rm', +@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=command.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") -@command('^serve', +@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=command.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' -@command('^status|st', +@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=command.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() -@command('^summary|sum', +@command('summary|sum', [('', 'remote', None, _('check for push and pull'))], '[--remote]', helpcategory=command.CATEGORY_WORKING_DIRECTORY, + helpbasic=True, intents={INTENT_READONLY}) def summary(ui, repo, **opts): """summarize working directory state @@ -5927,7 +5929,7 @@ return postincoming(ui, repo, modheads, opts.get(r'update'), None, None) -@command('^update|up|checkout|co', +@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')), @@ -5935,7 +5937,8 @@ ('r', 'rev', '', _('revision'), _('REV')) ] + mergetoolopts, _('[-C|-c|-m] [-d DATE] [[-r] REV]'), - helpcategory=command.CATEGORY_WORKING_DIRECTORY) + helpcategory=command.CATEGORY_WORKING_DIRECTORY, + helpbasic=True) def update(ui, repo, node=None, **opts): """update working directory (or switch revisions)
--- a/mercurial/help.py Fri Oct 12 18:06:32 2018 +0200 +++ b/mercurial/help.py Fri Oct 12 18:49:11 2018 +0200 @@ -516,16 +516,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
--- a/mercurial/hgweb/webcommands.py Fri Oct 12 18:06:32 2018 +0200 +++ b/mercurial/hgweb/webcommands.py Fri Oct 12 18:49:11 2018 +0200 @@ -1418,8 +1418,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))
--- a/mercurial/registrar.py Fri Oct 12 18:06:32 2018 +0200 +++ b/mercurial/registrar.py Fri Oct 12 18:49:11 2018 +0200 @@ -185,12 +185,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:
--- a/tests/test-completion.t Fri Oct 12 18:06:32 2018 +0200 +++ b/tests/test-completion.t Fri Oct 12 18:49:11 2018 +0200 @@ -231,23 +231,8 @@ 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 @@ -256,6 +241,8 @@ 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,7 +304,10 @@ 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 @@ -325,22 +315,32 @@ 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