Using release:prepare, the hg provider assumes it is free to use the basic 'push' command as in 'hg push repoUrl'.
However, if you have created and commited a local feature branch, the release will fail, because the default behaviour of Mercurial is to abort the push if it would create new remote branches, as illustrated :
Since the hg provider does not check for possible local branches, all pushes (checkin and tag) will fail with exit code 1 when the hg push command is triggered :
The expected Mercurial fix for this case is to use push --force or --new-branch to push the feature branch (which is not always the preferred solution) to the repository, or to use push -rbranchname to only push working branch changesets.
The attached patch uses the second solution. It introduces a HgOutgoingConsumer and a HgChangeSet to parse the output of 'hg out', looks for a possible local feature branch, warns (like Mercurial) if one is found, but does not abort the release, instead, it will find the current working branch name, and use the push to use the -rbranchname option.
I believe this is a legitimate fix, since Mercurial, like all DCVS, promotes local feature branches usage, and it was a bit sad to see the mvn release fail on the releasable branch because of this