#! /bin/sh
#
# (C) Copyright IBM Corp. 2001
#
#$Id: prepareCommit,v 1.5 2003/08/13 20:37:01 pfs-oss Exp $
#
# @author Stephen Fink
#
# Run this script from a directory in your CVS shadow.  This script
# emits a file, 'doit', holding the skeleton of a bunch of cvs commit
# commands to update the master repository according to the changes you've
# made.  You will need to edit the file to insert your own log message.
#
# You will need to update the cvs path, below
if [[ $RVM_HOST_CONFIG = "" ]]; then
   echo "$0: please set your RVM_HOST_CONFIG environment variable (eg. $HOME/rvm/config/i686-pc-linux.watson)"
   exit 1
fi

. $RVM_HOST_CONFIG
echo "#! /bin/sh" > doit
echo "cvs=$CVS" >> doit

$CVS -q -n update -Idoit -I\*.class -I\*.html -I\*.gif $* | \
grep -v "^[UP]" | \
sed -e 's/^M /\$cvs commit -m "MSG" /' |\
sed -e 's/^A /\$cvs commit -m "Initial Revision" /' |\
sed -e 's/^R /\$cvs commit -m "deleted" /' >> doit
chmod u+x doit
