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

login
register
mail settings
Submitter Matt Harbison
Date July 9, 2018, 3:27 p.m.
Message ID <f32405ce6d8e71c277c1.1531150065@Envy>
Download mbox | patch
Permalink /patch/32712/
State Accepted
Headers show

Comments

Matt Harbison - July 9, 2018, 3:27 p.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@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.

Patch

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