Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mercurial: how to recover from an interrupted "qpop -a"?

I've imported a couple of revisions into the queue and tried to pop them all. Unfortunately, according to some other Mercurial client accessing the same repository, hg qpop -a didn't complete successfully:

> hg qpop -a
popping 115.diff
popping 114.diff
popping 113.diff
popping 112.diff
popping 111.diff
abort: The process cannot access the file because it is being used by
another process
C:\Program Files (x86)\Mercurial\library.zip\mercurial\dispatch.py:217:
DeprecationWarning: use lock.release instead of del lock

Now I'm not able anymore to push the patches back. Mercurial always complains about an "unknown node":

> hg qpush -a
mq status file refers to unknown node b6fb614866f1
abort: working directory revision is not qtip

What does this mean and how can this problem be resolved?

like image 249
mstrap Avatar asked Jun 08 '12 13:06

mstrap


1 Answers

It sounds like your dirstate was corrupted by the failed operation. A similar issue was reported to the hg mailing list a long time ago (link). You should review this blog post by Andreas Wuest that goes over a recovery procedure.

It basically boils down to this:

$ > .hg/patches/status          # force mq to think no patches are applied
$ hg debugrebuildstate -r tip   # rebuild your working copy

This does not destroy your patch queue, nor does it lose any working copy changes that were not part of a patch. However you need to carefully inspect (and maybe fix) file versions to get back to a clean working copy.

like image 127
Tim Henigan Avatar answered Sep 30 '22 17:09

Tim Henigan