comparison mercurial/hook.py @ 28108:2a71d9483199

hook: for python hook exceptions, add note to run with --traceback Just like with ImportErrors, it isn't obvious that --traceback will produce helpful debugging output here.
author Siddharth Agarwal <sid0@fb.com>
date Fri, 12 Feb 2016 11:44:35 -0800
parents cedbe8723d99
children b892e424f88c
comparison
equal deleted inserted replaced
28107:88e309a0c133 28108:2a71d9483199
104 else: 104 else:
105 ui.warn(_('error: %s hook raised an exception: ' 105 ui.warn(_('error: %s hook raised an exception: '
106 '%s\n') % (hname, exc)) 106 '%s\n') % (hname, exc))
107 if throw: 107 if throw:
108 raise 108 raise
109 if not ui.tracebackflag:
110 ui.warn(_('(run with --traceback for stack trace)\n'))
109 ui.traceback() 111 ui.traceback()
110 return True, True 112 return True, True
111 finally: 113 finally:
112 sys.stdout, sys.stderr, sys.stdin = old 114 sys.stdout, sys.stderr, sys.stdin = old
113 duration = time.time() - starttime 115 duration = time.time() - starttime