mercurial/hook.py
changeset 28936 44bd37af54e5
parent 28109 b892e424f88c
child 28937 3112c5e18835
--- a/mercurial/hook.py	Fri Apr 15 17:43:47 2016 +0000
+++ b/mercurial/hook.py	Thu Apr 14 02:28:46 2016 -0700
@@ -162,12 +162,12 @@
     return r
 
 def _allhooks(ui):
-    hooks = []
+    hooks = {}
     for name, cmd in ui.configitems('hooks'):
         if not name.startswith('priority'):
             priority = ui.configint('hooks', 'priority.%s' % name, 0)
-            hooks.append((-priority, len(hooks), name, cmd))
-    return [(k, v) for p, o, k, v in sorted(hooks)]
+            hooks[name] = (-priority, len(hooks), name, cmd)
+    return [(k, v) for p, o, k, v in sorted(hooks.values())]
 
 _redirect = False
 def redirect(state):