info-cvs
[Top][All Lists]
Advanced

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

commitinfo can't open file being committed


From: Beachey, Kendric
Subject: commitinfo can't open file being committed
Date: Fri, 24 Oct 2003 14:01:11 -0500

I'm starting to do some messing around with commitinfo.  My intent is to
write a perl script that examines the file being committed (which will be
html), noting whether it contains character references (e.g.
ampersand-pound-153-semicolon).  It will suggest changing these to entity
references (e.g. ampersand-trade-semicolon), both in the commit output and
in an email if I can swing that.

Anyway, I've got a simple script going:  (feel free to belittle or suggest
improvements)

-------8<--cut here--8<---------
#!/usr/bin/perl
$message = "commitinfo test\n\n";
$send_mail = 0;

foreach $i (0..$#ARGV)
{
        $message .= "arg $i = $ARGV[$i]\n";
}

$filespec = $ARGV[0] . "/" . $ARGV[1];
$message .= "\n\nfilespec = $filespec\n";

print $message;

open (INPUT, "<$filespec") || die ("Could not open file $filespec : $!\n");

while (<INPUT>)
{
        chop;
        $line = $_;
        if ($line =~ /hey/)
        {
                $send_mail = 1;
                $blurb = "Line $. = <$_>\n";
                $message .= $blurb;
                print $blurb;
        }
}

close (INPUT);

$message .= "\ntest done\n";

print $message;

if ($send_mail == 1)
{
        `/bin/echo "$message"| /bin/mail address@hidden;
}
-------8<--cut here--8<---------


...and I've got commitinfo running this script successfully.  The typical
output is something along these lines:


-------8<--cut here--8<---------
address@hidden dev_testing]$ echo "hey" >> kendrics.commitinfo.test
address@hidden dev_testing]$ cvs commit -m "more testing"
cvs commit: Examining .
commitinfo test

arg 0 = /cvs/internet/docs/dev_testing
arg 1 = kendrics.commitinfo.test


filespec = /cvs/internet/docs/dev_testing/kendrics.commitinfo.test
Could not open file /cvs/internet/docs/dev_testing/kendrics.commitinfo.test
: No such file or directory
cvs server: Pre-commit check failed
cvs [server aborted]: correct above errors first!
address@hidden dev_testing]$
-------8<--cut here--8<---------


>From reading Karl Fogel's book on CVS, I am led to believe the file I am
committing should exist temporarily in the repository so that the script can
open it up and read it.  But it appears this is not happening.  Am I
completely misunderstanding what I should be doing, or is something actually
wrong with the repository config?

--
Kendric Beachey


            ------------------------- 
This e-mail and any attachments may contain confidential material for the sole 
use of the intended recipient.  If you are not the intended recipient, please 
be aware that any disclosure, copying, distribution or use of this e-mail or 
any attachment is prohibited.  If you have received this e-mail in error, 
please contact the sender and delete all copies. 
Thank you for your cooperation 





reply via email to

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