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

Re: Pre-commit script for Windows - Require log msg

From: Nathan Kidd <nathan-svn_at_spicycrypto.ca>
Date: 2006-11-14 23:52:41 CET

[Please correspond using the users@subversion.tigris.org list.]

amorgovsky@deloitte.com wrote:
> Hi. I am getting the following when trying to run it.
>
> Commit failed
>
> MERGE request failed on '....' The filename, directory name, or
> volume label syntax is incorrect.
>
> Then, I see your message about the commit being not allowed. Now,
> here is a part of your script, and I modified the SVNLOOK part. I am
> not sure what is wrong, I appreciate any help in advance. Thanks.
>
> set "REPOS=%~1" set "TXN=%~2"
>
> set SVNLOOK="\"C:\\Program Files\\Subversion\\bin\\svnlook.exe\"";

It cannot work like that. Did you copy the setting from a perl script?
All those quotes and backslashes are not interpreted in a batch script.

Instead try:

set SVNLOOK="C:\Program Files\Subversion\bin\svnlook.exe"

-Nathan

> Nathan Kidd wrote:
>> Young, Jason (GE Infrastructure) wrote:
>>> Does anyone have a pre-commit script for Windows that requires a
>>> log message to be entered? I know about the one included with
>>> subversion, but I would like something that runs direct if
>>> possible.
>> Try the attached. (You'll need to set %SVNLOOK%. (I actually use a
>> variant of this, with grep, which allows easy checking things like
>> a single space.)
>>
>>> For that matter, is there a site that has a collection of hook
>>> scripts for Windows?
>> I don't know of any, but I'm sitting on a number of patches for
>> mailer.py and case-insensitive.py, making them work properly on
>> win32 and with 1.2.x python bindings. I don't have time right now
>> to submit proper patches to dev@ but if you're interested I can
>> post the full versions somewhere.
>>
>> -Nathan
>>
>>
>> @echo off :: :: check-empty-log.cmd - Stops commits that have empty
>> log messages. ::
>>
>> setlocal
>>
>> set "REPOS=%~1" set "TXN=%~2"
>>
>> :: Make sure that the log message contains some text. for /f
>> "tokens=*" %%i in ('%SVNLOOK% log -t "%TXN%" "%REPOS%"') do set
>> "LOGMSG=%%i" if not "%LOGMSG%"=="" exit 0
>>
>> 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, Your Loving Admins. 1>&2 exit 1

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Nov 14 23:51:14 2006

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.