I've read this question: How to move some changeset to a new branch in mercurial
But my problem is slightly different. What I have is this:
NULL -> 1 -> 2 -> 3 -> 4 -> etc #default
\
10 #default (new head without parent)
\
11 -> 12 -> 13 -> 14 #new-empty-branch
Ofcourse I should have commited rev 10 in de new-empty-branch from the start, but I didn't and so now I would like to move revision 10 from the default branch to the #new-empty-branch. Unfortunately all revisions have been pushed already.
This is what I would like to end up with:
NULL -> 1 -> 2 -> 3 -> 4 -> etc #default
\
10 -> 11 -> 12 -> 13 -> 14 #new-empty-branch
Any ideas?
Are you sure you really want what you're showing in that later picture? That's a repository with two root (two revisions without parents). That's not illegal, but it's not normal and it's definitely not how people branch.
If you really want that (and trust me you almost certainly don't) your're going to have to modify changeset 10 (since named branch is a hashed-component of the revision) and every changeset after it (since parent's hash is a hashed-component of the revision) and you'll end up with a different repository and everyone who has cloned it will have to delete their clones and reclone.
Alternately you could just
hg update 10
hg commit --close-branch
and call it a day. That's enough to get 10 to stop showing up in hg heads