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