info-cvs
[Top][All Lists]
Advanced

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

Re: Intelligent commit triggers


From: Hans Schwaebli
Subject: Re: Intelligent commit triggers
Date: Fri, 27 Jul 2007 06:54:33 -0700 (PDT)

I will try it, thanks.


Dennis Jones <address@hidden> wrote:

"Todd Denniston" wrote in message
news:address@hidden
> Hans Schwaebli wrote, On 07/26/2007 09:00 AM:
>> In CruiseControl I can use something like this:
>>
>>
>>
>>
>>

>>
>> >> cvsroot=":pserver:address@hidden:/cvs"
>> />
>>

>>

>>

>> Our CVS administrator managed to write a trigger which touches a file
>> whenever something is comitted into the CVS repository.
>> But this does not distinguish into which branch something is checked
>> in.
>> Since we have two branches, one for active development line and one
>> for release line, and thus two builds, we need a trigger which
>> distinguishes on which branch something is checked in.
>> If something is checked into the active development line branch, then
>> file A has to be touched, if something is checked into release line, file
>> B has to be touched.
>> This seems to be very basic needs, but also very in-depth knowledge of
>> CVS and Linux batch scripting needed, which I don't have.

It's actually not all that hard to do (I should know, because I do it, and I
know as little about Unix as possible!). Here's how *I* do it:

1) Use loginfo to send commits to a formatting script (in my case, named
logformat.sh):

DEFAULT /repository/utils/logformat.sh $CVSROOT/commitlog $USER %{sv}

2) Use logformat.sh to format and send the formatted commit information to a
log file:

LOGFILE=$1
USER=$2
REVINFO=$3

cat > tmp
(echo "------------------------------------------------------------";
echo -n $USER" ";
date;
echo;
echo $REVINFO;
echo;
cat tmp) >> $LOGFILE
cat tmp | /repository/utils/LogBranch $CVSROOT
rm tmp
chmod 666 $CVSROOT/branch.build

3) You will note that the script pipes its output through a program called,
"LogBranch". LogBranch is just a C program I wrote to parse the commit
information and look for the text, "Tag:". If it finds "Tag:", then the
file was committed on a branch, and the branch name will follow "Tag:". If
there is no "Tag:" in the commit text, then the file was committed on the
trunk. In my case, LogBranch writes the branch names to another file
called, "branch.build." At the end of the day, all branches on which
commits occured are listed in the branch.build file, and my nightly
automated build process can iterate through the list and build them.

Does this help?

- Dennis




Sick sense of humor? Visit Yahoo! TV's Comedy with an Edge to see what's on, when.
reply via email to

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