head     1.1;
branch   ;
access   ;
symbols  ;
locks    ; strict;
comment  @# @;


1.1
date     90.03.24.22.06.15;  author kevin;  state Exp;
branches ;
next     ;


desc
@Updated to allow the use of the new RCS
(which allows branches and is compatible
with AMIGA RCS)
@



1.1
log
@Initial revision
@
text
@#!/bin/csh -fe
#
#	gethighrev <version> <rcsfiles>
#
#	get the highest revision file for this version
#
set nonomatch

if ($#argv < 2) then
    echo "Usage: $0 <version> <rcsfiles>"
    exit 1
endif


set dcstring="0sm [lqsm]ss [dsqlm<sz0<r]sr z0<r lmp"
set maxlabel=()

rlog -h $2 | grep "^symbolic names:" | sed -n -e \
    "s/[^$1]*$1_\([0-9]*\)[^;]*;/\1 /gp" | sed -e \
    "s/ [^ ]*[^0-9 ][^ ]*//g" >/tmp/maxlabel$$
set maxlabel=($maxlabel `echo "$dcstring" | dc /tmp/maxlabel$$`)


rm -f /tmp/maxlabel$$
set maxlabel=`echo $maxlabel $dcstring | dc`

if ($maxlabel > 0) then
    foreach i ($argv[2-])
	echo "checkout last internal: $i"
	co -qV$1_$maxlabel $i
	if ($status) then
	    echo "ERROR! co -rV$1_$maxlabel $1 failed"
	    exit 1
	endif
    end
else
    echo "Can't find revision, has a 'make internal' been done?"
    exit 1
endif
@
