diff mercurial/help/config.txt @ 15896:30c34fde40cc

hooks: prioritize run order of hooks As of Mercurial 1.3, hooks are sorted in the order they are read into Mercurial. There are many instances when someone may want the hooks sorted in a specific order; this patch allows prioritizing hooks, while maintaining the existing enumeration for hooks without a priority.
author Matt Zuba <matt.zuba@goodwillaz.org>
date Sun, 15 Jan 2012 13:50:12 -0700
parents 6f2eee68f6a5
children 76625324bd55
line wrap: on
line diff
--- a/mercurial/help/config.txt	Sun Jan 15 18:00:01 2012 -0600
+++ b/mercurial/help/config.txt	Sun Jan 15 13:50:12 2012 -0700
@@ -655,7 +655,10 @@
 various actions such as starting or finishing a commit. Multiple
 hooks can be run for the same action by appending a suffix to the
 action. Overriding a site-wide hook can be done by changing its
-value or setting it to an empty string.
+value or setting it to an empty string.  Hooks can be prioritized
+by adding a prefix of ``priority`` to the hook name on a new line
+and setting the priority.  The default priority is 0 if
+not specified.
 
 Example ``.hg/hgrc``::
 
@@ -666,6 +669,8 @@
   incoming =
   incoming.email = /my/email/hook
   incoming.autobuild = /my/build/hook
+  # force autobuild hook to run before other incoming hooks
+  priority.incoming.autobuild = 1
 
 Most hooks are run with environment variables set that give useful
 additional information. For each hook below, the environment