[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: Ryan Schmidt <subversion-2006Q1_at_ryandesign.com>
Date: 2006-01-27 11:25:56 CET

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 11:30:17 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.