I have long wanted to use FileMerge as the target for svn diff operations on Mac OS X. But I was just too damned lazy to bother.
Fortunately, Mike Ash was not so lazy. Unfortunately, Mike’s simple/elegant solution titles the two versions of the file “tmp” and “tmp.2″.
This works fine if you have a short term memory span of more than about 30 seconds. I do not. My short term memory is more like that of a goldfish.
Mike’s script will also fail intermittently in that svn diff deletes the temporary files as soon as the command diffing them completes. That is often before FileMerge reads the files on my system.
So, I wrote a much longer and far less elegant script that puts the name of the file and version number into the title bar while also leaving copies of the renamed files in /tmp/svndiffshm-UID forever.
You can download the script from my personal subversion repository at red-bean.
To use, you can pass the –diff-cmd command line argument to svn diff. Personally, I want FileMerge to come up all the time.
For that, edit ~/.subversion/config. Uncomment the [helpers] line and [uncomment and] set the diff-cmd line to point to the script. It has to be an absolute path (I ought to file a bug against subversion about that).
Works for me. I’m sure someone will point out a far simpler way to do this.
Update #1: Ken Anderson pointed out that the script wasn’t working when using the generic svn diff command against a file with local modifications. Yup. Sure didn’t. Now it does. The link above will always lead to the latest version.
Update #2: Mark Rowe kindly submitted a patch to enable compatibility between svndiffshim.py and SVK. Patch applied. Changes comitted. Thank you. I really need to take some time to grok SVK. It appears to solve a number of problems that I run into daily, including the need for opaque collections.