Mercurial > hgbook
comparison en/branch.tex @ 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 | b42689a730a2 |
comparison
equal
deleted
inserted
replaced
206:6519f3b983b4 | 207:54ca4e00e569 |
---|---|
377 In the simplest case, giving a name to each branch gives you a | 377 In the simplest case, giving a name to each branch gives you a |
378 permanent record of which branch a changeset originated on. This | 378 permanent record of which branch a changeset originated on. This |
379 gives you a more context when you're trying to follow the history of a | 379 gives you a more context when you're trying to follow the history of a |
380 long-lived branchy project. | 380 long-lived branchy project. |
381 | 381 |
382 If you're working with multiple shared repositories, you can set up a | 382 If you're working with shared repositories, you can set up a |
383 hook on each that will block incoming changes that have the ``wrong'' | 383 \hook{pretxnchangegroup} hook on each that will block incoming changes |
384 branch name. This provides a simple, but effective, defence against | 384 that have the ``wrong'' branch name. This provides a simple, but |
385 people accidentally pushing changes from a ``bleeding edge'' branch to | 385 effective, defence against people accidentally pushing changes from a |
386 a ``stable'' branch. | 386 ``bleeding edge'' branch to a ``stable'' branch. Such a hook might |
387 look like this inside the shared repo's \hgrc. | |
388 \begin{codesample2} | |
389 [hooks] | |
390 pretxnchangegroup.branch = hg heads --template '{branches} ' | grep mybranch | |
391 \end{codesample2} | |
387 | 392 |
388 %%% Local Variables: | 393 %%% Local Variables: |
389 %%% mode: latex | 394 %%% mode: latex |
390 %%% TeX-master: "00book" | 395 %%% TeX-master: "00book" |
391 %%% End: | 396 %%% End: |