I've got some MQ patches with work implemented in file path project/feature_a
, but I need to move these changes to project/feature_b
. Is there an easy way to do this?
Asked
Active
Viewed 25 times
1

moswald
- 11,491
- 7
- 52
- 78
1 Answers
1
The only way is to modify the patch files directly with a tool or an editor.
You must (of course) do this while the patches are unapplied, so begin with
$ hg qpop -a
Then edit the patches in .hg/patches
using either an editor of your choice or perhaps by using filterdiff from patchutils. Running
$ filterdiff --strip 3 \
--addoldprefix a/project/feature_b/ \
--addnewprefix b/project/feature_b/ your-patch
might do the trick by stripping off the old a/project/feature_b
prefixes before adding new ones.

Martin Geisler
- 72,968
- 25
- 171
- 229
-
I thought that might be the only way. Thanks! – moswald Jun 04 '13 at 16:03
-
1For anyone else who stumbles upon this question, make sure your editor does not remove trailing spaces when editing patch files (like mine did). I had spaces in my path, which means the `---` and `+++` lines have to end with a `TAB`. – moswald Jun 04 '13 at 17:35