Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check a Mercurial repository for consistency (checksums)?

Assume I recover a Mercurial repository from a broken file system (e.g. bad hard drive), and I want to be sure that this one was not affected.

How can I force a self-check in Mercurial? That is, Mercurial walks through the whole history and checks that all checksums fit their respective dataset, and that the repository as a whole is consistent.

Is it sufficient to perform a local "hg clone" to enforce that check?

It there something like "git fsck" for Mecurial?

like image 356
vog Avatar asked Sep 06 '25 02:09

vog


1 Answers

The command for a pure check is:

hg verify

In case the repository is corrupt, the Mercural wiki provides recovery instructions:

  • https://www.mercurial-scm.org/wiki/RepositoryCorruption

Of course, this only checks the commits, not the working directory. That it, it neither checks local changes that were not yet committed, nor ignored files such as build results. All those can't be verified by Mercurial, of course. Those would either have to be verified by different means, or simply be reset using a fresh Mercurial checkout and a fresh build.

like image 142
vog Avatar answered Sep 07 '25 22:09

vog