Rebase for Mercurial

Issue #511

Signed-off-by: Michal Čihař <michal@cihar.com>
Update the config only if neede

Signed-off-by: Michal Čihař <michal@cihar.com>
Basic prepare for hg reset

Issue #511

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

Issue #511

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