I'm confused about --close-branch

CG Linden cg at lindenlab.com
Wed Nov 11 11:33:41 CST 2009


This might be a question better asked in the mercurial list, but there will
be a mercurial-devel followup, so humor me :)

I think I am misunderstanding the purpose of closed branches.

I thought that the idea is to mark inactive or abandoned branches, so that
they no longer act as active heads and require merges.

So here is what I did:

hg clone base_repo my_repo1
hg clone base_repo my_repo2
cd my_repo1
echo somechange1 >>somefile
hg ci -m 'somechange1'
hg push

So far so good...

cd ../my_repo2
echo somechange2 >>somefile
hg ci -m 'somechange2'
hg ci -m 'close branch' --close-branch
hg push

I would expect the push to just work and create multiple heads, which should
be OK since all heads but one are closed.

But the push fails with the multiple heads warning... OK

I do push -f

I then to a pull (hg fetch at this point, btw, stacktraces - but that's a
separate issue)

Then, when I try hg up, I get:

abort: crosses branches (use 'hg merge' or 'hg update -C')

$ hg --debug heads
changeset:   26:37001e897cd3d08ff40a802eb79aa3b8f2c6421b
tag:         tip
parent:      23:245ce4df3af990df1a18612d423c9718dcd16a67
parent:      -1:0000000000000000000000000000000000000000
manifest:    26:c5c11bd7d8bddeea4f3e73f98c261cbe7ae315bd
user:        CG Linden <cg at lindenlab.com>
date:        Wed Nov 11 09:20:50 2009 -0800
files:       BuildParams
extra:       branch=default
description:
Make some change.


changeset:   25:182307433ac2154afe4e3d07bf5f76c024319b73
parent:      24:4ebde65c1bc279ff901dcdff24009ac141a8f1f8
parent:      -1:0000000000000000000000000000000000000000
manifest:    25:46f2a305cdd30e7e9bf25421dc8170f7a0235c09
user:        CG Linden <cg at lindenlab.com>
date:        Wed Nov 11 09:21:35 2009 -0800
extra:       branch=default
extra:       close=1
description:
Close branch

So, what is the point of closed branches?
--
cg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20091111/0a035275/attachment.htm>


More information about the Mercurial-devel mailing list