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

Need help with pre-revprop-change Hook

From: Michael Knigge <Michael.Knigge_at_SET-Software.de>
Date: 2007-12-05 12:36:44 CET

All,

I've trouble getting a pre-revprop-change Hook Script running. My hook
is written in Perl and it seems to me that I can't read STDIN.

I don't know if this a Subversion issue or a issue of my really bad Perl
skills. Fact is, "$value" (see my source - it should hold STDIN) is
empty when my hook is executed by Subversion - but if I run it by hand,
i. e.

    echo "foo" | pre-revprop-change 1 2 3 4 5

my "$value" is correctly filled....

Any ideas? Thank you so far,
Michael

Here is my hook:

#!/usr/bin/perl

$ENV{'LC_ALL'} = "de_DE.iso885915\@euro";

$rep = shift @ARGV;
$rev = shift @ARGV;
$user = shift @ARGV;
$propname = shift @ARGV;
$action = shift @ARGV;

while (<>) { $value = $value.$_; }

if($action ne "M" or $propname ne "svn:log")
{
    exit(1);
}

if (not substr($value, 0, index($value, ": ")) =~ /^\d+$/)
{
    exit(1);
}

exit(0);

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Dec 5 12:37:25 2007

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.