branchcache: introduce hasbranch()
This will be used to check whether a branch exists or not. This will optimized
in future.
Differential Revision: https://phab.mercurial-scm.org/D6154
Run Mercurial tests with Vagrant:$ vagrant up$ vagrant ssh -c ./run-tests.sh