views:

250

answers:

3

I have a patch which I'd like to split into two patches. I need to split the patch with per-line granularity -- I can't just split the hunks up into two separate files.

I could use Emacs diff mode, but I'm a Vim user, and I don't want to learn Emacs. I'm managing this patch in Mercurial Queues, and I've been using the crecord plugin, but it's pretty cumbersome for large patches, and the UI is really slow.

Ideally, I'd like to use Vim for editing my patch, but I haven't been able to find a suitable plugin. Otherwise, anything other than Emacs which is better than crecord would be helpful to me. Does such a thing exist?

A: 

Ideal tool for manually splitting patches for me is git add -i.

You can also try filterdiff, but it depends if it allows manipulations you want to do.

Michal Čihař
A: 

If you add the Mercurial tag to this question, it might get seen by some Mercurial experts around...

RyanWilcox
+1  A: 

There seem to be two plausibly acceptable answers:

  • Is there some reason vimdiff isn't good enough? You could edit a copy of original and a patched copy, moving the changes you want onto the original, save it, diff it against the true original to create the first patch, and diff the fully patched version against it to create the second patch. – Jefromi 2009-08-25 20:49.

  • I've been using VCSVimdiff with Mercurial for a long time, it works very nicely. – tonfa 2009-12-24 13:55

If someone up-votes this, it will move the question off the unanswered list; it's Community Wiki so there's no benefit to me.

Jonathan Leffler