395 nokwcommands = ['add', 'addremove', 'bundle', 'clone', 'copy', 'export', |
395 nokwcommands = ['add', 'addremove', 'bundle', 'clone', 'copy', 'export', |
396 'grep', 'identify', 'incoming', 'init', 'outgoing', 'push', |
396 'grep', 'identify', 'incoming', 'init', 'outgoing', 'push', |
397 'remove', 'rename', 'rollback'] |
397 'remove', 'rename', 'rollback'] |
398 |
398 |
399 def _getcmd(): |
399 def _getcmd(): |
400 # cmdutil.parse(ui, sys.argv[1:])[0] doesn't work for "hg diff -r" |
400 # commands or cmdutil.parse(ui, sys.argv[1:])[0] |
|
401 # results in no output from "hg diff --rev" with older hg versions |
401 args = fancyopts.fancyopts(sys.argv[1:], commands.globalopts, {}) |
402 args = fancyopts.fancyopts(sys.argv[1:], commands.globalopts, {}) |
402 if args: |
403 if args: |
403 cmd = args[0] |
404 cmd = args[0] |
404 aliases, i = findcmd(ui, cmd) |
405 aliases, i = findcmd(ui, cmd) |
405 return aliases[0] |
406 return aliases[0] |