Add support for detecting hg repositories