doc/hgrc.5.txt
changeset 4630 e6d105a51ec7
parent 4527 b422b558015b
child 4635 63b9d2deed48
equal deleted inserted replaced
4629:a04b5f37eda7 4630:e6d105a51ec7
   310   update;;
   310   update;;
   311     Run after updating the working directory.  Changeset ID of first
   311     Run after updating the working directory.  Changeset ID of first
   312     new parent is in $HG_PARENT1.  If merge, ID of second new parent
   312     new parent is in $HG_PARENT1.  If merge, ID of second new parent
   313     is in $HG_PARENT2.  If update succeeded, $HG_ERROR=0.  If update
   313     is in $HG_PARENT2.  If update succeeded, $HG_ERROR=0.  If update
   314     failed (e.g. because conflicts not resolved), $HG_ERROR=1.
   314     failed (e.g. because conflicts not resolved), $HG_ERROR=1.
   315 
   315   pre-<command>;;
   316   Note: In earlier releases, the names of hook environment variables
   316     Run before executing the associated command. The contents of the
   317   did not have a "HG_" prefix.  The old unprefixed names are no longer
   317     command line are passed as $HG_ARGS. If the hook returns failure,
   318   provided in the environment.
   318     the command doesn't execute and Mercurial returns the failure code.
       
   319   post-<command>;;
       
   320     Run after successful invocations of the associated command. The
       
   321     contents of the command line are passed as $HG_ARGS and the result
       
   322     code in $HG_RESULT. Hook failure is ignored.
       
   323 
       
   324   Note: it is generally better to use standard hooks rather than the
       
   325   generic pre- and post- command hooks as they are guaranteed to be
       
   326   called in the appropriate contexts for influencing transactions.
       
   327   Also, hooks like "commit" will be called in all contexts that
       
   328   generate a commit (eg. tag) and not just the commit command.
   319 
   329 
   320   The syntax for Python hooks is as follows:
   330   The syntax for Python hooks is as follows:
   321 
   331 
   322     hookname = python:modulename.submodule.callable
   332     hookname = python:modulename.submodule.callable
   323 
   333