Following can be used to prevent developers check in any file by accident when the source tree is ready for a release.
First, create a new directory $CVSROOT/CVSROOT/Freeze to keep the files for tree freeze. Each file is for a either a HEAD (at trunk) or branch. Following function check if the current tree is under freeze policy before perform the commit or import commands. This cvs function can be part of profile, so once the user login the system, it is loaded right away.
cvs ()
{
# check for code freeze
if [ "$1" = commit -o "$1" = import ]; then
if [ ! -f "CVS/Repository" ]; then
echo "Cannot find CVS/Repository.Please check
you current directory."
return 1
fi
if [ -f CVS/Tag ]; then
CVSTAG=`cat CVS/Tag | sed -e 's/.//'`
if [ -f $CVSROOT/CVSROOT/Freeze/$CVSTAG ]; then
echo "Sorry. Code freeze for the branch
$CVSTAG."
return 2
fi
elif [ -f $CVSROOT/CVSROOT/Freeze/HEAD ]; then
echo "Sorry. Code freeze for the main trunk."
return 3
fi
fi
command cvs "$@"
}
Time Stamp for Tags or Branches
The "cvs log" command displays the tag and branch names with the revision of the file without date information.
To have a clear history for tags, create a tag history file in $CVSROOT/CVSROOT/logs/tags.history. Put following lines in the release script to append the tag to the history with the date information. To create new branch, a similar script can be created.
HISTORY=$CVSROOT/CVSROOT/logs/tags.history
cvs tag $1 source database document tools buildlogs
echo "Tagged $1 source, database, document, tools, and \
buildlogs at `date`" | tee -a $HISTORY