#!/bin/bsh

# @(#)RCS log script
# graphical views of rlog under IRIX
# this is totally non-portable, requires X and IID
# version 0.1, April 2005
# $Id: grlog.sh,v 1.19 2005/04/08 07:23:27 david Exp $

# catch command with wrong number of arguments
if [ $# -lt 1 ]; then
        echo "Usage: $0 filetoview1 filetoview2 ..."
        exit 1
fi


for FILE in $@
do
{

    RCSPATH=`dirname $FILE`/RCS/`basename $FILE`,v
    if [ ! -r $RCSPATH ]
    #not already checked into rcs
        then
		    if [ ! -r $FILE ]
		#file does not exist
			then
				xconfirm -t "$FILE not found" -icon warning -header grlog -b OK > /dev/null
			else
				xconfirm -t "$FILE is not managed by RCS" -icon warning -header grlog -b OK > /dev/null
		     fi


else
    TMPFILE=/tmp/$$`basename $FILE`rlog

    rlog  -b $FILE > $TMPFILE && xconfirm -file $TMPFILE -icon info -header grlog -useslider -b OK > /dev/null && rm -f $TMPFILE
	
fi
} &

done
    	
exit 0

