Better way to get last commit ID

Issue #511

Signed-off-by: Michal Čihař <michal@cihar.com>
Implement getting revision information for Mercurial

Issue #511

Signed-off-by: Michal Čihař <michal@cihar.com>