Making mercurial feel like svn

Alec Jacobson

November 11, 2012

weblog/

Stop asking for my password all the time

The easy way to fix this is to add your password in plain text to your .hgrc file. The better way is to use SSH. We were currently using RhodeCode to serve up our mercurial repos but its easy to use SSH instead. For exiting projects just change the [project]/.hg/hgrc file from:
[paths]
default = https://[hg username]@[server]/hg/[project]
to
[paths]
default = ssh://[ssh username]@[server]/hg/[project]
Notice that your [hg username] might be different from your [ssh username].
Update: I'm still figuring this one out...

One-liner commit,push and pull,update

To automatically push after every commit just add the following to your ~/.hgrc:
[hooks]
pre-commit = echo "\x1B[00;32mAutomatically pushing\x1B[00m"
commit.autopush = hg push
The echo serves as a reminder that each commit is really pushing. To automatically update after each pull, just issue:
hg pull -u