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

Re: post-commit question

From: Ryan Schmidt <subversion-2007b_at_ryandesign.com>
Date: 2007-09-20 23:39:57 CEST

On Sep 19, 2007, at 08:01, Jeff Lanzarotta wrote:

> I have a post-commit script that looks like this:
>
> --------------------8<---------------------
>
> export PYTHONSTARTUP=/etc/pythonstart
> export PYTHONPATH=$PYTHONPATH:/usr/local/lib/svn-python
>
> REPOS="$1"
> REV="$2"
>
> /usr/local/bin/svn update /mnt/LatestAndGreatest/
>
> /usr/bin/python $REPOS/hooks/mailer.py commit "$REPOS" "$REV"
> $REPOS/hooks/mailer.conf
>
> --------------------8<---------------------
>
> As you can see, it is a simple script. It is suppose to
> automatically update the LatestAndGreatest working copy of the
> repository and email information to the needed recipients.
>
> The problem I am having is that the call to 'svn update' hangs. I
> can execute the post-commit script on it's own, and it will update
> the LastestAndGreatest working copy just fine. But, when the post-
> commit script is executed via SVN, it hangs. I have executed the
> script as myself, root, as well as the svn user and it works every
> time. Just not via SVN...

My guess would be that, when you run this at the command line, your
cached repository credentials are used, but when run as a hook, there
are no cached credentials, so it's hanging while prompting you for a
username or password. You should probably add --non-interactive to
the svn update command in any case, since interactivity is not
possible from within scripts.

Permissions problems, as others have suggested, are possible too.
It's hard to know without seeing what output, if any, the svn command
is producing. You should log it to a file, like this:

/usr/local/bin/svn update \
--non-interactive \
/mnt/LatestAndGreatest \
>/tmp/post-commit-stdout.log \
2>/tmp/post-commit-stderr.log

Then check the logs and see what's in them.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Sep 20 23:41:51 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.