mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-11 11:53:51 +00:00
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.
28 lines
746 B
Bash
Executable File
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
|