[PATCH 2 of 4] hook: narrow the 'priority' prefix check to align with the documentation

Matt Harbison mharbison72 at gmail.com
Mon Jul 9 11:27:45 EDT 2018


# HG changeset patch
# User Matt Harbison <matt_harbison at yahoo.com>
# Date 1531021669 14400
#      Sat Jul 07 23:47:49 2018 -0400
# Node ID f32405ce6d8e71c277c15e3a7598e1b406e6f452
# Parent  b028d7427a3d87bed191b1b56c51f87c56b51d0e
hook: narrow the 'priority' prefix check to align with the documentation

A prefix like 'priorityfoo' is meaningless, but `hg help config.hooks` calls out
the dot.

diff --git a/mercurial/hook.py b/mercurial/hook.py
--- a/mercurial/hook.py
+++ b/mercurial/hook.py
@@ -181,7 +181,7 @@ def _hookitems(ui, _untrusted=False):
     """return all hooks items ready to be sorted"""
     hooks = {}
     for name, cmd in ui.configitems('hooks', untrusted=_untrusted):
-        if not name.startswith('priority'):
+        if not name.startswith('priority.'):
             priority = ui.configint('hooks', 'priority.%s' % name, 0)
             hooks[name] = (-priority, len(hooks), name, cmd)
     return hooks


More information about the Mercurial-devel mailing list