Correct post-review error messages when run outside of a checkout directory, when Mercurial is not installed

Review Request #322 — Created March 28, 2008 and submitted — Latest diff uploaded

Information

Review Board SVN (deprecated)

Reviewers

Currently, if you call post-review outside of a checkout directory (somewhere that no SCM info is available), and you do not have Mercurial installed, you will see this error (using a bash shell):

Failed to execute command: hg root
/bin/sh: hg: command not found

That's not a very helpful or clear error message.  This patch causes the following error message to appear instead:

The current directory does not contain a checkout from a
supported source code repository.

That's much more clear and is a correct statement of the problem.

It looks like the Mercurial code was only tested on machines where Mercurial is installed.  I think the code as written would work fine in that case -- but, not all of us have it installed.
I don't have Mercurial installed (hence this patch), but I have tested that post-review still works outside of a source controlled directory (giving a valid error), and inside of a Subversion checkout directory.