Add support for hg

This commit adds support for hg. I didn't find any useful git tests in spec/, so I don't know what tests to add. This does work.