dummzeuch
dummzeuch

Reputation: 11252

How can I recover from a corrupted .hgsubstate file?

When trying a

hg commit

or

hg status

I'm getting the error

abort: invalid subrepository revision specifier in .hgsubstate line 3

This is probably why:

f322ee070c467d1e517564d679f150693739d186 buildtools
2e68a7e2306704c8dc98802c73897c6c43bf96bc dzlivetemplates
 libs/dxgettext
 libs/dzlib
 libs/jcl
 libs/jvcl
 libs/tregexpr

The first two lines look OK, but starting from the 3rd line there is no GUID for the subrepository revision.

I have no idea how this happened (but I probably caused it myself).

How do I recover from this? Can I just delete the .hgsubstate file and have hg recrate it from the current state of the subrepositories? If yes, how?

Upvotes: 1

Views: 1145

Answers (1)

dummzeuch
dummzeuch

Reputation: 11252

OK, deleting the file (actually I renamed it to be able to restore it) seems to solve the issue.

hg update
hg commit

restored it.

Now I'm back with the original problem: Getting rid of the unintentionally created second head. But that's a different story.

Upvotes: 3

Related Questions