Files
mercury/tools/cvsdiff
Ralph Becket 0f4546ef69 Added this script which performs a `cvs diff' on the current
Estimated hours taken: 1
Branches: main

tools/cvsdiff:
	Added this script which performs a `cvs diff' on the current
	working directory, deposits the output in a new file, and
	computes and saves the interdiff on the new and next newest
	cvs diff outputs.
2002-10-24 06:21:49 +00:00

28 lines
746 B
Bash
Executable File

#!/bin/sh
# cvsdiff deposits the results of running `cvs diff' in a file cvsdiff-<N+1>
# where <N> is the current latest cvsdiff file number (e.g. if the latest
# cvsdiff file is cvsdiff-3 then the new one will be cvsdiff-4.)
#
# The results of running `interdiff cvsdiff-<N> cvsdiff-<N+1>' are deposited
# in a file interdiff-<N>-<N+1> (e.g. to follow the example above, the
# interdiff file would be interdiff-3-4.)
set -x
lastcvsdiff=`ls -rt cvsdiff-* 2> /dev/null | tail -1`
M=`echo $lastcvsdiff | sed 's/cvsdiff-//'`
N=`expr 0$M + 1`
newcvsdiff="cvsdiff-$N"
cvs -n diff > $newcvsdiff
newinterdiff="interdiff-$M-$N"
if [ -z "$lastcvsdiff" ]
then
cp $newcvsdiff $newinterdiff
else
interdiff $lastcvsdiff $newcvsdiff > $newinterdiff
fi