#!/bin/sh
#
# chkrcs - check if files in a tree are checked in in rcs and have a PchId
#	   line.
#
# Created:	November 1995 by Philip Homburg <philip@cs.vu.nl>

if [ "$#" -eq 0 ]
then
	set -- .
fi

for i
do
	find "$i" '(' -name RCS -prune -a -type f ')' -o -type f |
	while read a
	do
		# RCS IDs went out of fashion
		#grep -q "\$PchId.*\$" "$a" ||
		#{
		#	echo "$a -- no \$PchId\$."
		#	continue
		#}
		rcsdiff -q -c "$a" >&2 ||
		{
			echo "$a -- not checked in."
			continue
		}
		if [ X`rlog -L -R "$a"` != "X" ]
		then
			echo "$a -- is locked."
			continue
		fi
	done
done
