handle hg root dir