##// END OF EJS Templates
help: adding a proper declaration for shortlist/basic commands (API)...
Rodrigo Damazio -
r40331:fa88170c default
parent child Browse files
Show More
@@ -152,7 +152,7 b' cmdtable = {}'
152 152 # define parsealiases locally, because cmdutil.parsealiases has been
153 153 # available since 1.5 (or 6252852b4332)
154 154 def parsealiases(cmd):
155 return cmd.lstrip(b"^").split(b"|")
155 return cmd.split(b"|")
156 156
157 157 if safehasattr(registrar, 'command'):
158 158 command = registrar.command(cmdtable)
@@ -982,7 +982,7 b' def absorb(ui, repo, stack=None, targetc'
982 982 ui.write(_('nothing applied\n'))
983 983 return state
984 984
985 @command('^absorb',
985 @command('absorb',
986 986 [('a', 'apply-changes', None,
987 987 _('apply changes without prompting for confirmation')),
988 988 ('p', 'print-changes', None,
@@ -994,7 +994,8 b' def absorb(ui, repo, stack=None, targetc'
994 994 '(EXPERIMENTAL)')),
995 995 ] + commands.dryrunopts + commands.templateopts + commands.walkopts,
996 996 _('hg absorb [OPTION] [FILE]...'),
997 helpcategory=command.CATEGORY_COMMITTING)
997 helpcategory=command.CATEGORY_COMMITTING,
998 helpbasic=True)
998 999 def absorbcmd(ui, repo, *pats, **opts):
999 1000 """incorporate corrections into the stack of draft changesets
1000 1001
@@ -226,11 +226,12 b' def reposetup(ui, repo):'
226 226
227 227 repo._wlockfreeprefix.add('blackbox.log')
228 228
229 @command('^blackbox',
229 @command('blackbox',
230 230 [('l', 'limit', 10, _('the number of events to show')),
231 231 ],
232 232 _('hg blackbox [OPTION]...'),
233 helpcategory=command.CATEGORY_MAINTENANCE)
233 helpcategory=command.CATEGORY_MAINTENANCE,
234 helpbasic=True)
234 235 def blackbox(ui, repo, *revs, **opts):
235 236 '''view the recent repository events
236 237 '''
@@ -222,8 +222,8 b' def _annotatewrapper(orig, ui, repo, *pa'
222 222
223 223 def registercommand():
224 224 """register the fastannotate command"""
225 name = '^fastannotate|fastblame|fa'
226 command(name, **fastannotatecommandargs)(fastannotate)
225 name = 'fastannotate|fastblame|fa'
226 command(name, helpbasic=True, **fastannotatecommandargs)(fastannotate)
227 227
228 228 def wrapdefault():
229 229 """wrap the default annotate command, to be aware of the protocol"""
@@ -50,9 +50,9 b' def convert(s):'
50 50 s = re.sub('~$', '~1', s)
51 51 return s
52 52
53 @command('^githelp|git', [
53 @command('githelp|git', [
54 54 ], _('hg githelp'),
55 helpcategory=command.CATEGORY_HELP)
55 helpcategory=command.CATEGORY_HELP, helpbasic=True)
56 56 def githelp(ui, repo, *args, **kwargs):
57 57 '''suggests the Mercurial equivalent of the given git command
58 58
@@ -2433,10 +2433,11 b' def qinit(ui, repo, create):'
2433 2433 commands.add(ui, r)
2434 2434 return 0
2435 2435
2436 @command("^qinit",
2436 @command("qinit",
2437 2437 [('c', 'create-repo', None, _('create queue repository'))],
2438 2438 _('hg qinit [-c]'),
2439 helpcategory=command.CATEGORY_REPO_CREATION)
2439 helpcategory=command.CATEGORY_REPO_CREATION,
2440 helpbasic=True)
2440 2441 def init(ui, repo, **opts):
2441 2442 """init a new queue repository (DEPRECATED)
2442 2443
@@ -2540,7 +2541,7 b' def clone(ui, source, dest=None, **opts)'
2540 2541 hg.update(repo, repo.changelog.tip())
2541 2542
2542 2543 @command("qcommit|qci",
2543 commands.table["^commit|ci"][1],
2544 commands.table["commit|ci"][1],
2544 2545 _('hg qcommit [OPTION]... [FILE]...'),
2545 2546 helpcategory=command.CATEGORY_COMMITTING,
2546 2547 inferrepo=True)
@@ -2623,7 +2624,7 b' def setupheaderopts(ui, opts):'
2623 2624 if not opts.get('date') and opts.get('currentdate'):
2624 2625 opts['date'] = "%d %d" % dateutil.makedate()
2625 2626
2626 @command("^qnew",
2627 @command("qnew",
2627 2628 [('e', 'edit', None, _('invoke editor on commit messages')),
2628 2629 ('f', 'force', None, _('import uncommitted changes (DEPRECATED)')),
2629 2630 ('g', 'git', None, _('use git extended diff format')),
@@ -2635,7 +2636,7 b' def setupheaderopts(ui, opts):'
2635 2636 _('add "Date: <DATE>" to patch'), _('DATE'))
2636 2637 ] + cmdutil.walkopts + cmdutil.commitopts,
2637 2638 _('hg qnew [-e] [-m TEXT] [-l FILE] PATCH [FILE]...'),
2638 helpcategory=command.CATEGORY_COMMITTING,
2639 helpcategory=command.CATEGORY_COMMITTING, helpbasic=True,
2639 2640 inferrepo=True)
2640 2641 def new(ui, repo, patch, *args, **opts):
2641 2642 """create a new patch
@@ -2671,7 +2672,7 b' def new(ui, repo, patch, *args, **opts):'
2671 2672 q.savedirty()
2672 2673 return 0
2673 2674
2674 @command("^qrefresh",
2675 @command("qrefresh",
2675 2676 [('e', 'edit', None, _('invoke editor on commit messages')),
2676 2677 ('g', 'git', None, _('use git extended diff format')),
2677 2678 ('s', 'short', None,
@@ -2686,7 +2687,7 b' def new(ui, repo, patch, *args, **opts):'
2686 2687 _('add/update date field in patch with given date'), _('DATE'))
2687 2688 ] + cmdutil.walkopts + cmdutil.commitopts,
2688 2689 _('hg qrefresh [-I] [-X] [-e] [-m TEXT] [-l FILE] [-s] [FILE]...'),
2689 helpcategory=command.CATEGORY_COMMITTING,
2690 helpcategory=command.CATEGORY_COMMITTING, helpbasic=True,
2690 2691 inferrepo=True)
2691 2692 def refresh(ui, repo, *pats, **opts):
2692 2693 """update the current patch
@@ -2718,10 +2719,10 b' def refresh(ui, repo, *pats, **opts):'
2718 2719 q.savedirty()
2719 2720 return ret
2720 2721
2721 @command("^qdiff",
2722 @command("qdiff",
2722 2723 cmdutil.diffopts + cmdutil.diffopts2 + cmdutil.walkopts,
2723 2724 _('hg qdiff [OPTION]... [FILE]...'),
2724 helpcategory=command.CATEGORY_FILE_CONTENTS,
2725 helpcategory=command.CATEGORY_FILE_CONTENTS, helpbasic=True,
2725 2726 inferrepo=True)
2726 2727 def diff(ui, repo, *pats, **opts):
2727 2728 """diff of the current patch and subsequent modifications
@@ -2956,7 +2957,7 b' def savename(path):'
2956 2957 newpath = path + ".%d" % (index + 1)
2957 2958 return newpath
2958 2959
2959 @command("^qpush",
2960 @command("qpush",
2960 2961 [('', 'keep-changes', None,
2961 2962 _('tolerate non-conflicting local changes')),
2962 2963 ('f', 'force', None, _('apply on top of local changes')),
@@ -2971,7 +2972,8 b' def savename(path):'
2971 2972 _('reorder patch series and apply only the patch')),
2972 2973 ('', 'no-backup', None, _('do not save backup copies of files'))],
2973 2974 _('hg qpush [-f] [-l] [-a] [--move] [PATCH | INDEX]'),
2974 helpcategory=command.CATEGORY_CHANGE_ORGANIZATION)
2975 helpcategory=command.CATEGORY_CHANGE_ORGANIZATION,
2976 helpbasic=True)
2975 2977 def push(ui, repo, patch=None, **opts):
2976 2978 """push the next patch onto the stack
2977 2979
@@ -3003,7 +3005,7 b' def push(ui, repo, patch=None, **opts):'
3003 3005 keepchanges=opts.get('keep_changes'))
3004 3006 return ret
3005 3007
3006 @command("^qpop",
3008 @command("qpop",
3007 3009 [('a', 'all', None, _('pop all patches')),
3008 3010 ('n', 'name', '',
3009 3011 _('queue name to pop (DEPRECATED)'), _('NAME')),
@@ -3012,7 +3014,8 b' def push(ui, repo, patch=None, **opts):'
3012 3014 ('f', 'force', None, _('forget any local changes to patched files')),
3013 3015 ('', 'no-backup', None, _('do not save backup copies of files'))],
3014 3016 _('hg qpop [-a] [-f] [PATCH | INDEX]'),
3015 helpcategory=command.CATEGORY_CHANGE_ORGANIZATION)
3017 helpcategory=command.CATEGORY_CHANGE_ORGANIZATION,
3018 helpbasic=True)
3016 3019 def pop(ui, repo, patch=None, **opts):
3017 3020 """pop the current patch off the stack
3018 3021
@@ -32,7 +32,7 b" testedwith = 'ships-with-hg-core'"
32 32
33 33 @command("record",
34 34 # same options as commit + white space diff options
35 [c for c in commands.table['^commit|ci'][1][:]
35 [c for c in commands.table['commit|ci'][1][:]
36 36 if c[1] != "interactive"] + cmdutil.diffwsopts,
37 37 _('hg record [OPTION]... [FILE]...'),
38 38 helpcategory=command.CATEGORY_COMMITTING)
@@ -138,7 +138,7 b' def uisetup(ui):'
138 138 (qrecord,
139 139 # same options as qnew, but copy them so we don't get
140 140 # -i/--interactive for qrecord and add white space diff options
141 mq.cmdtable['^qnew'][1][:] + cmdutil.diffwsopts,
141 mq.cmdtable['qnew'][1][:] + cmdutil.diffwsopts,
142 142 _('hg qrecord [OPTION]... PATCH [FILE]...'))
143 143
144 144 _wrapcmd('qnew', mq.cmdtable, qnew, _("interactively record a new patch"))
@@ -122,7 +122,7 b' def replacefilecache(cls, propname, repl'
122 122 propname))
123 123
124 124 def _setuplog(ui):
125 entry = commands.table['^log|history']
125 entry = commands.table['log|history']
126 126 entry[1].append(('', 'sparse', None,
127 127 "limit to changesets affecting the sparse checkout"))
128 128
@@ -163,7 +163,7 b' def _clonesparsecmd(orig, ui, repo, *arg'
163 163 return orig(ui, repo, *args, **opts)
164 164
165 165 def _setupclone(ui):
166 entry = commands.table['^clone']
166 entry = commands.table['clone']
167 167 entry[1].append(('', 'enable-profile', [],
168 168 'enable a sparse profile'))
169 169 entry[1].append(('', 'include', [],
@@ -173,7 +173,7 b' def _setupclone(ui):'
173 173 extensions.wrapcommand(commands.table, 'clone', _clonesparsecmd)
174 174
175 175 def _setupadd(ui):
176 entry = commands.table['^add']
176 entry = commands.table['add']
177 177 entry[1].append(('s', 'sparse', None,
178 178 'also include directories of added files in sparse config'))
179 179
@@ -237,7 +237,7 b' def _setupdirstate(ui):'
237 237 return orig(self, *args)
238 238 extensions.wrapfunction(dirstate.dirstate, func, _wrapper)
239 239
240 @command('^debugsparse', [
240 @command('debugsparse', [
241 241 ('I', 'include', False, _('include files in the sparse checkout')),
242 242 ('X', 'exclude', False, _('exclude files in the sparse checkout')),
243 243 ('d', 'delete', False, _('delete an include/exclude rule')),
@@ -249,7 +249,8 b' def _setupdirstate(ui):'
249 249 ('', 'refresh', False, _('updates the working after sparseness changes')),
250 250 ('', 'reset', False, _('makes the repo full again')),
251 251 ] + commands.templateopts,
252 _('[--OPTION] PATTERN...'))
252 _('[--OPTION] PATTERN...'),
253 helpbasic=True)
253 254 def debugsparse(ui, repo, *pats, **opts):
254 255 """make the current checkout sparse, or edit the existing checkout
255 256
@@ -44,12 +44,12 b' command = registrar.command(cmdtable)'
44 44 # leave the attribute unspecified.
45 45 testedwith = 'ships-with-hg-core'
46 46
47 @command('^split',
47 @command('split',
48 48 [('r', 'rev', '', _("revision to split"), _('REV')),
49 49 ('', 'rebase', True, _('rebase descendants after split')),
50 50 ] + cmdutil.commitopts2,
51 51 _('hg split [--no-rebase] [[-r] REV]'),
52 helpcategory=command.CATEGORY_CHANGE_MANAGEMENT)
52 helpcategory=command.CATEGORY_CHANGE_MANAGEMENT, helpbasic=True)
53 53 def split(ui, repo, *revs, **opts):
54 54 """split a changeset into smaller ones
55 55
@@ -191,7 +191,8 b' def predecessormarkers(ctx):'
191 191 for data in ctx.repo().obsstore.predecessors.get(ctx.node(), ()):
192 192 yield obsutil.marker(ctx.repo(), data)
193 193
194 @command('^unamend', [], helpcategory=command.CATEGORY_CHANGE_MANAGEMENT)
194 @command('unamend', [], helpcategory=command.CATEGORY_CHANGE_MANAGEMENT,
195 helpbasic=True)
195 196 def unamend(ui, repo, **opts):
196 197 """undo the most recent amend operation on a current changeset
197 198
@@ -185,7 +185,7 b' def newandmodified(chunks, originalchunk'
185 185 return newlyaddedandmodifiedfiles
186 186
187 187 def parsealiases(cmd):
188 return cmd.lstrip("^").split("|")
188 return cmd.split("|")
189 189
190 190 def setupwrapcolorwrite(ui):
191 191 # wrap ui.write so diff output can be labeled/colorized
@@ -673,7 +673,7 b' def findpossible(cmd, table, strict=Fals'
673 673 debugchoice = {}
674 674
675 675 if cmd in table:
676 # short-circuit exact matches, "log" alias beats "^log|history"
676 # short-circuit exact matches, "log" alias beats "log|history"
677 677 keys = [cmd]
678 678 else:
679 679 keys = table.keys()
@@ -131,11 +131,11 b' debugrevlogopts = cmdutil.debugrevlogopt'
131 131
132 132 # Commands start here, listed alphabetically
133 133
134 @command('^add',
134 @command('add',
135 135 walkopts + subrepoopts + dryrunopts,
136 136 _('[OPTION]... [FILE]...'),
137 137 helpcategory=command.CATEGORY_WORKING_DIRECTORY,
138 inferrepo=True)
138 helpbasic=True, inferrepo=True)
139 139 def add(ui, repo, *pats, **opts):
140 140 """add the specified files on the next commit
141 141
@@ -256,7 +256,7 b' def addremove(ui, repo, *pats, **opts):'
256 256 matcher = scmutil.match(repo[None], pats, opts)
257 257 return scmutil.addremove(repo, matcher, "", opts)
258 258
259 @command('^annotate|blame',
259 @command('annotate|blame',
260 260 [('r', 'rev', '', _('annotate the specified revision'), _('REV')),
261 261 ('', 'follow', None,
262 262 _('follow copies/renames and list the filename (DEPRECATED)')),
@@ -272,7 +272,7 b' def addremove(ui, repo, *pats, **opts):'
272 272 ] + diffwsopts + walkopts + formatteropts,
273 273 _('[-r REV] [-f] [-a] [-u] [-d] [-n] [-c] [-l] FILE...'),
274 274 helpcategory=command.CATEGORY_FILE_CONTENTS,
275 inferrepo=True)
275 helpbasic=True, inferrepo=True)
276 276 def annotate(ui, repo, *pats, **opts):
277 277 """show changeset information by line for each file
278 278
@@ -1399,7 +1399,7 b' def cat(ui, repo, file1, *pats, **opts):'
1399 1399 return cmdutil.cat(ui, repo, ctx, m, fm, fntemplate, '',
1400 1400 **pycompat.strkwargs(opts))
1401 1401
1402 @command('^clone',
1402 @command('clone',
1403 1403 [('U', 'noupdate', None, _('the clone will include an empty working '
1404 1404 'directory (only a repository)')),
1405 1405 ('u', 'updaterev', '', _('revision, tag, or branch to check out'),
@@ -1416,7 +1416,7 b' def cat(ui, repo, file1, *pats, **opts):'
1416 1416 ] + remoteopts,
1417 1417 _('[OPTION]... SOURCE [DEST]'),
1418 1418 helpcategory=command.CATEGORY_REPO_CREATION,
1419 norepo=True)
1419 helpbasic=True, norepo=True)
1420 1420 def clone(ui, source, dest=None, **opts):
1421 1421 """make a copy of an existing repository
1422 1422
@@ -1555,7 +1555,7 b' def clone(ui, source, dest=None, **opts)'
1555 1555
1556 1556 return r is None
1557 1557
1558 @command('^commit|ci',
1558 @command('commit|ci',
1559 1559 [('A', 'addremove', None,
1560 1560 _('mark new/missing files as added/removed before committing')),
1561 1561 ('', 'close-branch', None,
@@ -1566,7 +1566,7 b' def clone(ui, source, dest=None, **opts)'
1566 1566 ('i', 'interactive', None, _('use interactive mode')),
1567 1567 ] + walkopts + commitopts + commitopts2 + subrepoopts,
1568 1568 _('[OPTION]... [FILE]...'),
1569 helpcategory=command.CATEGORY_COMMITTING,
1569 helpcategory=command.CATEGORY_COMMITTING, helpbasic=True,
1570 1570 inferrepo=True)
1571 1571 def commit(ui, repo, *pats, **opts):
1572 1572 """commit the specified files or all outstanding changes
@@ -1867,7 +1867,7 b' def copy(ui, repo, *pats, **opts):'
1867 1867 def debugcommands(ui, cmd='', *args):
1868 1868 """list all available commands and options"""
1869 1869 for cmd, vals in sorted(table.iteritems()):
1870 cmd = cmd.split('|')[0].strip('^')
1870 cmd = cmd.split('|')[0]
1871 1871 opts = ', '.join([i[1] for i in vals[1]])
1872 1872 ui.write('%s: %s\n' % (cmd, opts))
1873 1873
@@ -1900,14 +1900,13 b" def debugcomplete(ui, cmd='', **opts):"
1900 1900 cmdlist = [' '.join(c[0]) for c in cmdlist.values()]
1901 1901 ui.write("%s\n" % "\n".join(sorted(cmdlist)))
1902 1902
1903 @command('^diff',
1903 @command('diff',
1904 1904 [('r', 'rev', [], _('revision'), _('REV')),
1905 1905 ('c', 'change', '', _('change made by revision'), _('REV'))
1906 1906 ] + diffopts + diffopts2 + walkopts + subrepoopts,
1907 1907 _('[OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...'),
1908 1908 helpcategory=command.CATEGORY_FILE_CONTENTS,
1909 inferrepo=True,
1910 intents={INTENT_READONLY})
1909 helpbasic=True, inferrepo=True, intents={INTENT_READONLY})
1911 1910 def diff(ui, repo, *pats, **opts):
1912 1911 """diff repository (or selected files)
1913 1912
@@ -1995,7 +1994,7 b' def diff(ui, repo, *pats, **opts):'
1995 1994 listsubrepos=opts.get('subrepos'),
1996 1995 root=opts.get('root'))
1997 1996
1998 @command('^export',
1997 @command('export',
1999 1998 [('B', 'bookmark', '',
2000 1999 _('export changes only reachable by given bookmark')),
2001 2000 ('o', 'output', '',
@@ -2005,7 +2004,7 b' def diff(ui, repo, *pats, **opts):'
2005 2004 ] + diffopts + formatteropts,
2006 2005 _('[OPTION]... [-o OUTFILESPEC] [-r] [REV]...'),
2007 2006 helpcategory=command.CATEGORY_IMPORT_EXPORT,
2008 intents={INTENT_READONLY})
2007 helpbasic=True, intents={INTENT_READONLY})
2009 2008 def export(ui, repo, *changesets, **opts):
2010 2009 """dump the header and diffs for one or more changesets
2011 2010
@@ -2198,12 +2197,12 b' def files(ui, repo, *pats, **opts):'
2198 2197 return cmdutil.files(ui, ctx, m, fm, fmt, opts.get('subrepos'))
2199 2198
2200 2199 @command(
2201 '^forget',
2200 'forget',
2202 2201 [('i', 'interactive', None, _('use interactive mode')),
2203 2202 ] + walkopts + dryrunopts,
2204 2203 _('[OPTION]... FILE...'),
2205 2204 helpcategory=command.CATEGORY_WORKING_DIRECTORY,
2206 inferrepo=True)
2205 helpbasic=True, inferrepo=True)
2207 2206 def forget(ui, repo, *pats, **opts):
2208 2207 """forget the specified files on the next commit
2209 2208
@@ -3549,9 +3548,9 b' def incoming(ui, repo, source="default",'
3549 3548 del repo._subtoppath
3550 3549
3551 3550
3552 @command('^init', remoteopts, _('[-e CMD] [--remotecmd CMD] [DEST]'),
3551 @command('init', remoteopts, _('[-e CMD] [--remotecmd CMD] [DEST]'),
3553 3552 helpcategory=command.CATEGORY_REPO_CREATION,
3554 norepo=True)
3553 helpbasic=True, norepo=True)
3555 3554 def init(ui, dest=".", **opts):
3556 3555 """create a new repository in the given directory
3557 3556
@@ -3624,7 +3623,7 b' def locate(ui, repo, *pats, **opts):'
3624 3623
3625 3624 return ret
3626 3625
3627 @command('^log|history',
3626 @command('log|history',
3628 3627 [('f', 'follow', None,
3629 3628 _('follow changeset history, or file history across copies and renames')),
3630 3629 ('', 'follow-first', None,
@@ -3650,7 +3649,7 b' def locate(ui, repo, *pats, **opts):'
3650 3649 ] + logopts + walkopts,
3651 3650 _('[OPTION]... [FILE]'),
3652 3651 helpcategory=command.CATEGORY_CHANGE_NAVIGATION,
3653 inferrepo=True,
3652 helpbasic=True, inferrepo=True,
3654 3653 intents={INTENT_READONLY})
3655 3654 def log(ui, repo, *pats, **opts):
3656 3655 """show revision history of entire repository or files
@@ -3878,7 +3877,7 b' def manifest(ui, repo, node=None, rev=No'
3878 3877 fm.write('path', '%s\n', f)
3879 3878 fm.end()
3880 3879
3881 @command('^merge',
3880 @command('merge',
3882 3881 [('f', 'force', None,
3883 3882 _('force a merge including outstanding changes (DEPRECATED)')),
3884 3883 ('r', 'rev', '', _('revision to merge'), _('REV')),
@@ -3887,7 +3886,7 b' def manifest(ui, repo, node=None, rev=No'
3887 3886 ('', 'abort', None, _('abort the ongoing merge')),
3888 3887 ] + mergetoolopts,
3889 3888 _('[-P] [[-r] REV]'),
3890 helpcategory=command.CATEGORY_CHANGE_MANAGEMENT)
3889 helpcategory=command.CATEGORY_CHANGE_MANAGEMENT, helpbasic=True)
3891 3890 def merge(ui, repo, node=None, **opts):
3892 3891 """merge another revision into working directory
3893 3892
@@ -4305,7 +4304,7 b' def postincoming(ui, repo, modheads, opt'
4305 4304 elif not ui.configbool('commands', 'update.requiredest'):
4306 4305 ui.status(_("(run 'hg update' to get a working copy)\n"))
4307 4306
4308 @command('^pull',
4307 @command('pull',
4309 4308 [('u', 'update', None,
4310 4309 _('update to new branch head if new descendants were pulled')),
4311 4310 ('f', 'force', None, _('run even when remote repository is unrelated')),
@@ -4315,7 +4314,8 b' def postincoming(ui, repo, modheads, opt'
4315 4314 _('BRANCH')),
4316 4315 ] + remoteopts,
4317 4316 _('[-u] [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [SOURCE]'),
4318 helpcategory=command.CATEGORY_REMOTE_REPO_MANAGEMENT)
4317 helpcategory=command.CATEGORY_REMOTE_REPO_MANAGEMENT,
4318 helpbasic=True)
4319 4319 def pull(ui, repo, source="default", **opts):
4320 4320 """pull changes from the specified source
4321 4321
@@ -4435,7 +4435,7 b' def pull(ui, repo, source="default", **o'
4435 4435 other.close()
4436 4436 return ret
4437 4437
4438 @command('^push',
4438 @command('push',
4439 4439 [('f', 'force', None, _('force push')),
4440 4440 ('r', 'rev', [],
4441 4441 _('a changeset intended to be included in the destination'),
@@ -4447,7 +4447,8 b' def pull(ui, repo, source="default", **o'
4447 4447 ('', 'pushvars', [], _('variables that can be sent to server (ADVANCED)')),
4448 4448 ] + remoteopts,
4449 4449 _('[-f] [-r REV]... [-e CMD] [--remotecmd CMD] [DEST]'),
4450 helpcategory=command.CATEGORY_REMOTE_REPO_MANAGEMENT)
4450 helpcategory=command.CATEGORY_REMOTE_REPO_MANAGEMENT,
4451 helpbasic=True)
4451 4452 def push(ui, repo, dest=None, **opts):
4452 4453 """push changes to the specified destination
4453 4454
@@ -4589,14 +4590,14 b' def recover(ui, repo):'
4589 4590 return hg.verify(repo)
4590 4591 return 1
4591 4592
4592 @command('^remove|rm',
4593 @command('remove|rm',
4593 4594 [('A', 'after', None, _('record delete for missing files')),
4594 4595 ('f', 'force', None,
4595 4596 _('forget added files, delete modified files')),
4596 4597 ] + subrepoopts + walkopts + dryrunopts,
4597 4598 _('[OPTION]... FILE...'),
4598 4599 helpcategory=command.CATEGORY_WORKING_DIRECTORY,
4599 inferrepo=True)
4600 helpbasic=True, inferrepo=True)
4600 4601 def remove(ui, repo, *pats, **opts):
4601 4602 """remove the specified files on the next commit
4602 4603
@@ -5132,7 +5133,7 b' def root(ui, repo):'
5132 5133 """
5133 5134 ui.write(repo.root + "\n")
5134 5135
5135 @command('^serve',
5136 @command('serve',
5136 5137 [('A', 'accesslog', '', _('name of access log file to write to'),
5137 5138 _('FILE')),
5138 5139 ('d', 'daemon', None, _('run server in background')),
@@ -5161,7 +5162,7 b' def root(ui, repo):'
5161 5162 + subrepoopts,
5162 5163 _('[OPTION]...'),
5163 5164 helpcategory=command.CATEGORY_REMOTE_REPO_MANAGEMENT,
5164 optionalrepo=True)
5165 helpbasic=True, optionalrepo=True)
5165 5166 def serve(ui, repo, **opts):
5166 5167 """start stand-alone webserver
5167 5168
@@ -5205,7 +5206,7 b' def serve(ui, repo, **opts):'
5205 5206
5206 5207 _NOTTERSE = 'nothing'
5207 5208
5208 @command('^status|st',
5209 @command('status|st',
5209 5210 [('A', 'all', None, _('show status of all files')),
5210 5211 ('m', 'modified', None, _('show only modified files')),
5211 5212 ('a', 'added', None, _('show only added files')),
@@ -5223,7 +5224,7 b' def serve(ui, repo, **opts):'
5223 5224 ] + walkopts + subrepoopts + formatteropts,
5224 5225 _('[OPTION]... [FILE]...'),
5225 5226 helpcategory=command.CATEGORY_WORKING_DIRECTORY,
5226 inferrepo=True,
5227 helpbasic=True, inferrepo=True,
5227 5228 intents={INTENT_READONLY})
5228 5229 def status(ui, repo, *pats, **opts):
5229 5230 """show changed files in the working directory
@@ -5409,10 +5410,11 b' def status(ui, repo, *pats, **opts):'
5409 5410 cmdutil.morestatus(repo, fm)
5410 5411 fm.end()
5411 5412
5412 @command('^summary|sum',
5413 @command('summary|sum',
5413 5414 [('', 'remote', None, _('check for push and pull'))],
5414 5415 '[--remote]',
5415 5416 helpcategory=command.CATEGORY_WORKING_DIRECTORY,
5417 helpbasic=True,
5416 5418 intents={INTENT_READONLY})
5417 5419 def summary(ui, repo, **opts):
5418 5420 """summarize working directory state
@@ -5927,7 +5929,7 b' def unbundle(ui, repo, fname1, *fnames, '
5927 5929
5928 5930 return postincoming(ui, repo, modheads, opts.get(r'update'), None, None)
5929 5931
5930 @command('^update|up|checkout|co',
5932 @command('update|up|checkout|co',
5931 5933 [('C', 'clean', None, _('discard uncommitted changes (no backup)')),
5932 5934 ('c', 'check', None, _('require clean working directory')),
5933 5935 ('m', 'merge', None, _('merge uncommitted changes')),
@@ -5935,7 +5937,8 b' def unbundle(ui, repo, fname1, *fnames, '
5935 5937 ('r', 'rev', '', _('revision'), _('REV'))
5936 5938 ] + mergetoolopts,
5937 5939 _('[-C|-c|-m] [-d DATE] [[-r] REV]'),
5938 helpcategory=command.CATEGORY_WORKING_DIRECTORY)
5940 helpcategory=command.CATEGORY_WORKING_DIRECTORY,
5941 helpbasic=True)
5939 5942 def update(ui, repo, node=None, **opts):
5940 5943 """update working directory (or switch revisions)
5941 5944
@@ -516,15 +516,13 b' def help_(ui, commands, name, unknowncmd'
516 516 f = fs[0]
517 517 syns[f] = ', '.join(fs)
518 518 func = e[0]
519 p = ''
520 if c.startswith("^"):
521 p = '^'
522 if select and not select(p + f):
519 if select and not select(f):
523 520 continue
524 521 if (not select and name != 'shortlist' and
525 522 func.__module__ != commands.__name__):
526 523 continue
527 if name == "shortlist" and not p:
524 if name == "shortlist":
525 if not getattr(func, 'helpbasic', False):
528 526 continue
529 527 doc = pycompat.getdoc(func)
530 528 if filtercmd(ui, f, name, doc):
@@ -1418,8 +1418,8 b' def help(web):'
1418 1418 if 'DEPRECATED' in doc or c.startswith('debug'):
1419 1419 continue
1420 1420 cmd = primary(c)
1421 if cmd.startswith('^'):
1422 early.append((cmd[1:], doc))
1421 if getattr(e[0], 'helpbasic', False):
1422 early.append((cmd, doc))
1423 1423 else:
1424 1424 other.append((cmd, doc))
1425 1425
@@ -185,12 +185,13 b' class command(_funcregistrarbase):'
185 185
186 186 def _doregister(self, func, name, options=(), synopsis=None,
187 187 norepo=False, optionalrepo=False, inferrepo=False,
188 intents=None, helpcategory=None):
188 intents=None, helpcategory=None, helpbasic=False):
189 189 func.norepo = norepo
190 190 func.optionalrepo = optionalrepo
191 191 func.inferrepo = inferrepo
192 192 func.intents = intents or set()
193 193 func.helpcategory = helpcategory
194 func.helpbasic = helpbasic
194 195 if synopsis:
195 196 self._table[name] = func, list(options), synopsis
196 197 else:
@@ -231,23 +231,8 b' Show an error if we use --options with a'
231 231 Show all commands + options
232 232 $ hg debugcommands
233 233 add: include, exclude, subrepos, dry-run
234 addremove: similarity, subrepos, include, exclude, dry-run
234 235 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
235 clone: noupdate, updaterev, rev, branch, pull, uncompressed, stream, ssh, remotecmd, insecure
236 commit: addremove, close-branch, amend, secret, edit, interactive, include, exclude, message, logfile, date, user, subrepos
237 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
238 export: bookmark, output, switch-parent, rev, text, git, binary, nodates, template
239 forget: interactive, include, exclude, dry-run
240 init: ssh, remotecmd, insecure
241 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
242 merge: force, rev, preview, abort, tool
243 pull: update, force, rev, bookmark, branch, ssh, remotecmd, insecure
244 push: force, rev, bookmark, branch, new-branch, pushvars, ssh, remotecmd, insecure
245 remove: after, force, subrepos, include, exclude, dry-run
246 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
247 status: all, modified, added, removed, deleted, clean, unknown, ignored, no-status, terse, copies, print0, rev, change, include, exclude, subrepos, template
248 summary: remote
249 update: clean, check, merge, date, rev, tool
250 addremove: similarity, subrepos, include, exclude, dry-run
251 236 archive: no-decode, prefix, rev, type, subrepos, include, exclude
252 237 backout: merge, commit, no-commit, parent, rev, edit, tool, include, exclude, message, logfile, date, user
253 238 bisect: reset, good, bad, skip, extend, command, noupdate
@@ -256,6 +241,8 b' Show all commands + options'
256 241 branches: active, closed, template
257 242 bundle: force, rev, branch, base, all, type, ssh, remotecmd, insecure
258 243 cat: output, rev, decode, include, exclude, template
244 clone: noupdate, updaterev, rev, branch, pull, uncompressed, stream, ssh, remotecmd, insecure
245 commit: addremove, close-branch, amend, secret, edit, interactive, include, exclude, message, logfile, date, user, subrepos
259 246 config: untrusted, edit, local, global, template
260 247 copy: after, force, include, exclude, dry-run
261 248 debugancestor:
@@ -317,7 +304,10 b' Show all commands + options'
317 304 debugwhyunstable:
318 305 debugwireargs: three, four, five, ssh, remotecmd, insecure
319 306 debugwireproto: localssh, peer, noreadstderr, nologhandshake, ssh, remotecmd, insecure
307 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
308 export: bookmark, output, switch-parent, rev, text, git, binary, nodates, template
320 309 files: rev, print0, include, exclude, template, subrepos
310 forget: interactive, include, exclude, dry-run
321 311 graft: rev, continue, stop, abort, edit, log, no-commit, force, currentdate, currentuser, date, user, tool, dry-run
322 312 grep: print0, all, diff, text, follow, ignore-case, files-with-matches, line-number, rev, all-files, user, date, template, include, exclude
323 313 heads: rev, topo, active, closed, style, template
@@ -325,22 +315,32 b' Show all commands + options'
325 315 identify: rev, num, id, branch, tags, bookmarks, ssh, remotecmd, insecure, template
326 316 import: strip, base, edit, force, no-commit, bypass, partial, exact, prefix, import-branch, message, logfile, date, user, similarity
327 317 incoming: force, newest-first, bundle, rev, bookmarks, branch, patch, git, limit, no-merges, stat, graph, style, template, ssh, remotecmd, insecure, subrepos
318 init: ssh, remotecmd, insecure
328 319 locate: rev, print0, fullpath, include, exclude
320 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
329 321 manifest: rev, all, template
322 merge: force, rev, preview, abort, tool
330 323 outgoing: force, rev, newest-first, bookmarks, branch, patch, git, limit, no-merges, stat, graph, style, template, ssh, remotecmd, insecure, subrepos
331 324 parents: rev, style, template
332 325 paths: template
333 326 phase: public, draft, secret, force, rev
327 pull: update, force, rev, bookmark, branch, ssh, remotecmd, insecure
328 push: force, rev, bookmark, branch, new-branch, pushvars, ssh, remotecmd, insecure
334 329 recover:
330 remove: after, force, subrepos, include, exclude, dry-run
335 331 rename: after, force, include, exclude, dry-run
336 332 resolve: all, list, mark, unmark, no-status, re-merge, tool, include, exclude, template
337 333 revert: all, date, rev, no-backup, interactive, include, exclude, dry-run
338 334 rollback: dry-run, force
339 335 root:
336 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
337 status: all, modified, added, removed, deleted, clean, unknown, ignored, no-status, terse, copies, print0, rev, change, include, exclude, subrepos, template
338 summary: remote
340 339 tag: force, local, rev, remove, edit, message, date, user
341 340 tags: template
342 341 tip: patch, git, style, template
343 342 unbundle: update
343 update: clean, check, merge, date, rev, tool
344 344 verify:
345 345 version: template
346 346
General Comments 0
You need to be logged in to leave comments. Login now