hgbook

changeset 207:54ca4e00e569

Add an example hook to enforce branch naming.
author Bryan O'Sullivan <bos@serpentine.com>
date Wed Apr 25 11:02:35 2007 -0700 (2007-04-25)
parents 6519f3b983b4
children a239cd51dcd3
files en/branch.tex
line diff
     1.1 --- a/en/branch.tex	Mon Apr 23 15:28:13 2007 -0700
     1.2 +++ b/en/branch.tex	Wed Apr 25 11:02:35 2007 -0700
     1.3 @@ -379,11 +379,16 @@
     1.4  gives you a more context when you're trying to follow the history of a
     1.5  long-lived branchy project.
     1.6  
     1.7 -If you're working with multiple shared repositories, you can set up a
     1.8 -hook on each that will block incoming changes that have the ``wrong''
     1.9 -branch name.  This provides a simple, but effective, defence against
    1.10 -people accidentally pushing changes from a ``bleeding edge'' branch to
    1.11 -a ``stable'' branch.
    1.12 +If you're working with shared repositories, you can set up a
    1.13 +\hook{pretxnchangegroup} hook on each that will block incoming changes
    1.14 +that have the ``wrong'' branch name.  This provides a simple, but
    1.15 +effective, defence against people accidentally pushing changes from a
    1.16 +``bleeding edge'' branch to a ``stable'' branch.  Such a hook might
    1.17 +look like this inside the shared repo's \hgrc.
    1.18 +\begin{codesample2}
    1.19 +  [hooks]
    1.20 +  pretxnchangegroup.branch = hg heads --template '{branches} ' | grep mybranch
    1.21 +\end{codesample2}
    1.22  
    1.23  %%% Local Variables: 
    1.24  %%% mode: latex