##// 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 def _pythonhook(ui, repo, name, hname, f
64 ui.warn(_('exception from second failed import '
64 ui.warn(_('exception from second failed import '
65 'attempt:\n'))
65 'attempt:\n'))
66 ui.traceback(e2)
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 raise error.HookLoadError(
73 raise error.HookLoadError(
68 _('%s hook is invalid: import of "%s" failed') %
74 _('%s hook is invalid: import of "%s" failed') %
69 (hname, modname))
75 (hname, modname), hint=tracebackhint)
70 sys.path = oldpaths
76 sys.path = oldpaths
71 try:
77 try:
72 for p in funcname.split('.')[1:]:
78 for p in funcname.split('.')[1:]:
@@ -505,6 +505,7 test python hooks
505 pulling from ../a
505 pulling from ../a
506 searching for changes
506 searching for changes
507 abort: preoutgoing.badmodule hook is invalid: import of "nomodule" failed
507 abort: preoutgoing.badmodule hook is invalid: import of "nomodule" failed
508 (run with --traceback for stack trace)
508 [255]
509 [255]
509
510
510 $ echo '[hooks]' > ../a/.hg/hgrc
511 $ echo '[hooks]' > ../a/.hg/hgrc
@@ -513,6 +514,7 test python hooks
513 pulling from ../a
514 pulling from ../a
514 searching for changes
515 searching for changes
515 abort: preoutgoing.unreachable hook is invalid: import of "hooktests.container" failed
516 abort: preoutgoing.unreachable hook is invalid: import of "hooktests.container" failed
517 (run with --traceback for stack trace)
516 [255]
518 [255]
517
519
518 $ echo '[hooks]' > ../a/.hg/hgrc
520 $ echo '[hooks]' > ../a/.hg/hgrc
General Comments 0
You need to be logged in to leave comments. Login now