What is a branch?

Chris Morgan mihalis68 at gmail.com
Mon Feb 11 08:38:15 CST 2008


On Feb 11, 2008 3:48 AM, Adrian Buehlmann <adrian at cadifra.com> wrote:
> On 11.02.2008 00:36, Yao Zhang wrote:
> > Adrian Buehlmann wrote:
[SNIP]
> >
> >> by introducing the term "diverging development line", which I
> >> found on TutorialMerge.
> >
> > There is a subtle difference between the concept "diverging
> > development line" and Mercurial "branch" name.
>
> Very good addendum. I've integrated it into the Branch page:
> http://www.selenic.com/mercurial/wiki/index.cgi/Branch?action=recall&rev=33

I'm still a complete Mercurial beginner and I have been trying to
follow this discussion and I feel that this last clarification needs
another diagram

Presumably it would look like :

P -> C1 -> C2

with branch properties of default, branch-1 and branch-2 for each
element respectively?

As a CVS user currently., this makes sense to me. From the CVS user's
point of view, C1 and C2 are branch points, but there are only single
checkins "on the branch" for C1 and for C2 (although C2 is a change
"on the branch" C1). A user can now checkin to multiple branches,
right? e.g.

P -> C1 -> C2
|
 -> C3

If I am understanding this correctly, it achieves the same purpose
that we use branches for in CVS, namely that the default branch of the
code is kept isolated from some special purpose version of the same
code e.g. a release branch, a new experimental port etc etc.

I think this supports a usage model for Mercurial where some
developers have not gotten their heads around the full
distributed/multi-repo style of working (I'm not sure I have yet for
example).

Although this is perhaps not a key design goal of Mercurial, I expect
it would be beneficial for the introductory phase in switching over
from something like CVS. For example in my case I've had the
developers familiar with there being a monthly release branch, created
when the tree is fairly stable, with more scrutiny on commits into
that branch and all release builds done from that branch.

So I'm glad to see this issue clarified by this discussion, very
helpful, thanks!

Chris


More information about the Mercurial mailing list