It is confusing that the --new-branch flag does not work when you click on function branches (also called anynomous branches). An anonymous branch is as follows:
... [a] --- [b] --- [c] <- the servers head on default \ [x] --- [y] <- my feature branch on default
All change sets are on default , so now you have two heads on default . When you click, you will create two heads on the server, but Mercurial is interrupted before that with the warning you see. It is interrupted because several goals on the server are confusing: when you hg clone , your working copy will be updated to one of them, almost randomly.
The --new-branch flag is only for named branches . Mercurial is usually aborted if you push the new named branch to the remote repository. Adding the --new-branch flag is how you say it to go on.
Unfortunately, we do not have the --create-new-feature-branch flag selected. We only have the --force flag, which tells Mercurial to go ahead and create two chapters in the remote repository. The disadvantage of --force is that it overrides all security checks: you can click three or more new heads with this flag, and you can even click into an unrelated repository. Therefore, you should use hg outgoing to double check that you are going to click.
I wrote above that several heads on the server get confused, as the new clone will be updated to an arbitrary head. To avoid confusion, you can specify the branch names of objects by placing them in bookmarks. You will still be updated to an arbitrary head, but hg bookmarks will show you the available function branches, and you can update them to the desired one. Therefore, if you use such a workflow, go to hg push -f .
Martin geisler
source share