comparison mercurial/dispatch.py @ 38768:afc4ad706f9c

dispatch: making all hg abortions be output with a specific label This allows abortions to be highlighted specially and separately from warnings - for instance, red is a reasonable color for when hg aborts, but is overly dramatic for most warnings produced elsewhere. Differential Revision: https://phab.mercurial-scm.org/D3967
author Rodrigo Damazio Bovendorp <rdamazio@google.com>
date Thu, 19 Jul 2018 23:22:05 -0700
parents b86664c81833
children 5199c5b6fd29
comparison
equal deleted inserted replaced
38767:eb2945f0a4a1 38768:afc4ad706f9c
210 starttime = util.timer() 210 starttime = util.timer()
211 ret = 1 # default of Python exit code on unhandled exception 211 ret = 1 # default of Python exit code on unhandled exception
212 try: 212 try:
213 ret = _runcatch(req) or 0 213 ret = _runcatch(req) or 0
214 except error.ProgrammingError as inst: 214 except error.ProgrammingError as inst:
215 req.ui.warn(_('** ProgrammingError: %s\n') % inst) 215 req.ui.error(_('** ProgrammingError: %s\n') % inst)
216 if inst.hint: 216 if inst.hint:
217 req.ui.warn(_('** (%s)\n') % inst.hint) 217 req.ui.error(_('** (%s)\n') % inst.hint)
218 raise 218 raise
219 except KeyboardInterrupt as inst: 219 except KeyboardInterrupt as inst:
220 try: 220 try:
221 if isinstance(inst, error.SignalInterrupt): 221 if isinstance(inst, error.SignalInterrupt):
222 msg = _("killed!\n") 222 msg = _("killed!\n")
223 else: 223 else:
224 msg = _("interrupted!\n") 224 msg = _("interrupted!\n")
225 req.ui.warn(msg) 225 req.ui.error(msg)
226 except error.SignalInterrupt: 226 except error.SignalInterrupt:
227 # maybe pager would quit without consuming all the output, and 227 # maybe pager would quit without consuming all the output, and
228 # SIGPIPE was raised. we cannot print anything in this case. 228 # SIGPIPE was raised. we cannot print anything in this case.
229 pass 229 pass
230 except IOError as inst: 230 except IOError as inst: