now work with either git or hg repo for version automatic detection