1793 """ |
1793 """ |
1794 opts = pycompat.byteskwargs(opts) |
1794 opts = pycompat.byteskwargs(opts) |
1795 with repo.wlock(False): |
1795 with repo.wlock(False): |
1796 return cmdutil.copy(ui, repo, pats, opts) |
1796 return cmdutil.copy(ui, repo, pats, opts) |
1797 |
1797 |
|
1798 @command('debugcommands', [], _('[COMMAND]'), norepo=True) |
|
1799 def debugcommands(ui, cmd='', *args): |
|
1800 """list all available commands and options""" |
|
1801 for cmd, vals in sorted(table.iteritems()): |
|
1802 cmd = cmd.split('|')[0].strip('^') |
|
1803 opts = ', '.join([i[1] for i in vals[1]]) |
|
1804 ui.write('%s: %s\n' % (cmd, opts)) |
|
1805 |
|
1806 @command('debugcomplete', |
|
1807 [('o', 'options', None, _('show the command options'))], |
|
1808 _('[-o] CMD'), |
|
1809 norepo=True) |
|
1810 def debugcomplete(ui, cmd='', **opts): |
|
1811 """returns the completion list associated with the given command""" |
|
1812 |
|
1813 if opts.get('options'): |
|
1814 options = [] |
|
1815 otables = [globalopts] |
|
1816 if cmd: |
|
1817 aliases, entry = cmdutil.findcmd(cmd, table, False) |
|
1818 otables.append(entry[1]) |
|
1819 for t in otables: |
|
1820 for o in t: |
|
1821 if "(DEPRECATED)" in o[3]: |
|
1822 continue |
|
1823 if o[0]: |
|
1824 options.append('-%s' % o[0]) |
|
1825 options.append('--%s' % o[1]) |
|
1826 ui.write("%s\n" % "\n".join(options)) |
|
1827 return |
|
1828 |
|
1829 cmdlist, unused_allcmds = cmdutil.findpossible(cmd, table) |
|
1830 if ui.verbose: |
|
1831 cmdlist = [' '.join(c[0]) for c in cmdlist.values()] |
|
1832 ui.write("%s\n" % "\n".join(sorted(cmdlist))) |
|
1833 |
1798 @command('^diff', |
1834 @command('^diff', |
1799 [('r', 'rev', [], _('revision'), _('REV')), |
1835 [('r', 'rev', [], _('revision'), _('REV')), |
1800 ('c', 'change', '', _('change made by revision'), _('REV')) |
1836 ('c', 'change', '', _('change made by revision'), _('REV')) |
1801 ] + diffopts + diffopts2 + walkopts + subrepoopts, |
1837 ] + diffopts + diffopts2 + walkopts + subrepoopts, |
1802 _('[OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...'), |
1838 _('[OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...'), |