Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top