Mercurial 1.4's schemes extension

Mercurial 1.4.1 was released last week. It’s obviously a minor update compared to what 1.4 was, but it does include a really neat built-in extension: schemes

Let’s say you are like me and want to push your code up to your project’s Kiln repository. This involves typing something along the lines of:

hg push "https://justinw@secondgear.fogbugz.com/kiln/repo/products/group/today"

Disregard the fact that Kiln URLs are reek of Linux or Windows guy cruft. That’s obviously a lot to type out. With schemes, you can shrink it a bit.

Add the following to your .hgrc file.

[extensions]
hgext.schemes=

[schemes]
k = https://justinw@secondgear.fogbugz.com/kiln/repo/products/group/

Now instead of typing out that long URL, you can type out the following:

hg push k://today

There are already predefined schemes entries for bitbucket (bb) and Google Code (gcode) repositories. Couple this with TextExpander and you have some seriously minimalist typing.