#!/bin/sh

#
#	Historian's aid: check out ALL versions of a file ($1)
#
#	coALL	creates a directory $1.ALL in which it checks out ALL
#	versions of the file $1. Done to the Makefile, this can help in
#	determining when exactly a file was RM-ed, to faithfully reconstruct
#	the configuration history of the repository.
#
Name=coALL; export Name

# CVSBIN, CVSLIB and RCSBIN directories
CVSBIN=/home/top/dick/cvs
CVSLIB=/home/top/dick/cvs
RCSBIN=${RCSBIN-/usr/local/bin}
export CVSBIN CVSLIB RCSBIN

# avoid spurious identifications
PATH=${CVSPATH-/bin:/usr/bin}; export PATH

# determine the name of the repository
Repository=""
. $CVSLIB/NR.aux

User=$1

set -e
mkdir $User.ALL
cd $User.ALL

$RCSBIN/rlog $Repository/$User,v |
grep '^revision' |
sed 's/revision //' |
while read VN_User
do
	$RCSBIN/co -q -r$VN_User $Repository/$User,v
	mv $User $VN_User
	chmod +w $VN_User
done

