How do I convert a mercurial queue patch to uncomitted changes in my working copy?

81 Views Asked by At

I have an applied patch in my Mercurial queue, how do I convert this patch into uncommited changes in my working copy (as though I'd never created the patch using qnew)?

2

There are 2 best solutions below

0
On BEST ANSWER

Tell Mercurial to refresh the patch but exclude all files. This will leave all changes in the patch uncommitted in your working folder. You are left with an empty applied patch that can be popped off and deleted.

hg qref -X *
hg qpop -f
hg qdel <patch>
0
On

Well, in the absence of other answers, here's what I ended up doing:

First pop the patch off the patch stack so it is no longer applied

hg qpop thepatchname --keep-changes

I'm not sure if the --keep-changes was necessary, but I had local uncommitted changes I wanted to keep.

Next I had to shelve some uncommitted changes in my working copy so I could apply a patch

hg shelve

Now apply the patch, stored in .hg/patches using the import command, with the --no-commit option so the patch is not commited to your repository.

hg import .hg/patches/thepatchname --no-commit

You can now delete the patch if you like.