[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: Andy Levy <andy.levy_at_gmail.com>
Date: Wed, 13 May 2009 11:28:19 -0400

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=2239324

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-05-13 17:29:26 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.