fixed hg branch detection