equal
deleted
inserted
replaced
11 import sys |
11 import sys |
12 |
12 |
13 from .i18n import _ |
13 from .i18n import _ |
14 from . import ( |
14 from . import ( |
15 demandimport, |
15 demandimport, |
|
16 encoding, |
16 error, |
17 error, |
17 extensions, |
18 extensions, |
18 pycompat, |
19 pycompat, |
19 util, |
20 util, |
20 ) |
21 ) |
95 if isinstance(exc, error.Abort): |
96 if isinstance(exc, error.Abort): |
96 ui.warn(_('error: %s hook failed: %s\n') % |
97 ui.warn(_('error: %s hook failed: %s\n') % |
97 (hname, exc.args[0])) |
98 (hname, exc.args[0])) |
98 else: |
99 else: |
99 ui.warn(_('error: %s hook raised an exception: ' |
100 ui.warn(_('error: %s hook raised an exception: ' |
100 '%s\n') % (hname, exc)) |
101 '%s\n') % (hname, encoding.strtolocal(str(exc)))) |
101 if throw: |
102 if throw: |
102 raise |
103 raise |
103 if not ui.tracebackflag: |
104 if not ui.tracebackflag: |
104 ui.warn(_('(run with --traceback for stack trace)\n')) |
105 ui.warn(_('(run with --traceback for stack trace)\n')) |
105 ui.traceback() |
106 ui.traceback() |