Use of named branches

Sebastien Lucas sebastien.lucas at gmail.com
Sat May 5 02:06:56 CDT 2007


Hi,

First some background, I have happily used Subversion for 2 years at
work and I think I learned how to use it right. I'm currently
reviewing mercurial for my personal needs. I'm using 0.9.3 on debian.

Coming from subversion, I'm used to have a trunk (where the main
developpement take place) and my branches in the same repository. I
know that's the prefered way is to use hg clone to create a branch but
I'd prefer to use named branches to keep everything (trunk and dev
branches) in the same repository.

I made some experiment last night :

hg init test1
cd test1
hg branch trunk -> my first commit will be in a branch named trunk (SVN habit)
touch a.txt
hg add a.txt
hg ci

I now have a revision 0 on branch trunk with a.txt

hg branch seb-dev
touch b.txt
hg add b.txt
hg ci

I have revision 1 on branch seb-dev with a.txt and b.txt

hg up -C trunk
touch c.txt
hg add c.txt
hg ci

Revision 2 on branch trunk with a.txt and c.txt

hg merge seb-dev
hg ci

Revision 3 on branch trunk with a, b, c

So everything's allright with this sample.

Now I'll take a easier one (at least I thought it was) :

hg init test2
cd test2
hg branch trunk
touch a.txt
hg add a.txt
hg ci

I now have a revision 0 on branch trunk with a.txt

hg branch seb-dev
touch b.txt
hg add b.txt
hg ci

I have revision 1 on branch seb-dev with a.txt and b.txt. till now
everything's ok

hg up -C trunk
hg merge seb-dev

I have the message :
abort: there is nothing to merge, just use 'hg update' or look at 'hg heads'

if I run hg heads, I only got one head.

I really feel I have missed something (or everything). Can anybody
enlight me on a proper use of named branches ?

Thanks in advance.

Sebastien


More information about the Mercurial mailing list