use right format for hg
fix some repo path calculation bugs