mercurial/dispatch.py
changeset 45887 7eb221b9af6c
parent 45885 600aec73f309
child 45909 ca39c45014fa
equal deleted inserted replaced
45886:18489e26d9a0 45887:7eb221b9af6c
   254             if req.ferr:
   254             if req.ferr:
   255                 req.ui.ferr = req.ferr
   255                 req.ui.ferr = req.ferr
   256             if req.fmsg:
   256             if req.fmsg:
   257                 req.ui.fmsg = req.fmsg
   257                 req.ui.fmsg = req.fmsg
   258         except error.Abort as inst:
   258         except error.Abort as inst:
   259             ferr.write(inst.format())
       
   260             return -1
       
   261         except error.ParseError as inst:
       
   262             ferr.write(inst.format())
   259             ferr.write(inst.format())
   263             return -1
   260             return -1
   264 
   261 
   265         msg = _formatargs(req.args)
   262         msg = _formatargs(req.args)
   266         starttime = util.timer()
   263         starttime = util.timer()
   464             ui.warn(_(b"hg %s: %s\n") % (inst.command, msgbytes))
   461             ui.warn(_(b"hg %s: %s\n") % (inst.command, msgbytes))
   465             commands.help_(ui, inst.command, full=False, command=True)
   462             commands.help_(ui, inst.command, full=False, command=True)
   466         else:
   463         else:
   467             ui.warn(_(b"hg: %s\n") % inst.message)
   464             ui.warn(_(b"hg: %s\n") % inst.message)
   468             ui.warn(_(b"(use 'hg help -v' for a list of global options)\n"))
   465             ui.warn(_(b"(use 'hg help -v' for a list of global options)\n"))
   469     except error.ParseError as inst:
       
   470         ui.warn(inst.format())
       
   471         return -1
       
   472     except error.UnknownCommand as inst:
   466     except error.UnknownCommand as inst:
   473         nocmdmsg = _(b"hg: unknown command '%s'\n") % inst.command
   467         nocmdmsg = _(b"hg: unknown command '%s'\n") % inst.command
   474         try:
   468         try:
   475             # check if the command is in a disabled extension
   469             # check if the command is in a disabled extension
   476             # (but don't check for extensions themselves)
   470             # (but don't check for extensions themselves)