Patchwork [5,of,7] hook: use 'htype' in 'hook'

login
register
mail settings
Submitter Pierre-Yves David
Date March 31, 2017, 10:17 a.m.
Message ID <f9989c947fb9ce29d78f.1490955440@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/19866/
State Superseded
Headers show

Comments

Pierre-Yves David - March 31, 2017, 10:17 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
# Date 1490951202 -7200
#      Fri Mar 31 11:06:42 2017 +0200
# Node ID f9989c947fb9ce29d78fd4e159534e7f6e4f1cfa
# Parent  d87f911de0d81391cd17e080a42050e91d45d2a7
# EXP-Topic hookname
# Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
#              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r f9989c947fb9
hook: use 'htype' in 'hook'

Same rational as for 'runhooks', we fix the naming in another function.

Patch

diff --git a/mercurial/hook.py b/mercurial/hook.py
--- a/mercurial/hook.py
+++ b/mercurial/hook.py
@@ -186,16 +186,16 @@  def redirect(state):
     global _redirect
     _redirect = state
 
-def hook(ui, repo, name, throw=False, **args):
+def hook(ui, repo, htype, throw=False, **args):
     if not ui.callhooks:
         return False
 
     hooks = []
     for hname, cmd in _allhooks(ui):
-        if hname.split('.')[0] == name and cmd:
+        if hname.split('.')[0] == htype and cmd:
             hooks.append((hname, cmd))
 
-    res = runhooks(ui, repo, name, hooks, throw=throw, **args)
+    res = runhooks(ui, repo, htype, hooks, throw=throw, **args)
     r = False
     for hname, cmd in hooks:
         r = res[hname][0] or r