Thoughts about branching

Gregory Collins greg at maptuit.com
Fri Mar 16 10:13:43 CDT 2007


Hi,

Shouldn't "hg branch" cause a branch to be made in the repository? I think  
the behaviour people expect from experience using other revision control  
systems is that you will have another head in the repository.

If you are at a head in branch "foo" at revision r1, I would expect that  
"hg branch bar" be semantically identical to the following:

$ hg branch
foo
$ hg branch bar
# create empty changeset r2
$ hg commit -m "Creating branch bar from branch foo revision r1"
$ hg update -C foo
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg branch
foo
# create empty changeset r3 (currently complains that
# nothing changed, but you get the idea)
$ hg commit -m "Created branch bar from branch foo revision r1"

Now you have two heads, one at changeset r2 in branch "bar" and one at  
changeset r3 in branch "foo".

Should "hg branch" take an option to behave this way?

-- Gregory Collins <greg at maptuit.com>


More information about the Mercurial-devel mailing list