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

Re: hook script basics

From: Ryan Schmidt <subversion-2007b_at_ryandesign.com>
Date: 2007-08-02 02:37:31 CEST

On Aug 1, 2007, at 18:27, Brian Krusic wrote:

> On Aug 1, 2007, at 3:47 PM, Ryan Schmidt wrote:
>
>> On Aug 1, 2007, at 16:19, Brian Krusic wrote:
>>
>>> I've implemented a few hook scripts in the past; checking case,
>>> forcing log messages and sending emails about the commits.
>>>
>>> However it appears I just implemented this stuff w/o
>>> understanding it.
>>>
>>> * problem *
>>>
>>> I have a simple post-commit.bat file which contains commands I
>>> want to call.
>>>
>>> In my case the contents of the post commit is;
>>>
>>> @echo off
>>> C:\Progra~1\Subversion\bin\svn update --username foo --password
>>> bar --no-auth-cache F:\Jobs\Cooljob
>>>
>>>
>>> The F:\Jobs\Cooljobs is the local dir that sits on the repo
>>> server itself as I checked out the repo on the same PC.
>>>
>>> The username/pass is used for example only.
>>>
>>> The file works if I exe it from a cli on the repo server but not
>>> when I commit from another PC.
>>>
>>> I expect it to work like so;
>>>
>>> 1 - User commits a file from some workstation.
>>> 2 - Repo executes the post commit which updates a checked out
>>> copy on the server itself.
>>
>> Should work, provided you're checking out via http(s) or svn
>> (+ssh). Not sure how it is on Windows, but on UNIX, you'd also
>> need to make sure that the permissions of F:\Jobs\Cooljobs are
>> such that the user under which your repository is served is
>> allowed to modify that directory.
>
> Is there any thing else I am missing?
>
> Any error log I can check?
>
> Apache logs show no errors.
>
> When I run the post-commit.bat from the command line, it does
> work. Its as though the post-commit.bat isn't being tickled or I
> cannot see the error.

There is no hook script error log. If you want something logged, you
must do it yourself in your hook script.

Try a minimal hook script that does nothing other than appending
something to a logfile, stored in a location you know everyone has
write access to. On UNIX I would suggest the /tmp directory; I'm sure
there's an equivalent on Windows.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Aug 2 02:36:53 2007

This is an archived mail posted to the Subversion Users mailing list.