Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 30504:c3bdc27121d1
debugcommands: move 'debugcommands' in the new module
The commit message isn't an illusion. There is a "debugcommands"
module and command.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Wed, 17 Aug 2016 20:40:13 -0700 |
parents | 6bfb333a6f2f |
children | 158b41842fd2 |
comparison
equal
deleted
inserted
replaced
30503:6bfb333a6f2f | 30504:c3bdc27121d1 |
---|---|
1865 Returns 0 on success, 1 if errors are encountered. | 1865 Returns 0 on success, 1 if errors are encountered. |
1866 """ | 1866 """ |
1867 with repo.wlock(False): | 1867 with repo.wlock(False): |
1868 return cmdutil.copy(ui, repo, pats, opts) | 1868 return cmdutil.copy(ui, repo, pats, opts) |
1869 | 1869 |
1870 @command('debugcommands', [], _('[COMMAND]'), norepo=True) | |
1871 def debugcommands(ui, cmd='', *args): | |
1872 """list all available commands and options""" | |
1873 for cmd, vals in sorted(table.iteritems()): | |
1874 cmd = cmd.split('|')[0].strip('^') | |
1875 opts = ', '.join([i[1] for i in vals[1]]) | |
1876 ui.write('%s: %s\n' % (cmd, opts)) | |
1877 | |
1878 @command('debugcomplete', | 1870 @command('debugcomplete', |
1879 [('o', 'options', None, _('show the command options'))], | 1871 [('o', 'options', None, _('show the command options'))], |
1880 _('[-o] CMD'), | 1872 _('[-o] CMD'), |
1881 norepo=True) | 1873 norepo=True) |
1882 def debugcomplete(ui, cmd='', **opts): | 1874 def debugcomplete(ui, cmd='', **opts): |