Fork from the .hg Google Code repository. Not my original work.