Speedup getting branch name for mercurial as well