info-cvs
[Top][All Lists]
Advanced

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

Re: Locking the branch


From: Dennis Jones
Subject: Re: Locking the branch
Date: Sat, 16 Apr 2005 21:26:43 -0700

"Vijay SP." <address@hidden> wrote in message
news:address@hidden
> I have a requirement to lock a branch just before the release. I tried to
> browse thru the documentation and did get some idea.
> Has someone implemented it?
> If so could you please share the details?

Like Jim said, you can use a tag to identify the files for a release instead
of locking the branch.  But if you still must be able to lock the branch,
for whatever reason, you can implement a pre-commit check in commitinfo to
do that.

Simply write a program or a script that determines whether to allow commits
and have it return a 0 if commits should be allowed, or non-zero if commits
should be disallowed.  Then add the appropriate entry to your commitinfo
file.

I found a perl script a long time ago to help do this for me and then
modified it to meet my needs.  I have no idea where I found the one I
modified, but I am certain you could find it, or something else useful with
just a little time spent on google.

In my case, I have a script called, "branch_commit_test.pl" that accepts
several arguments:

1) the username of the person trying to commit
2) the names of the files being committed
3) a list of branches to lock
4) a list of users allowed to commit even if the branch is locked

Then I have an entry in my commitinfo file that looks something like this:

ALL branch_commit_test.pl -u$USER
%s -lREL_5_0 -lREL_6_0 -adaffyduck -abugsbunny

Whenever commitinfo encounters this line during a commit, it executes the
branch_commit_test.pl script and prevents all users except 'daffyduck' and
'bugsbunny' from committing files to the REL_5_0 or REL_6_0 branches.

- Dennis




reply via email to

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