Subversion loves Araxis Merge (or, How I finally configured subversion to use Araxis Merge in a not so stupid way.)
Araxis suggests modifying subversions diff-cmd and diff3-cmd settings to get it to use Araxis Merge instead of the defaults. Here is a snippet from their docs. (You can skip it, it's just here to make my post look bigger.):
Open your ‘SVN configuration area’ configuration file in a text editor. The default location for this file is ~/.subversion.
Uncomment the line that specifies the
diff-cmdand set its value to the path of the Merge araxissvndiff executable that you have installed on your machine:diff-cmd = /Users/<userid>/bin/araxissvndiffNote: in the above path, replace /Users/<userid>/bin/araxissvndiff with the full path to the Merge Merge araxissvndiff command-line utility that you have installed on your machine.
Also uncomment the line that specifies the
diff-cmd3and set its value to the path of the Merge araxissvndiff3 executable that you have installed on your machine:diff3-cmd = /Users/<userid>/bin/araxissvndiff3Note: in the above path, replace /Users/<userid>/bin/araxissvndiff3 with the full path to the Merge Merge araxissvndiff3 command-line utility that you have installed on your machine.
By doing what they say, you tell svn to use Araxis Merge every time it needs to merge a file. The problem with this is that svn will open Araxis Merge to make every merge. When you have a couple hundred files, you want svn to merge everything it can without opening Araxis Merge, and to only open it when there is a conflict. There is a way to do this, but it is not obvious.
These instructions are specific to OSX, but should be enough of a hint for getting set up on any platform.
We need to create a shell script that we can use as a merge tool. It needs to be somewhere in your execution PATH. I've added ~/bin to my execution PATH and have put the script there, but you could put it in a directory that is already in your path, such as /usr/local/bin.
Here is the script, it is named araxishelper.sh:
#!/bin/sh araxissvndiff3 $2 $1 $3 > $4 exit $?
Make sure it's executable bit is set:
chmod +x araxishelper.sh
Now we need to configure subversion to use this new merge script. Edit your subversion configuration file ~/.subversion/config, and add the line:
merge-tool-cmd = araxishelper.sh
Thats it! Well, almost. If you try doing a merge now, nothing different happens. What gives? You have to tell subversion to use the merge-tool-cmd setting by adding '--accept launch' to your svn merge command.
svn merge svn+ssh://mrhalzy@foobar.com/code/branch/awesome --accept launch
It is important to know that we are using the default merge tool (probably diff3) for the bulk of the merging and only using araxismerge when diff3 can't handle it. Because araxis does a bit more than diff3, you might not have any conflicts to resolve when it pops up. This means that diff3 couldn't handle it, but araxis could. Just save, close and continue.
Cheers,
Halzy
"Wait!", screams the pseudo-technical guy in the back of the room. "What is it that the script is doing?"
Well, it's remapping the argument order. Subversion isn't consistent in it's argument order for diff3-cmd and merge-tool-cmd. So we have to use this proxy script to make it work. The arguments are: $1 = base, $2 = theirs, $3 = mine, $4=merge result location.