#!/bin/sh
# ws_diffs: This program computes all the differences
# between your workspace and the parent for the files you specify 
# which helps generate resistance forms. 
# File name arguments must be relative to the workspace root.
#
# 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.
 
parent=`workspace parent` 
wsname=`workspace name` 

rm -f Changed_Files
( putback -n $* ) | ( grep "update:" ) | ( sed -n -e "s/update: //p" ) > Changed_Files

echo "The following files have changed-"
echo " "
cat Changed_Files
echo " "

cat Changed_Files | while read file; do
        sid1=` ( sccs prt -y $parent/$file ) | ( sed -n -e 's/.*D \([0-9]*\.[0-9]*[^ 	]*\).*/\1/p' ) `
	echo " "
        echo sccs diffs -C -r$sid1 $wsname/$file 
        sccs diffs -C -r$sid1 $wsname/$file 
	echo " "
done

