#! /bin/csh -f
#
#	revlabel <destdir> <label> <files>
#
#	add a label to the head branch of rcs files
#
if( $#argv < 3 ) then
    echo "Usage: $0 <destdir> <label> <files>"
    exit 1
endif

cd $1

foreach file ( $argv[3-] )
    if( ! -e $file,v && ! -e RCS/$file,v ) continue
    set revlevel=`rlog -h $file | sed -n "s/^head:  *//p"`
    rcs -N${2}:${revlevel} -q $file
    echo "revlabel: $2 ${revlevel}	$file"
end
