[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: Richard Moore <moorerad_at_iinet.net.au>
Date: 2004-03-18 13:35:54 CET

Juanma

Thanks for the help, you got over this hurdle.

Richard Moore

-----Original Message-----
From: Juanma Barranquero [mailto:jmbarranquero@wke.es]
Sent: Thursday, 18 March 2004 18:59
To: users@subversion.tigris.org
Subject: Re: pre-commit hook

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

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Mar 18 13:37:32 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.