Search code examples
linuxversion-controlmercurialmercurial-queue

Interactive program to selectively exclude parts of a diff file


Is there a program (preferably available on Cygwin) which I can use to "filter" a diff file interactively? i.e. I want something like git interactive add, except that I want to operate on a diff file. I have already discovered filterdiff, but I don't think that it supports interactive editing, only inclusion/exclusion of hunks based on a pre-defined search criteria.

My usage scenario: I have a patch in MQ, which I would like to split up per the tutorial here: https://www.mercurial-scm.org/wiki/MqTutorial#Split_a_patch_into_multiple_patches. In order to do so, I have to edit a patch file so that it includes only the (many) changes I want, and doing this manually with a text editor is kind of a pain.

Thanks!


Solution

  • You can probably get what you want using the record extension: https://www.mercurial-scm.org/wiki/RecordExtension

    Apply the patch (but don't commit it) and then selectively commit chunk by chunk using record. You could do that with or without mq in the works.