Add tests for Mercurial support

Fixes #511

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