[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Unable to execute perl hooks

From: roger mills <rogermillsg_at_gmail.com>
Date: Wed, 28 Oct 2009 09:55:58 -0400

Hi

I am new to Subversion so bear with me if this is a stupid question. I am
writing a subversion hook script in perl. The script will check the log
message at commit and get the issue ID (e.g. CNR12345) from the message, if
the issue ID is not found in the log message it will block the commit else
move on and execute some sql query to the issue tracking database. svnlook
fails to get the log message but is successful in getting the author.
#!D:\perl\bin\perl
use strict;
use warnings;

my ($txn_name, $repo_path) = @ARGV;
my $svnlook = "D:\\Subversion\\bin\\svnlook.exe";
my $committer = `$svnlook author $txn_name $repo_path`
    or die("Unable to get committer with svnlook.\n");
chomp($committer);
print "$committer";
my $commitlog = `$svnlook log $txn_name $repo_path`
    or die("Unable to get log message with svnlook.\n");
print "$commitlog";
my ($cnr_number) = $commitlog =~ /^(CNR[0-9]+)/m
   or die("Enter a valid CNR Number\n");
if ($cnr_number != "")
{
do blah blah
}
Can someone tell me what i am doing wrong here

Thanks
Roger

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2412122

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-10-28 14:58:08 CET

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.