Mercurial Repo: Corruption in most recent commit
I believe my most recent commit in Mercurial has become corrupt. I cannot commit anything anymore, nor can I rollback.
I ran hg verify
which suggested I should run hg recover
. I then ran hg recover
as suggested and I am now getting the error:
abort: index 00manifest.i is corrupted!
According to this post: http://osdir.com/ml/version-control.mercurial.general/2007-03/msg00099.html I should be able to remove the last 64 bits from the 00manifest.i
file and start working again.
Is this correct and how would I go about doing so?
PS. Everything I have done so far has been on a clone of the original repositor开发者_StackOverflow社区y.
Many thanks,
Andy
You can truncate 00manifest.i
using a Python console:
$ python
>>> with open("00manifest.i.orig", 'rb') as fp:
... data = fp.read()
>>> with open("00manifest.i", 'wb') as fp:
... fp.write(data[:-64])
First, the file is read in binary mode. data
is just a string. Then slicing is used to write back all but the last 64 bytes, again in binary mode.
精彩评论