[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

graphical diff'ing script

From: <kbrannen_at_gte.net>
Date: 2002-12-09 10:43:47 CET

Here's a quick script I put together to help with graphical diff'ing. It
doesn't handle "-r" kind of stuff, but I rarely need that; and it probably
wouldn't be that hard to add. I'll toss it to the list in case others may
find it useful. I call it "svndiff"; it's a shell script you should put
somewhere in your PATH. Just put a filename after the command and enjoy. :-)

A big thanks to Vladimir for the "svn cat" code!

Kevin

-----

#!/bin/bash
# also works with ksh
#
# usage: svndiff file
# graphically show the diff between our file and that last thing
# in the repository
# uses the program in the env.var. $DIFF, or "xxdiff" by default
# tested with: xxdiff, mgdiff, tkdiff

###################################### start configurable stuff
# default graphical diff program
dif=${DIFF:-xxdiff}
# default geometry, works for the average X program
geometry="-geometry 1000x400+0+0"
# handle tkdiff not liking geometries
[[ $dif = tkdiff ]] && geometry=""
###################################### end configurable stuff

if [[ ! -d .svn ]]
then
         echo ERROR: You are not in a SVN working copy directory.
         exit 1
fi
file=$1
last=${file}_LasT

trap "rm -f $last" 2 3 15

svn cat $file > $last 2>/dev/null
${DIFF:-xxdiff} $geometry $last $file
rm -f $last

#end

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Dec 9 10:40:42 2002

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.