##// END OF EJS Templates
hook: use "htype" as variable name in _pythonhook...
Pierre-Yves David -
r31742:f243b7fb default
parent child Browse files
Show More
@@ -19,7 +19,7 b' from . import ('
19 19 util,
20 20 )
21 21
22 def _pythonhook(ui, repo, name, hname, funcname, args, throw):
22 def _pythonhook(ui, repo, htype, hname, funcname, args, throw):
23 23 '''call python hook. hook is callable object, looked up as
24 24 name in python module. if callable returns "true", hook
25 25 fails, else passes. if hook raises exception, treated as
@@ -90,7 +90,7 b' def _pythonhook(ui, repo, name, hname, f'
90 90 starttime = util.timer()
91 91
92 92 try:
93 r = obj(ui=ui, repo=repo, hooktype=name, **args)
93 r = obj(ui=ui, repo=repo, hooktype=htype, **args)
94 94 except Exception as exc:
95 95 if isinstance(exc, error.Abort):
96 96 ui.warn(_('error: %s hook failed: %s\n') %
@@ -107,7 +107,7 b' def _pythonhook(ui, repo, name, hname, f'
107 107 finally:
108 108 duration = util.timer() - starttime
109 109 ui.log('pythonhook', 'pythonhook-%s: %s finished in %0.2f seconds\n',
110 name, funcname, duration)
110 htype, funcname, duration)
111 111 if r:
112 112 if throw:
113 113 raise error.HookAbort(_('%s hook failed') % hname)
General Comments 0
You need to be logged in to leave comments. Login now