info-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: is it possible to close a development branch?


From: chaitu
Subject: Re: is it possible to close a development branch?
Date: Thu, 16 Oct 2008 23:48:59 -0700 (PDT)
User-agent: G2/1.0

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]