doc/hgrc.5.txt
changeset 1727 019e6a47a53e
parent 1726 56fb048b102c
child 1732 d3e6da334b85
equal deleted inserted replaced
1726:56fb048b102c 1727:019e6a47a53e
   143     # do not use the site-wide hook
   143     # do not use the site-wide hook
   144     incoming =
   144     incoming =
   145     incoming.email = /my/email/hook
   145     incoming.email = /my/email/hook
   146     incoming.autobuild = /my/build/hook
   146     incoming.autobuild = /my/build/hook
   147 
   147 
       
   148   Most hooks are run with environment variables set that give added
       
   149   useful information.  For each hook below, the environment variables
       
   150   it is passed are listed with names of the form "$HG_foo".
       
   151 
   148   changegroup;;
   152   changegroup;;
   149     Run after a changegroup has been added via push or pull. Passed
   153     Run after a changegroup has been added via push or pull. ID of the
   150     the ID of the first new changeset in $HG_NODE.
   154     first new changeset is in $HG_NODE.
   151   commit;;
   155   commit;;
   152     Run after a changeset has been created in the local repository.
   156     Run after a changeset has been created in the local repository.
   153     Passed the ID of the newly created changeset in environment
   157     ID of the newly created changeset is in $HG_NODE.  Parent
   154     variable $HG_NODE.  Parent changeset IDs in $HG_P1 and $HG_P2.
   158     changeset IDs are in $HG_PARENT1 and $HG_PARENT2.
   155   incoming;;
   159   incoming;;
   156     Run after a changeset has been pulled, pushed, or unbundled into
   160     Run after a changeset has been pulled, pushed, or unbundled into
   157     the local repository.  Passed the ID of the newly arrived
   161     the local repository.  The ID of the newly arrived changeset is in
   158     changeset in environment variable $HG_NODE.
   162     $HG_NODE.
   159   precommit;;
   163   precommit;;
   160     Run before starting a local commit.  Exit status 0 allows the
   164     Run before starting a local commit.  Exit status 0 allows the
   161     commit to proceed.  Non-zero status will cause the commit to fail.
   165     commit to proceed.  Non-zero status will cause the commit to fail.
   162     Parent changeset IDs in $HG_P1 and $HG_P2.
   166     Parent changeset IDs are in $HG_PARENT1 and $HG_PARENT2.
   163   pretag;;
   167   pretag;;
   164     Run before creating a tag.  Exit status 0 allows the tag to be
   168     Run before creating a tag.  Exit status 0 allows the tag to be
   165     created.  Non-zero status will cause the tag to fail.  ID of
   169     created.  Non-zero status will cause the tag to fail.  ID of
   166     changeset to tag in $HG_NODE.  Name of tag in $HG_TAG.  Tag is
   170     changeset to tag is in $HG_NODE.  Name of tag is in $HG_TAG.  Tag
   167     local if $HG_LOCAL=1, in repo if $HG_LOCAL=0.
   171     is local if $HG_LOCAL=1, in repo if $HG_LOCAL=0.
   168   pretxncommit;;
   172   pretxncommit;;
   169     Run after a changeset has been created but the transaction not yet
   173     Run after a changeset has been created but the transaction not yet
   170     committed.  Changeset is visible to hook program.  This lets you
   174     committed.  Changeset is visible to hook program.  This lets you
   171     validate commit message and changes.  Exit status 0 allows the
   175     validate commit message and changes.  Exit status 0 allows the
   172     commit to proceed.  Non-zero status will cause the transaction to
   176     commit to proceed.  Non-zero status will cause the transaction to
   173     be rolled back.  ID of changeset in $HG_NODE.  Parent changeset
   177     be rolled back.  ID of changeset is in $HG_NODE.  Parent changeset
   174     IDs in $HG_P1 and $HG_P2.
   178     IDs are in $HG_PARENT1 and $HG_PARENT2.
   175   tag;;
   179   tag;;
   176     Run after a tag is created.  ID of tagged changeset in $HG_NODE.
   180     Run after a tag is created.  ID of tagged changeset is in
   177     Name of tag in $HG_TAG.  Tag is local if $HG_LOCAL=1, in repo if
   181     $HG_NODE.  Name of tag is in $HG_TAG.  Tag is local if
   178     $HG_LOCAL=0.
   182     $HG_LOCAL=1, in repo if $HG_LOCAL=0.
   179 
   183 
   180   In earlier releases, the names of hook environment variables did not
   184   In earlier releases, the names of hook environment variables did not
   181   have a "HG_" prefix.  These unprefixed names are still provided in
   185   have a "HG_" prefix.  These unprefixed names are still provided in
   182   the environment for backwards compatibility, but their use is
   186   the environment for backwards compatibility, but their use is
   183   deprecated, and they will be removed in a future release.
   187   deprecated, and they will be removed in a future release.