Show More
@@ -73,7 +73,7 b' def _runcatch(ui, args):' | |||||
73 | except error.LockUnavailable, inst: |
|
73 | except error.LockUnavailable, inst: | |
74 | ui.warn(_("abort: could not lock %s: %s\n") % |
|
74 | ui.warn(_("abort: could not lock %s: %s\n") % | |
75 | (inst.desc or inst.filename, inst.strerror)) |
|
75 | (inst.desc or inst.filename, inst.strerror)) | |
76 |
except error. |
|
76 | except error.CommandError, inst: | |
77 | if inst.args[0]: |
|
77 | if inst.args[0]: | |
78 | ui.warn(_("hg %s: %s\n") % (inst.args[0], inst.args[1])) |
|
78 | ui.warn(_("hg %s: %s\n") % (inst.args[0], inst.args[1])) | |
79 | commands.help_(ui, inst.args[0]) |
|
79 | commands.help_(ui, inst.args[0]) | |
@@ -258,7 +258,7 b' def _parse(ui, args):' | |||||
258 | try: |
|
258 | try: | |
259 | args = fancyopts.fancyopts(args, commands.globalopts, options) |
|
259 | args = fancyopts.fancyopts(args, commands.globalopts, options) | |
260 | except fancyopts.getopt.GetoptError, inst: |
|
260 | except fancyopts.getopt.GetoptError, inst: | |
261 |
raise error. |
|
261 | raise error.CommandError(None, inst) | |
262 |
|
262 | |||
263 | if args: |
|
263 | if args: | |
264 | cmd, args = args[0], args[1:] |
|
264 | cmd, args = args[0], args[1:] | |
@@ -281,7 +281,7 b' def _parse(ui, args):' | |||||
281 | try: |
|
281 | try: | |
282 | args = fancyopts.fancyopts(args, c, cmdoptions, True) |
|
282 | args = fancyopts.fancyopts(args, c, cmdoptions, True) | |
283 | except fancyopts.getopt.GetoptError, inst: |
|
283 | except fancyopts.getopt.GetoptError, inst: | |
284 |
raise error. |
|
284 | raise error.CommandError(cmd, inst) | |
285 |
|
285 | |||
286 | # separate global options back out |
|
286 | # separate global options back out | |
287 | for o in commands.globalopts: |
|
287 | for o in commands.globalopts: | |
@@ -475,7 +475,7 b' def _runcommand(ui, options, cmd, cmdfun' | |||||
475 | try: |
|
475 | try: | |
476 | return cmdfunc() |
|
476 | return cmdfunc() | |
477 | except error.SignatureError: |
|
477 | except error.SignatureError: | |
478 |
raise error. |
|
478 | raise error.CommandError(cmd, _("invalid arguments")) | |
479 |
|
479 | |||
480 | if options['profile']: |
|
480 | if options['profile']: | |
481 | format = ui.config('profiling', 'format', default='text') |
|
481 | format = ui.config('profiling', 'format', default='text') |
@@ -27,7 +27,7 b' class LookupError(RevlogError, KeyError)' | |||||
27 | def __str__(self): |
|
27 | def __str__(self): | |
28 | return RevlogError.__str__(self) |
|
28 | return RevlogError.__str__(self) | |
29 |
|
29 | |||
30 |
class |
|
30 | class CommandError(Exception): | |
31 | """Exception raised on errors in parsing the command line.""" |
|
31 | """Exception raised on errors in parsing the command line.""" | |
32 |
|
32 | |||
33 | class ConfigError(Exception): |
|
33 | class ConfigError(Exception): |
General Comments 0
You need to be logged in to leave comments.
Login now