mercurial/hook.py
changeset 40984 8c8fcb385c46
parent 39823 24e493ec2229
child 43076 2372284d9457
equal deleted inserted replaced
40983:7654291091cf 40984:8c8fcb385c46
   100         if isinstance(exc, error.Abort):
   100         if isinstance(exc, error.Abort):
   101             ui.warn(_('error: %s hook failed: %s\n') %
   101             ui.warn(_('error: %s hook failed: %s\n') %
   102                          (hname, exc.args[0]))
   102                          (hname, exc.args[0]))
   103         else:
   103         else:
   104             ui.warn(_('error: %s hook raised an exception: '
   104             ui.warn(_('error: %s hook raised an exception: '
   105                       '%s\n') % (hname, encoding.strtolocal(str(exc))))
   105                       '%s\n') % (hname, stringutil.forcebytestr(exc)))
   106         if throw:
   106         if throw:
   107             raise
   107             raise
   108         if not ui.tracebackflag:
   108         if not ui.tracebackflag:
   109             ui.warn(_('(run with --traceback for stack trace)\n'))
   109             ui.warn(_('(run with --traceback for stack trace)\n'))
   110         ui.traceback()
   110         ui.traceback()