Re: is it possible to close a development branch?

chaitu <[email protected]>
Newsgroups gmane.comp.version-control.cvs.general
Organization http://groups.google.com
Message-ID <afcc9026-e09e-4723-8273-538f40bfc040@p31g2000prf.googlegroups.com>
Hi Sam,

In the commitinfo script at the CVS server, you could check for the
branch on which the commit is being requested and reject it. This is
how I did it.

# cd <path to CVSROOT>
# ls
cas           commitinfo  CVS        cvswrappers  handle_tag.sh
loginfo  notify   readonly_branch_list  taginfo              verifymsg
checkoutlist  config      cvsignore  editinfo     is_log_ok.sh
modules  rcsinfo  readonly_check        validate_checkin.sh
#
# cat readonly_branch_list
BRANCH1
BRANCH2
...
...
#
# cat readonly_check

#!/bin/sh

# simple check to prevent check ins to "closed" branches

READONLY_BRANCH_LIST="$1/CVSROOT/readonly_branch_list"

if [ ! -f $READONLY_BRANCH_LIST ] ; then
         exit 0
fi

BRANCHES=`cat CVS/Entries | cut -d'/' -f6 | sed -e "s/^T//g" | sed -e
"s/^$/HEAD/g"`

for branch in $BRANCHES ; do
         READONLY=`grep -e $branch $READONLY_BRANCH_LIST`
         if [ "" != "$READONLY" ] ; then
                  echo -e "\n\n **** Branch $branch is read only *** \n
\n";
                  exit 1
         fi
done

exit 0

#
# cat commitinfo

# The "commitinfo" file is used to control pre-commit checks.
# The filter on the right is invoked with the repository and a list
# of files to check.  A non-zero exit of the filter program will
# cause the commit to be aborted.
#
# The first entry on a line is a regular expression which is tested
# against the directory that the change is being committed to,
relative
# to the $CVSROOT.  For the first match that is found, then the
remainder
# of the line is the name of the filter to run.
#
# If the repository name does not match any of the regular expressions
in this
# file, the "DEFAULT" line is used, if it is specified.
#
# If the name "ALL" appears as a regular expression it is always used
# in addition to the first matching regex or "DEFAULT".
ALL /src/CVSROOT/readonly_check %r
ALL /src/CVSROOT/validate_checkin.sh %r/%p %s
ALL sh $CVSROOT/CVSROOT/cas/bin/replock/LockRepos.sh $USER %r/%p
#

That's pretty much it. It works for me. You could try and let us know!

-Chaitanya
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.