Menu

#1 kdiffcvs shell script for cvs diffs

open
nobody
None
5
2018-03-14
2004-06-22
No

!/bin/sh

based on script from Joachim.

This script allows you to diff a cvs file against

the current repository version, a particular cvs

version of the file, or compare two cvs versions

of the same file.

This script expects that you are running kdiff3

under cygwin (edit the cygpath calls if you don't

use cygwin).

Also, I opted to leave the rm call commented out.

Use of this script is entirely at your own risk.

usage="Usage:\n $0 filename [revision] [revision]"
argc=$#
if test $argc = 0; then
echo -e "$usage"
exit 1
elif test $argc = 3; then
fileA="/tmp/$1_$2.tmp"
fileB="/tmp/$1_$3.tmp"

# use either set of commands, whichever is faster:
cvs -q up -p -r $2 "$1" > "$fileA"
cvs -q up -p -r $3 "$1" > "$fileB"
#cvs diff -r $2 "$1" | patch -R "$1" -o "$fileA"
#cvs diff -r $3 "$1" | patch -R "$1" -o "$fileB"

remove="$fileA $fileB"

elif test $argc = 2; then
fileA="/tmp/$1_$2.tmp"
fileB="$1"
cvs diff -r $2 "$1" | patch -R "$1" -o "$fileA"
remove="$fileA"
else
fileA="/tmp/$1.tmp"
fileB="$1"
cvs diff "$1" | patch -R "$1" -o "$fileA"
remove="$fileA"
fi
/c/Program\ Files/KDiff3/kdiff3 "$(cygpath -m
$fileA)" "$(cygpath -m $fileB)" &

kdiff3 "$fileA" "$fileB"

rm $remove

Discussion

  • Dave Schuyler

    Dave Schuyler - 2004-06-22

    Logged In: YES
    user_id=473331

    ok, I see that I should have attached the file instead of
    putting it in the description.

     
  • sat

    sat - 2018-03-14

    I removed cygpath line and it worked fine for me on linux. Thanks for the script.