Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 897
brandizzi Avatar asked Oct 07 '11 20:10

brandizzi


1 Answers

Note that there are two 00changelog.i files:

  • one in .hg/00changelog.i which is a small backwards-compatibility placeholder for ancient versions
  • another (the one you damaged) in .hg/store/00changelog.i
like image 192
mpm Avatar answered Oct 22 '22 16:10

mpm