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

Re: subversion gui for linux

From: Raman Gupta <rocketraman_at_fastmail.fm>
Date: 2006-05-03 02:48:12 CEST

David Everly wrote:
> I like meld, but what I really want is something that will compare two
> tags, show me all files that have changed between those two tags, then
> let me click on each file to see what that file's difference is (and
> at this step, it would be fine to look like meld).

The attached shell script replaces "svn diff" and should do it for you.
Put them in your path, define DIFFCMD to a graphical diff viewer that
handles directories e.g.

export DIFFCMD=meld

Then run svntreediff instead of "svn diff" -- svntreediff supports all
the parameters that "svn diff" does:

svntreediff $REPO/tags/tag1 $REPO/tags/tag2

It will write #old and #new directories to your $TEMP (or /tmp) and then
use the graphical diff command you specified (or plain old diff if none
is specified) to show the differences.

Cheers,
Raman

#!/bin/sh

# Default TEMP dir
if [ "$TEMP" = "" ]; then
  TEMP=/tmp
fi

OLD="$TEMP/#old"
NEW="$TEMP/#new"

rm -fr "$OLD" "$NEW"
svn diff --diff-cmd svntreediff.perfile "$@"

# Default diff command if it has not been specified by the user
if [ "$DIFFCMD" = "" ]; then
  DIFFCMD="diff"
  DIFFCMD_CYGWIN=y
fi

# Change to windows-style paths if necessary
if [ "$DIFFCMD_CYGWIN" = "n" ]; then
  OLD=`cygpath -w "$OLD"`
  NEW=`cygpath -w "$NEW"`
fi

"$DIFFCMD" "$OLD" "$NEW"

#!/bin/sh

if [ "$3" = "" -o "$5" = "" -o "$6" = "" -o "$7" = "" ]; then
  echo "Must be called via svn diff using --diff-cmd"
  exit 10
fi

# Default TEMP dir
if [ "$TEMP" = "" ]; then
  TEMP=/tmp
fi

#echo "3 = $3"
#echo "5 = $5"

# Strip the rev numbers
OLDFILEPATH=`echo $3 | sed "s|\(.*\) (\.\.\..*|\1|" | sed "s|\(.*\) (revision.*)|\1|"`
NEWFILEPATH=`echo $5 | sed "s|\(.*\) (\.\.\..*|\1|" | sed "s|\(.*\) (revision.*)|\1|"`

#echo "OLDFILEPATH = $OLDFILEPATH"
#echo "NEWFILEPATH = $NEWFILEPATH"

# Get the dir from the files
OLDDIR="$TEMP/#old/`dirname "$OLDFILEPATH"`"
NEWDIR="$TEMP/#new/`dirname "$NEWFILEPATH"`"

#echo "OLDDIR = $OLDDIR"
#echo "NEWDIR = $NEWDIR"

mkdir -p "$OLDDIR"
mkdir -p "$NEWDIR"

# Get the filename and concat with the dir
OLD="$OLDDIR/`basename "$OLDFILEPATH"`"
NEW="$NEWDIR/`basename "$NEWFILEPATH"`"

#echo "OLD = $OLD"
#echo "NEW = $NEW"

SIZEOFOLD=`ls -l "$6" | awk '{ print $5 }'`
SIZEOFNEW=`ls -l "$7" | awk '{ print $5 }'`

# copy the tmp files created by svn to the values from above if they are not 0 size
if [ $SIZEOFOLD -ne 0 ]; then
  cp "$6" "$OLD"
fi

if [ $SIZEOFNEW -ne 0 ]; then
  cp "$7" "$NEW"
fi

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed May 3 02:49:17 2006

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

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