#!/bin/sh

### since - show deltas to SCCS files since the specified date
#
# THIS SAMPLE PROGRAM IS BEING PROVIDED "AS IS" AND ONLY AS A COURTESY TO
# THE RECIPIENT.  SUN MAKES NO WARRANTY OR REPRESENTATION, EITHER EXPRESS 
# OR IMPLIED WITH RESPECT TO THIS SAMPLE PROGRAM INCLUDING QUALITY, PERF- 
# FORMANCE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON- 
# INFRINGEMENT.  IN NO EVENT WILL SUN BE LIABLE FOR ANY DIRECT, INDIRECT,  
# SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR  
# INABILITY TO USE THIS SAMPLE PROGRAM.

### Define function to print usage message and exit.
usage() {
	echo "usage: since yymmdd [file ...]" 1>&2
	exit 1
}

### Get the date.
[ $# -gt 0 ] || usage
when="$1"
shift

### Get the names of the files to process.
if [ $# -eq 0 ]; then
	if [ ! -d SCCS ]; then
		echo "no files specified and no SCCS directory" 1>&2
		exit 1
	fi
	set -- dummy `cd SCCS; ls s.* | sed 's/^s.//'`
	shift
fi

### Show the old changes for each file.
for file
do
	sccs prs -l -c${when}000000 $file | egrep -v '^(MRs|COMMENTS):'
done
