开发者

Mercurial abort: index ... is corrupted

开发者 https://www.devze.com 2023-01-31 12:37 出处:网络
I get the following error when trying to clone from the production repo. abort: index data/HR3/globals.php.i is corrupted!

I get the following error when trying to clone from the production repo.

abort: index data/HR3/globals.php.i is corrupted!

After which mercurial promptly farts out on me and fails to clone. I've tried removing the file in question from the production repo, and that failed. I also tried deleting the .hg directory in the production repo and re-adding and committing all of the files. This produces the same error.

Just fyi, I'm trying to clone the current production copy of our app to our test server. Our test server is running in Virtual Box.

UPDATE

I fixed the issue by deleting the globals file and then deleting the .hg directory a开发者_如何学Pythonnd re-running "hg init" and "hg add ." and "hg commit."

Now I get an Internal server error when I try to clone. The following is the clone command I used.

sudo hg clone http://10.1.1.25/ www

Oddly enough, mercurial tells me that the "real" url is "10.1.1.25/HR3/index.php" which is most definitely not my mercurial repository. I do not know why it is doing this. I checked in my server logs, and the following error is what Apache crapped out.

[Thu Dec 16 12:25:30 2010] [error] [client 10.1.1.102] PHP Parse error:  syntax error, unexpected T_STRING in /var/www/.hg/store/data/_h_r3/includes/_b_n_a_s/_b_n_a_s-_h_r_s201.php.i on line 22

Apparently the clone command is causing Mercurial to kick off PHP and make it try to parse something in Mercurial's data store?

RESOLUTION

I suspect this was caused by the fact that I have an index.php file at the root directory of my repository that does redirects. If you try and navigate directly to http:10.1.1.25 on our network, you're automatically directed to the index page, which is not the index.php page in the root directory. Somehow I think that this was causing php to kick off and try to parse items in the mercurial store. I've resolved this issue by cloning over ssh.


I have faced such an error before. Try to run

hg verify

on your corrupted repository. Then follow the instructions from here:

http://www.softwareprojects.com/resources/programming/t-how-to-fix-mercurial-corrupt-repository-1926.html


It seems that you publish your repo with the static-http method, from the same server as your development project lives. This method only works if the web server does not mess with $URL/.hg, which your one seems to do. check if you can download the .hg folder with wget -r -np $URL/.hg in a fresh folder and run hg verify there.

Oddly enough, mercurial tells me that the "real" url is "10.1.1.25/HR3/index.php" which is most definitely not my mercurial repository.

I guess that your web server redirects some mercurial requests to your index.php url.


You may try to do that:

hg forget HR3/globals.php
hg commit
hg add HR3/globals.php
hg commit
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号