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 t开发者_如何学JAVAhis 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?
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
I'd use convert to re-generate the repo or transplant to move the patches to the new one. Good luck.
精彩评论