hgbook

diff en/branch.tex @ 202:6f167e644762

Start writing about named branches.
author Bryan O'Sullivan <bos@serpentine.com>
date Fri Apr 20 14:02:10 2007 -0700 (2007-04-20)
parents 58e3a6c76725
children d7615e15510f
line diff
     1.1 --- a/en/branch.tex	Mon Apr 16 17:37:27 2007 -0700
     1.2 +++ b/en/branch.tex	Fri Apr 20 14:02:10 2007 -0700
     1.3 @@ -224,6 +224,41 @@
     1.4  to the main branch.
     1.5  \interaction{branch-repo.merge}
     1.6  
     1.7 +\section{Naming branches within one repository}
     1.8 +
     1.9 +In most instances, isolating branches in repositories is the right
    1.10 +approach.  Its simplicity makes it easy to understand; and so it's
    1.11 +hard to make mistakes.  There's a one-to-one relationship between
    1.12 +branches you're working in and directories on your system.  This lets
    1.13 +you use normal (non-Mercurial-aware) tools to work on files within a
    1.14 +branch/repository.
    1.15 +
    1.16 +If you're more in the ``power user'' category (\emph{and} your
    1.17 +collaborators are too), there is an alternative way of handling
    1.18 +branches that you can consider.  I've already mentioned the
    1.19 +human-level distinction between ``small picture'' and ``big picture''
    1.20 +branches.  While Mercurial works with multiple ``small picture''
    1.21 +branches in a repository all the time (for example after you pull
    1.22 +changes in, but before you merge them), it can \emph{also} work with
    1.23 +multiple ``big picture'' branches.
    1.24 +
    1.25 +The key to working this way is that Mercurial lets you assign a
    1.26 +persistent \emph{name} to a branch.  There always exists a branch
    1.27 +named \texttt{default}.  Even before you start naming branches
    1.28 +yourself, you can find traces of the \texttt{default} branch if you
    1.29 +look for them.
    1.30 +
    1.31 +As an example, when you run the \hgcmd{commit} command, and it pops up
    1.32 +your editor so that you can enter a commit message, look for a line
    1.33 +that contains the text ``\texttt{HG: branch default}'' at the bottom.
    1.34 +This is telling you that your commit will occur on the branch named
    1.35 +\texttt{default}.
    1.36 +
    1.37 +To start working with named branches, use the \hgcmd{branches}
    1.38 +command.  This command lists the named branches already present in
    1.39 +your repository.
    1.40 +\interaction{branch-named.branches}
    1.41 +
    1.42  %%% Local Variables: 
    1.43  %%% mode: latex
    1.44  %%% TeX-master: "00book"