Thank you!  I swore I saw this done before with stock CVS in a
previous life.

By inspection of your perl code, it tells me the CVS/Entries file
gets copied to the temporary directory on the server side for a
given request, and subsequently available for the commitinfo script
to read.  This is exactly the bit of information that is needed in
order to do this.

To be sure I understood this, I looked in the CVS sources and
found the server.c server_write_entries() function, and there it
was.  And I had already gone and reluctantly modified CVS to do
what I thought it was lacking (instead the lacking was my failing
memory).

It also gave me an appreciation and a hint for how CVS was once
split into its client and server halves.  I hadn't looked at
server.c, I was working in commit.c, tag.c, rtag.c, etc.

Like Marc Poinot, we also have the desire to create a branch
control mechanism.  Our system is written in Perl and back-ended
by a MySQL database.  It is not completely done, and now I need
to retro fit some changes in order to use stock CVS.  A little
extra work, but I'm much happier to follow stock CVS.

wade


Laird Nelson wrote:
...
> Attached is a script that I wrote on my own time that we (occasionally)
> use to protect the trunk/mainline from unauthorized access.
> 
> ...
> 
> # Get our current location (somewhere like /tmp/cvsserver_23897).
> my $cwd = &fastcwd();
> 
> ...
>
> # See what files are being committed at the moment and figure out what their
> # old revision numbers are.  We do this by looking in $cwd/CVS/Entries, which
> # should be parseable.  The format of this file is defined by CVS.  This works
> # for cvs v1.10 and later at least and is untested for earlier versions.
> open(FILE, "$cwd/CVS/Entries") or die "*** Cannot open $cwd/CVS/Entries: $!\n";
> my %entries;
> while (<FILE>) {
>     next if /^D/os; # skip lines starting with D--these are directories, right?
>     next if /^\s*$/os; # skip whitespace
>     if (m!^\s*/(.*?)/(.*?)/!os) { # $1 is filename; $2 is revision
>         $entries{$1} = $2;
>     }
> }
> close(FILE);
> 
> ...

Reply via email to