Mercurial > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
15895:933b9ff73750 | 15896:30c34fde40cc |
---|---|
653 | 653 |
654 Commands or Python functions that get automatically executed by | 654 Commands or Python functions that get automatically executed by |
655 various actions such as starting or finishing a commit. Multiple | 655 various actions such as starting or finishing a commit. Multiple |
656 hooks can be run for the same action by appending a suffix to the | 656 hooks can be run for the same action by appending a suffix to the |
657 action. Overriding a site-wide hook can be done by changing its | 657 action. Overriding a site-wide hook can be done by changing its |
658 value or setting it to an empty string. | 658 value or setting it to an empty string. Hooks can be prioritized |
659 by adding a prefix of ``priority`` to the hook name on a new line | |
660 and setting the priority. The default priority is 0 if | |
661 not specified. | |
659 | 662 |
660 Example ``.hg/hgrc``:: | 663 Example ``.hg/hgrc``:: |
661 | 664 |
662 [hooks] | 665 [hooks] |
663 # update working directory after adding changesets | 666 # update working directory after adding changesets |
664 changegroup.update = hg update | 667 changegroup.update = hg update |
665 # do not use the site-wide hook | 668 # do not use the site-wide hook |
666 incoming = | 669 incoming = |
667 incoming.email = /my/email/hook | 670 incoming.email = /my/email/hook |
668 incoming.autobuild = /my/build/hook | 671 incoming.autobuild = /my/build/hook |
672 # force autobuild hook to run before other incoming hooks | |
673 priority.incoming.autobuild = 1 | |
669 | 674 |
670 Most hooks are run with environment variables set that give useful | 675 Most hooks are run with environment variables set that give useful |
671 additional information. For each hook below, the environment | 676 additional information. For each hook below, the environment |
672 variables it is passed are listed with names of the form ``$HG_foo``. | 677 variables it is passed are listed with names of the form ``$HG_foo``. |
673 | 678 |