added auto detection hg directory