# HG changeset patch # User Pierre-Yves David # Date 1490951003 -7200 # Node ID 5678496659e9885b726a83f3bcf05de09d653779 # Parent f610c3220eecf9ee52ae03123adee06c323f9bad hook: use 'htype' in 'runhooks' Same rational as for '_pythonhook', 'htype' is more accurate and less error prone. We just fixed an error from the 'name'/'hname' confusion and this should prevent them in the future. diff -r f610c3220eec -r 5678496659e9 mercurial/hook.py --- a/mercurial/hook.py Fri Mar 31 11:02:05 2017 +0200 +++ b/mercurial/hook.py Fri Mar 31 11:03:23 2017 +0200 @@ -201,7 +201,7 @@ r = res[hname][0] or r return r -def runhooks(ui, repo, name, hooks, throw=False, **args): +def runhooks(ui, repo, htype, hooks, throw=False, **args): res = {} oldstdout = -1 @@ -229,7 +229,8 @@ r = 1 raised = False elif callable(cmd): - r, raised = _pythonhook(ui, repo, name, hname, cmd, args, throw) + r, raised = _pythonhook(ui, repo, htype, hname, cmd, args, + throw) elif cmd.startswith('python:'): if cmd.count(':') >= 2: path, cmd = cmd[7:].rsplit(':', 1) @@ -244,7 +245,7 @@ hookfn = getattr(mod, cmd) else: hookfn = cmd[7:].strip() - r, raised = _pythonhook(ui, repo, name, hname, hookfn, args, + r, raised = _pythonhook(ui, repo, htype, hname, hookfn, args, throw) else: r = _exthook(ui, repo, hname, cmd, args, throw)