Named previously unnamed branch

Posted by Jab on Stack Overflow See other posts from Stack Overflow or by Jab
Published on 2010-06-03T21:03:12Z Indexed on 2010/06/03 21:04 UTC
Read the original article Hit count: 268

Filed under:
|

It seems naming a previously unnamed branch doesn't really work out. It creates a nasty multiple heads problem that I can't find a solution for.

Here is the workflow...

UserA starts working on feature that they expect to be small, so they just start working(off the default branch). The change turns out to be a large project and will need multiple contributors. So UserA issues... hg branch "Feature1" and continues working, committing locally s needed.

UserA then pulls down the changes from the central repo so he can push.

At this point, why does hg heads return 3 heads? It shows 2 for default and 1 for Feature1. The first head for default is the latest change by another user on the branch(irrelevant). The second default head is the commit prior to the hg branch "Feature1" commit.

The central repository has rules enforced so that only 1 head per branch is allowed, so forcing a push isn't an option. The repo doesn't want multiple heads on the default branch.

UserA should be able to push these changes so that other users can see the Feature1 branch and help out. I can't seem to find a way to "correct" this. I don't think I can re-write the branch of the initial commits for the feature, before it was a named branch.

I know the initial changes before the named branch are technically on the default branch, but does that mean they will be heads until that Feature1 branch is merged?

© Stack Overflow or respective owner

Related posts about mercurial

Related posts about hg