I have a Mercurial alias that pushes a specified branch to the central repo:
[alias]
pushbranch = push -b
This works ok, but 90% of the time I want to push the current branch, which I currently do like so:
$ hg pushbranch `hg branch`
I though I might be able to just update the alias in my .hgrc
like so:
[alias]
pushbranch = push -b `hg branch`
But this fails with:
pushing to branch`
abort: unknown branch '`hg'!
I found this answer for doing essentially this with Git, but the mechanism used there also does not work with Mercurial, I did:
[alias]
pushbranch = push -b '!sh hg branch'
and got:
pushing to ssh://hg@bitbucket.org/myteam/reponame
abort: unknown branch '!hg branch'!
Any suggestions?