Fix an issue with Mercurial on Python 2.4.

The Mercurial code was using a 'return x if y and z' statement in a
couple places, which doesn't work on Python 2.4. This has been replaced
with a standard if/else.

It also replaces a usage of format(), and replaces with traditional
string formatting.
Release RBTools 0.5.1.