hg support and fix path bug