(Re)Viewing SVN Patch Files

2014 Sep 12

Well I got around to creating the script mentioned in the course of this thread.

As originally intended, this script helps to view a SVN patch file w/out touching an existing working copy or requiring a new/scratch working copy. It works as such:

  1. Parsing the patch file for the list of files & base revs
  2. Getting a copy of each into a temporary tree (sort of like a sparse checkout, minus the actual checkout)
  3. Applying the patch to a clone of the base tree, and launching a diff program to view the two.

Full usage info is available by running it w/out params.
In it's simplest form, run the script from a WC directory and pass it the patch file:
ViewSvnPatch.sh <patch file>

The diff program that this script launches defaults to the same program set for the diff-cmd value in ~/.subversion/config if such a value is defined, and can be overridden via an environment variable (explained in the usage instructions).

Caveats:

Send questions to [[nospam AT codesniffer DOT com]], but understand that I may not have time for investigations.

Here are the patches:

I hope it helps someone.