TortoiseSVN (as well as other Tortoise clients) include a script to diff notebook files in Mathematica. Diff functionality for Mathematica is implemented in the AuthorTools pac
Here's a simple example of producing the notebook diff using a Mathematica script.
Save the following as diff.m
Needs["AuthorTools`"]
If[Length[$ScriptCommandLine]>=3,
{f1, f2} = $ScriptCommandLine[[{2,3}]],
{f1, f2} = {"one.nb", "two.nb"}]
diff = FileNameJoin[{$TemporaryDirectory, "diff.nb"}]
Put[NotebookDiff[f1, f2], diff]
Run["Mathematica " <> diff]
DeleteFile[diff]
Exit[]
Then call it from the command line using MathematicaScript -script diff.m "one.nb" "two.nb"
. This works on my system (Ubuntu 11.10, Mathematica 8.0.1) and should be platform independent.
If you're using a version of Mathematica older than v8, then you'd have to use MathKernel -noprompt -run < diff.m
instead of MathematicaScript
and the default values for {f1, f2}
will be used.