malintha
malintha

Reputation: 176

Hg working directory revision is not a qtip

I'm using mercurial Hg in command line. After created a patch, I needed to revert to another changeset due to some errors happened later. Now it's needed to refresh the patch file. When executing Hg qref it says, abort: working directory revision is not qtip. Also, hg parent is a tip.

Upvotes: 2

Views: 2521

Answers (2)

Jonatan Hägglund
Jonatan Hägglund

Reputation: 33

I'll add an answer to help other people that may encounter the same error message in the future. I'm not sure our issues was identical but definitely related.

I got "abort: working directory revision is not qtip" while trying to apply a patch onto my working directory. It turned out that I had older patches in the patch queue which caused the problem and after I deleted these and tried again it worked!

Here's what I did: Opened a console window and navigated to the working directory where I entered the command:

hg qseries

this listed the patch queue. Then to delete the old patches I entered:

hg qdelete [patch name (which was just listed)]

The response in my case was "abort: cannot delete applied patch ..." and to resolve this I entered:

hg qpop

This unapplied the patch and then I could use the "hg qdelete" command again which now work. Repeated this until all old patches were gone and tried to apply the new patch again.

Found the solution in the "Mercurial: The Definitive Guide", written by Bryan O'Sullivan, under section 12.7.1. http://tortoisehg.bitbucket.io/hgbook/1.4/managing-change-with-mercurial-queues.html#id2858507

Hope someone finds this useful!

Upvotes: 2

malintha
malintha

Reputation: 176

It happened due to popping the current head out of the queue. In order to refresh, the patch should have been taken into the head of the queue by qpush.

Upvotes: 0

Related Questions