GUI tool for applying patch files for windows [closed]

There any number of good GUI diff-tools for windows (I use Araxis Merge, and kDiff3), but none of them (that I can find) will apply a patch file. I would expect it to work like this: I open a base file and a patch in a tool. I should get a diff view with the base file on the left and what that file would look like with the patch applied on the right. Then I can save the result file somewhere (possibly after cleaning up conflicts).

This seemed like such an obvious thing that I was shocked that my existing tools did not do it. Does this feature exist somewhere (for windows?)


Solution 1:

I agree that it's pretty bizarre that so few of the existing GUI diff programs can create or apply patches, I'm not aware of a single one that can do both.

TortoiseMerge can apply unified diffs though. It's a standalone program that comes as part of TortoiseSvn or if you don't want the whole Svn package you can get TortoiseDiff and TortoiseMerge alone from here.

It's a bit fiddly to use. Launch it and select 'Unified Diff' it then wants a path to a patch file and a directory path where it expects to find the file to be patched (I think this is because it expects to operate on versioned files). Then it opens the main view showing the file to be patched in an odd little window and you have to double click on that to see the patch result, which you can then save to the original file or a new one.

Or you can launch it from the command line like this:

C:\Users\Bob\>tortoisemerge /mine:file1.txt /diff:patch2.diff /patchpath:"C:\Users\Bob"

Which should make it easy enough to launch from a batch file or shell extension.

Solution 2:

You can use this Win32 native port of the patch utility. It comes with a bigger selection of other utilities, and in contrast to cygwin and similar it does not need any DLLs. Just pick your tiny executable of choice and store it wherever you want.

Usage:

patch.exe -i [filename]

To get help:

patch.exe --help