Mercurial > hg
diff mercurial/help/config.txt @ 31746:0fa30fbccc34
hook: provide hook type information to external hook
The python hooks have access to the hook type information. There is not reason
for external hook to not be aware of it too.
For the record my use case is to make sure a hook script is configured for the
right type.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Fri, 31 Mar 2017 11:08:11 +0200 |
parents | 2c02bb7fd7fc |
children | aff7b32b3c05 |
line wrap: on
line diff
--- a/mercurial/help/config.txt Fri Mar 31 11:06:42 2017 +0200 +++ b/mercurial/help/config.txt Fri Mar 31 11:08:11 2017 +0200 @@ -842,8 +842,11 @@ priority.incoming.autobuild = 1 Most hooks are run with environment variables set that give useful -additional information. For each hook below, the environment -variables it is passed are listed with names of the form ``$HG_foo``. +additional information. For each hook below, the environment variables +it is passed are listed with names of the form ``$HG_foo``. The +``$HG_HOOKTYPE`` variable is set for all hooks. It contains the type of +hook which triggered the run. In the example about this will be +``$HG_HOOKTYPE=incoming``. ``changegroup`` Run after a changegroup has been added via push, pull or unbundle. ID of the