##// END OF EJS Templates
hook: for python hook ImportErrors, add note to run with --traceback...
Siddharth Agarwal -
r28080:37b818ca default
parent child Browse files
Show More
@@ -64,9 +64,15 b' def _pythonhook(ui, repo, name, hname, f'
64 64 ui.warn(_('exception from second failed import '
65 65 'attempt:\n'))
66 66 ui.traceback(e2)
67
68 if not ui.tracebackflag:
69 tracebackhint = _(
70 'run with --traceback for stack trace')
71 else:
72 tracebackhint = None
67 73 raise error.HookLoadError(
68 74 _('%s hook is invalid: import of "%s" failed') %
69 (hname, modname))
75 (hname, modname), hint=tracebackhint)
70 76 sys.path = oldpaths
71 77 try:
72 78 for p in funcname.split('.')[1:]:
@@ -505,6 +505,7 b' test python hooks'
505 505 pulling from ../a
506 506 searching for changes
507 507 abort: preoutgoing.badmodule hook is invalid: import of "nomodule" failed
508 (run with --traceback for stack trace)
508 509 [255]
509 510
510 511 $ echo '[hooks]' > ../a/.hg/hgrc
@@ -513,6 +514,7 b' test python hooks'
513 514 pulling from ../a
514 515 searching for changes
515 516 abort: preoutgoing.unreachable hook is invalid: import of "hooktests.container" failed
517 (run with --traceback for stack trace)
516 518 [255]
517 519
518 520 $ echo '[hooks]' > ../a/.hg/hgrc
General Comments 0
You need to be logged in to leave comments. Login now