Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

hg rebase abort fails: "unknown revision"

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?

like image 630
NobodyMan Avatar asked May 30 '12 20:05

NobodyMan


2 Answers

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.

like image 88
jontro Avatar answered Sep 26 '22 22:09

jontro


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.

like image 34
Helgi Avatar answered Sep 24 '22 22:09

Helgi