hg rebase abort fails: "unknown revision"
Asked Answered
C

2

16

Occasionally when performing a rebase using the MercurialEclipse plugin my repository gets thrown into an odd state. It will become stuck in a "rebasing" state, yet when I try to abort the rebase (e.g. "hg rebase -a") I get this error message:

abort: unknown revision 'xxxx'!

Where xxxx is a revision hash. Usually at this point I've abandoned all hope of performing the rebase -- I just want to get back to a happier time when my repository was not screwed up. So far my solution has been to nuke my project directory and clone it again. Is there a less drastic solution?

Cite answered 30/5, 2012 at 20:55 Comment(1)
I can confirm the issue still exists, this was discussed on the lists: comments.gmane.org/gmane.comp.version-control.mercurial.devel/… but no fix is still inSensitometer
S
18

Just remove the .hg/rebasestate and your repo will work.

The patch described in this thread calls the internal function clearstate which just unlinks this file.

Sensitometer answered 25/6, 2012 at 12:51 Comment(1)
Hah, it worked! Thanks also for finding the issue on the hg devlist. Perhaps we can revisit this answer once the issue is fixed.Cite
P
1

In situations similar to this, I usually do:

$ hg check
$ hg verify
$ hg up -C default

Instead of default, use whatever branch you're working on. This takes time, but so does re-cloning the repo.

It usually helps.

Puttyroot answered 30/5, 2012 at 21:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.