comparison mercurial/dispatch.py @ 12748:d10369fefd01

alias: fail gracefully when invalid global options are given (issue2442) This patch modifies the check for shell aliases to prevent crashing when an invalid global option is given. When an invalid global option is given the check will simply return and let the normal error handling for this case happen.
author Steve Losh <steve@stevelosh.com>
date Sun, 17 Oct 2010 13:24:37 -0400
parents 42ca7aef28d3
children 614f0d8724ab
comparison
equal deleted inserted replaced
12747:175fb1b193f4 12748:d10369fefd01
431 431
432 def _checkshellalias(ui, args): 432 def _checkshellalias(ui, args):
433 cwd = os.getcwd() 433 cwd = os.getcwd()
434 norepo = commands.norepo 434 norepo = commands.norepo
435 options = {} 435 options = {}
436 args = fancyopts.fancyopts(args, commands.globalopts, options) 436
437 try:
438 args = fancyopts.fancyopts(args, commands.globalopts, options)
439 except fancyopts.getopt.GetoptError:
440 return
437 441
438 if not args: 442 if not args:
439 return 443 return
440 444
441 _parseconfig(ui, options['config']) 445 _parseconfig(ui, options['config'])