Archive for May, 2008

Recovering From a Corrupted Mercurial Repository

Thursday, May 15th, 2008

The other day I almost lost one of my projects due to metadata corruption in the Mercurial repository. Mercurial had been pretty reliable and efficient. I can’t say if the corruption was Mercurial’s fault, as I suspected it was because of my frequent rsync’s between my laptop and the desktop. Sometime ago, an rsync run probably left some of the files in that one project’s repository in a state of flux. When I attempted to create a branch by cloning the project, I ran into an error and Mercurial refused to continue. It was complaining about a damaged changeset. Fortunately the damaged changeset contained only a small modification to a single file and I was able to recover from the corruption.

(more…)