
If you work with svn you might want to compare differences between two or more revisions – this is especially handy if you come back to work after the weekend and your work partner has already submitted quite some changes. I always forget the right command and especially the correct syntax, so this post is mainly a reminder for myself.
The comparison can be done via:
$ svn diff -r 63:64 .
Index: XSmsCenterActions.cpp
===================================================================
--- SomeActions.cpp (Revision 63)
+++ SomeActions.cpp (Revision 64)
@@ -68,7 +68,7 @@
boolValue=true;
connect( my_firstAction, SIGNAL( activated() ) , this, SLOT( dothisSlot() ) );
- connect( my_secondAction, SIGNAL( activated() ) , this, SLOT( dothatSlot() ) );
...
The command is recursive by default, and in this case compares all files in the directory. If you exchange the dot at the end of the comman with a file name, just the changes of the file are compared.

August 24, 2008 at 9:04
The trailing dot in “svn diff -r 63:64 .” may also be omitted, as the target defaults to the working directory.
August 24, 2008 at 12:34
But who wants to look at raw diff text output nowadays?
A graphical diff viewer is the only way to fly. I use kompare, e.g.
svn di | kompare -o -
August 24, 2008 at 17:32
In fact, this operation is so common, they added an option for it.
Instead of having to diff the revisions, you can do:
svn diff -c 64
…to show the differences committed in revision 64.
August 24, 2008 at 18:28
Mark, nice one, didn’t knew that
Benjamin, thx for the shortcut!
September 27, 2008 at 14:35
SVN actually has built-in support for other diff viewers. I my case I use kdiff3:
svn diff –diff-cmd kdiff3 -r 42:HEAD foo.bar