Fixes to the mercurial try client

Here are a few fixes to the mercurial try client, to work when no upstream repository is configured, to correctly calculate the GCA between local and upstream, to improve error reporting from the hg command, and to set the baserev when possible