Alex Rivera | Logout

Mercurial: message "abort: index 00changelog.i is corrupted!" after running a sed command. How to deal with it?

Asked 2011-10-07T20:12:25.623
9

I have a project versioned by Mercurial. Once, I ran a command such as...

$ find . -type f | xargs sed -i.bkp 's/my_func/another_func/'

...in this project. Then Mercurial just stopped to work on it:

$ hg status
abort: index 00changelog.i is corrupted!

The file 00changelog.i did not contain the replaced string, and even if I move 00changelog.i.bkp to 00changelog.i the problem persisted. hg verify didn't help either:

$ hg verify
abort: index 00changelog.i is corrupted!

I solved this problem by cloning the project from my remote repository in another directory and then copying .hg from my cloned repository to the corrupted one. However, I wonder: is there another more practical way of solving it? BTW, why does this problem happens if the "corrupted" file is not even altered?

Edit
Report

1 Answer

-2

I'd use convert to re-generate the repo or transplant to move the patches to the new one. Good luck.

answered 2011-10-07T20:43:57.863

Your Answer