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

Re: Having a problem with pre-commit hook parameters

From: Milen A. Radev <milen_at_radev.net>
Date: Tue, 21 Oct 2008 18:35:41 +0300

2008/10/21 David Moll <davermoll_at_gmail.com>:
> Hi,
>
> I'm trying to set up a pre-commit hook script in TortoiseSVN that will
> only allow a commit if the comment matches a regex. Unfortunately I'm
> not even getting to the point where I can test the script. Here's
> what's happening. I grabbed the script posted on
> http://www.anujgakhar.com/2008/02/14/how-to-force-comments-on-svn-commit/
> and modified it so the findstr uses Windows pseudo-regex to look for a
> certain string.
>
> @echo off
> ::
> :: Stops commits that have empty log messages.
> ::
>
> @echo off
>
> setlocal
>
> rem Subversion sends through the path to the repository and
> transaction id
> set REPOS=%1
> set TXN=%2
>
> rem check for an empty log message
> svnlook log %REPOS% -t %TXN% | findstr . > nul
> if %errorlevel% gtr 0 (goto err) else exit 0
>
> :err
> echo. 1>&2
> echo Your commit has been blocked because you didn't give any log
> message 1>&2
> echo Please write a log message describing the purpose of your changes
> and 1>&2
> echo then try committing again. -- Thank you 1>&2
> exit 1
>
> svnlook: Can't open file 'C:\DOCUME~1\dmoll\LOCALS~1\Temp\svn67.tmp
> \format': The system cannot find the path specified.
>
> My working copy is C:\Source\externalTest
> The repository is at C:\SVN
>
> I've looked at the four arguments passed into the script and none of
> them would work with the svnlook log command. It seems like the path
> passed in as the repository path should not be some temp file buried
> in my local settings directory.
>
> I did set the repository up using Tortoise, I don't know if that makes
> a difference.

It should not matter. And I can't reproduce it here (creating local
repository with TSVN and all).

You may get more help asking on the general subversion mailing list
(users at subversion.tigris.org).

-- 
Milen A. Radev
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_tortoisesvn.tigris.org
For additional commands, e-mail: users-help_at_tortoisesvn.tigris.org
Received on 2008-10-21 17:35:51 CEST

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