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

Re: pre commit trigger

From: Irfan Sayed <irfu.sayed_at_gmail.com>
Date: Wed, 13 May 2009 21:22:16 +0530

Ok but now how should i fix the issue.
i modified the code as :

#!/usr/bin/perl

$svnlook = "/usr/bin/svnlook";
$ARGV[0]= $1;
$ARGV[1]=$2;

chomp($repo = $ARGV[0]);
chomp($txn = $ARGV[1]);

$option = "-t";
print STDERR "$txn\n";

my @cmd = `$svnlook changed $option $txn $repo`;
foreach(@cmd)
{
 if ($_ =~/^A/)
{
 print STDERR "added\n";
 exit 1;
}
else{
 print STDERR "hi\n";
 print STDERR "not added\n";
 exit 1;
}

}

now i am able to commit
but i am not able to see any print output which i mention in foreach
loop. i modified the code so it should print "not added" in the
console output

please advise
regards
irf

On Wed, May 13, 2009 at 8:58 PM, Andy Levy <andy.levy_at_gmail.com> wrote:
>
> On Wed, May 13, 2009 at 11:22, Irfan Sayed <irfu.sayed_at_gmail.com> wrote:
> > thanks really for reply.
> > Ok.
> >
> > Now script is executing but it is giving transaction id instead of
> > path which is being commited
> >
> > here is the script
> > #!/usr/bin/perl
> >
> > $svnlook = "/usr/bin/svnlook";
> > chomp($repo = $ARGV[0]);
> > chomp($txn = $ARGV[1]);
> >
> > $option = "-t";
> > print STDERR "$txn\n";
> >
> > my @cmd = `$svnlook changed $option $txn $repo`;
> > foreach(@cmd)
> > {
> > if ($_ =~/^A/)
> > {
> > print STDERR "added\n";
> > exit 1;
> > }
> > else{
> > print STDERR "not added\n";
> > exit 1;
> > }
> > }
> >
> >
> > and the output which i got in tortoise svn client is
> >
> > Commit failed (details follow):
> > Commit blocked by pre-commit hook (exit code 1) with output:
> > 127-4b
> > not added
>
> You're getting exactly what you should be getting. Look at your source:
>
> > chomp($repo = $ARGV[0]);
> > chomp($txn = $ARGV[1]);
> >
> > $option = "-t";
> > print STDERR "$txn\n";
>
> > i am modifying existing source code file so in foreach loop first
> > condition will fail. now in this output "127-4b" is the transaction id
> > but what i am expecting here is the path which is getting commited
>
> You're expecting the path being committed but your code is outputting
> the transaction ID.

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

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-05-13 17:53:48 CEST

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.