Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.1, 2.1.1, and 2.1.2

run: do not raise command parsing errors as ParseError

Mercurial's dispatch routines have resolved this as well; it was impossible to
differentiate between a config parsing error and a command line parsing error.

Changeset 6b483bab060c

Parent 04dcd2094c6a

by Steve Borho

Changes to one file · Browse files at 6b483bab060c Showing diff from parent 04dcd2094c6a Diff from another changeset...

 
185
186
187
188
 
189
190
191
 
209
210
211
212
 
213
214
215
 
234
235
236
237
 
 
 
 
 
 
 
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
 
308
309
310
311
 
312
313
314
 
185
186
187
 
188
189
190
191
 
209
210
211
 
212
213
214
215
 
234
235
236
 
237
238
239
240
241
242
243
244
245
246
247
248
249
 
 
 
 
 
 
250
251
252
 
308
309
310
 
311
312
313
314
@@ -185,7 +185,7 @@
  try:   args = fancyopts.fancyopts(args, globalopts, options)   except fancyopts.getopt.GetoptError, inst: - raise error.ParseError(None, inst) + raise error.CommandError(None, inst)     if args:   alias, args = args[0], args[1:] @@ -209,7 +209,7 @@
  try:   args = fancyopts.fancyopts(args, c, cmdoptions)   except fancyopts.getopt.GetoptError, inst: - raise error.ParseError(cmd, inst) + raise error.CommandError(cmd, inst)     # separate global options back out   for o in globalopts: @@ -234,19 +234,19 @@
  return runcommand(ui, args)   finally:   ui.flush() - except error.ParseError, inst: + except error.AmbiguousCommand, inst: + ui.status(_("thg: command '%s' is ambiguous:\n %s\n") % + (inst.args[0], " ".join(inst.args[1]))) + except error.UnknownCommand, inst: + ui.status(_("thg: unknown command '%s'\n") % inst.args[0]) + help_(ui, 'shortlist') + except error.CommandError, inst:   if inst.args[0]:   ui.status(_("thg %s: %s\n") % (inst.args[0], inst.args[1]))   help_(ui, inst.args[0])   else:   ui.status(_("thg: %s\n") % inst.args[1])   help_(ui, 'shortlist') - except error.AmbiguousCommand, inst: - ui.status(_("thg: command '%s' is ambiguous:\n %s\n") % - (inst.args[0], " ".join(inst.args[1]))) - except error.UnknownCommand, inst: - ui.status(_("thg: unknown command '%s'\n") % inst.args[0]) - help_(ui, 'shortlist')   except error.RepoError, inst:   ui.status(_("abort: %s!\n") % inst)   @@ -308,7 +308,7 @@
  try:   return cmdfunc()   except error.SignatureError: - raise error.ParseError(cmd, _("invalid arguments")) + raise error.CommandError(cmd, _("invalid arguments"))     if options['profile']:   format = ui.config('profiling', 'format', default='text')