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

Re: pre-commit hook

From: Juanma Barranquero <jmbarranquero_at_wke.es>
Date: 2004-03-18 09:58:33 CET

On Thu, 18 Mar 2004 09:15:39 +1000
"Richard J. Moore" <richardm@debtorsoftware.com.au> wrote:

> My understanding is that all I need to do is have a file called
> pre-commit.(bat,exe,vbs, etc...) in the repository at ... \_svn\hooks.

Only .exe, .cmd, and .bat, although there was some thought into using
%PATHEXT% to determine which extensions to allow.

> The pre-commit.* file then get called with two arguments ([1] REPOS-PATH
> (the path to this repository) and [2] TXN-NAME (the name of the txn
> about to be committed)).

Yes.

> I've tried to do a little test file where all it does is take the
> arguments and append them to a text file, but without much luck.

I think you're being bitten by the fact that you cannot rely on the
current working directory being hooks/. Try setting explicitly the
current directory on you pre-commit hook, or else use a full path when
pointing to the text file.

Something like:

@ECHO OFF
ECHO REPOS-PATH = %1 >> c:\my.log
ECHO TXN = %2 >> c:\my.log

should work (and in fact does, in my setup).

                                                                Juanma

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Mar 18 09:59:59 2004

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.