What is a branch?

Yao Zhang yaoz39 at gmail.com
Sun Feb 10 17:36:21 CST 2008


Adrian Buehlmann wrote:

> I've expanded

> http://www.selenic.com/mercurial/wiki/index.cgi/Branch

> 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.

Mercurial branch name is an attribute associated with a changeset.
A new branch name can be started in the middle of a development
line, not necessarily at a diverging point.  For example,

hg branch branch-1          # start a new branch name
                            # modify something in the repository
hg commit -m "branch-1"     # the changeset has branch name "branch-1"

hg branch branch-2          # start another branch name
                            # modify something in the repository
hg commit -m "branch-2"     # the changeset has branch name "branch-2"

Although there is no "diverging development line" above, Mercurial
branch name can be changed.

Another case is that if a "diverging development line" occurs
later, both diverged lines will inherit the parent's branch name
if no new branch name is started.

Regards,

-- 
張堯

consultant, n.:
	Someone who knowns 101 ways to make love, but can't get a date.


More information about the Mercurial mailing list