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

RE: post-revprop-change Hook Script

From: Meeran, Noorie <Noorie_Meeran_at_cable.comcast.com>
Date: 2006-01-27 20:21:29 CET

I only have the #!/usr/local/bin/perl and a print "hello"; statement in the post-revprop-change. When I run it with env -i ./post-revprop-change , the script executes and hello is printed to the screen.

When I try to commit some file, my commit fails. Is there any other way to debug this problem. Is there any error log files or anything that is created somewhere! help please.

-----Original Message-----
From: Ryan Schmidt [mailto:subversion-2006Q1@ryandesign.com]
Sent: Fri 1/27/2006 5:25 AM
To: Meeran, Noorie
Cc: users@subversion.tigris.org
Subject: Re: post-revprop-change Hook Script
 
On Jan 26, 2006, at 21:46, Meeran, Noorie wrote:

>> you must specify the absolute path to the file, for example:
>>
>> echo hello > /tmp/test
>
> I have written a perl script inside post-revprop-change hook file.
> When I run this perl (hook) script alone, I am able to run it
> without errors. But I am not able to run this script after a
> commit. My filename is still "post-revprop-change" without the .py
> extension.

Probably just a typo, but make sure you're not confusing Perl (.pl)
and Python (.py).

As Chris said, make sure the first line of the script points to the
proper interpreter, as in "#!/usr/bin/perl" or "#!/usr/bin/python".

Hook scripts run with an empty environment. This is why you need to
specify absolute paths to things. It can also cause other things to
break. If things work on a normal shell (with its normal environment)
but not when called from Subversion (with no environment) this is
often the reason.

You can simulate this on the shell by calling your script through the
"env" program with the "-i" option to ignore the shell's environment:

env -i ./post-revprop-change

And then thankfully you can see any output the script sends to stdout
or stderr to help you debug the problem.

You can even build this into the first line of the script by writing,
for example, "#!/usr/bin/env -i /usr/bin/perl".

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Jan 27 20:23:33 2006

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.