[m-rev.] New tools command: cvsdiff

Ralph Becket rafe at cs.mu.OZ.AU
Thu Oct 24 15:02:23 AEST 2002


I've been using this one for a while; it's fairly handy.

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.
	
Index: tools/cvsdiff:
+#!/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 diff > $newcvsdiff
+
+newinterdiff="interdiff-$M-$N"
+
+if [ -z "$lastcvsdiff" ]
+then
+	cp $newcvsdiff $newinterdiff
+else
+	interdiff $lastcvsdiff $newcvsdiff > $newinterdiff
+fi
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list