changeset 207:54ca4e00e569

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