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

RE: Re: hook script basics

From: Brian E. Fox <brianf_at_reply.infinity.nu>
Date: 2007-08-05 16:21:20 CEST

On windows, the hooks are executed with no env set. This means you need
to define any vars that are expected inside you bat file. It is also why
something may work when you run it manually but not as a hook.

 

From: Brian Krusic [mailto:brian@krusic.com]
Sent: Wednesday, August 01, 2007 10:19 PM
To: Ryan Schmidt
Cc: users@subversion.tigris.org
Subject: Re: hook script basics

 

Hi Ryan,

 

In the post-commit file, I only have del f:\temp\foo

 

... which worked upon committing a file.

 

I then placed;

 

svn info f:\jobs\cooljobs >> c:\temp\foo.txt

 

.. and it worked.

 

Why isn't svn update working while as a post hook? i did choose to
cache creds to simplify things. It does work as a stand alone batch
file.

 

-Brian

 

On Aug 1, 2007, at 5:37 PM, Ryan Schmidt wrote:

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.

 

 

 

 

 

 
Received on Sun Aug 5 16:20:02 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.