Assuming that you have not yet propagated your changes, here is what you can do.
Add to your .hgrc:
[extensions]
mq =
In your repository:
hg qimport -r0:tip
hg qpop -a
Of course you need not start with revision zero or pop all patches, for the last just one pop (hg qpop
) suffices (see below).
remove the last entry in the .hg/patches/series
file, or the patches you do not like. Reordering is possible too.
hg qpush -a; hg qfinish -a
.diff
files (unapplied patches) still in .hg/patches (should be one in your case).If you don't want to take back all of your patch, you can edit it by using hg qimport -r0:tip
(or similar), then edit stuff and use hg qrefresh
to merge the changes into the topmost patch on your stack. Read hg help qrefresh
.
By editing .hg/patches/series
, you can even remove several patches, or reorder some. If your last revision is 99, you may just use hg qimport -r98:tip; hg qpop; [edit series file]; hg qpush -a; hg qfinish -a
.
Of course, this procedure is highly discouraged and risky. Make a backup of everything before you do this!
As a sidenote, I've done it zillions of times on private-only repositories.