hg import to apply patch to a subdirectory

Sean Farley sean.michael.farley at gmail.com
Wed May 2 11:11:34 CDT 2012


> Okay, you're looking a kind of reverse to 'hg import --strip', right?
> Something that would add a prefix or at least make 'hg import' use the
> current directory as the root when applying patches.

That's correct.

> The patchutils tools can do it
>
>  http://cyberelk.net/tim/software/patchutils/
>
> Using
>
>  filterdiff --strip 1 --addoldprefix a/subdir/ --addnewprefix b/subdir/ patch1
>
> will first strip the a/ prefix and then add a/subdir/ to the old paths
> (similarly for the new paths).

Aha, very nice! Thanks for the tip :-) This will definitely make my life easier.

I find this comes up a lot when I use the transplant extension and
occasionally with 'hg import'. Is there any other interest in having
something like this in mercurial?


More information about the Mercurial-devel mailing list