You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Manuel Vázquez Acosta <mv...@gmail.com> on 2006/12/06 16:26:53 UTC

A little problem with post-commit hook

Hi all,

I'm setting up a repository for which I need to do a post-commit that
check out the just committed revision so I can grab some files and
process them. Here is my current post-commit script:

#!/bin/bash
REPOS="$1"
REV="$2"
logger "post-commit called with $REPOS#$REV"
REPOS_URL="http://localhost/svn-meta"
TEMPNAME=/tmp/svn-meta.$REV
svn co -r $REV "$REPOS_URL" "$TEMPNAME"
# Then process the files is $TEMPNAME
...

However, it seems that svn co can't be executed at this point. Am I
right? Should I defer a little bit the execution of svn co?

The later processing shows that $TEMPNAME is not being created.

Any ideas?

Manuel.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: A little problem with post-commit hook

Posted by Nathan Kidd <na...@spicycrypto.ca>.
Manuel Vázquez Acosta wrote:
> On 12/6/06, Nathan Kidd <na...@spicycrypto.ca> wrote:
>> Unless you allow anonymous checkouts you might also want to set up
>> explicit authentication paramters.
>>
> 
> That's the catch! I don't allow anonymous checkouts. But I can trust
> some IPs in network to do that anonymously anyway.

Why not use a file:// url instead of HTTP -- assuming this script is 
executing on the svn server.

-Nathan

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: A little problem with post-commit hook

Posted by Nathan Kidd <na...@spicycrypto.ca>.
Manuel Vázquez Acosta wrote:
> Here is my current post-commit script:
> 
> #!/bin/bash
> REPOS="$1"
> REV="$2"
> logger "post-commit called with $REPOS#$REV"
> REPOS_URL="http://localhost/svn-meta"
> TEMPNAME=/tmp/svn-meta.$REV
> svn co -r $REV "$REPOS_URL" "$TEMPNAME"
^^^^^^^^^^^^^^

> However, it seems that svn co can't be executed at this point. Am I
> right? Should I defer a little bit the execution of svn co?

You can't rely on hook scripts inheriting any path.  Use an explicit 
path for svn, like '/usr/bin/svn co ...' or similar.

Unless you allow anonymous checkouts you might also want to set up 
explicit authentication paramters.

-Nathan

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org