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

Re: EOL Check Hook Script?

From: David Weintraub <qazwart_at_gmail.com>
Date: Thu, 19 Mar 2009 10:42:06 -0400

Yes it does. The STDERR contains a list of why the hook fails, so this
is returned to the user.

On Thu, Mar 19, 2009 at 10:35 AM, Tsahi Asher <tsahi_75_at_yahoo.com> wrote:
>
> Thanks for the answer. I already have a pre-commit.bat file, which runs pretty good so fare, except for detecting that property on replaced files.
>
> What about the second issue? Does your script exit with a non-zero exit code when one of the rules is not met?
>
> Tsahi
>
>  --
> The day Micro$oft sells something that doesn't SUCK
> is the day they start selling vacuum cleaners.
> http://www.geocities.com/tsahi_75
>
>
>
> ----- Original Message ----
>> From: David Weintraub <qazwart_at_gmail.com>
>> To: Tsahi Asher <tsahi_75_at_yahoo.com>
>> Cc: users_at_subversion.tigris.org
>> Sent: Thursday, March 19, 2009 4:25:38 PM
>> Subject: Re: EOL Check Hook Script?
>>
>> The problem is that I am not that familiar with Windows or the Batch
>> programming language. I also don't have access to a Windows system in
>> order to do some testing.
>>
>> However, when you create a Subversion repository, there's a file
>> called pre-commit.bat.tmpl (or something like that) that's created.
>> You can use this as a template on how to create the pre-commit.bat
>> trigger file you need. That's what I did with the pre-commit shell
>> script that was created.
>>
>> I can't even find the pre-commit.bat.tmpl file in the repository.
>>
>> On Sun, Mar 15, 2009 at 5:39 AM, Tsahi Asher wrote:
>> >
>> > this accidentally almost solved my problem too. i need to enforce
>> svn:needs-lock on .resx files. trying to run this on windows, though, has some
>> side effects.
>> > 1. the -svnlook parameter may receive a value with spaces in it, e.g.
>> "C:/Program Files (x86)/Subversion/bin/svnlook". the script seems to be unaware
>> of this, and as a result, i get a
>> >
>> > "'C:/Program' is not recognized as an internal or external command,operable
>> program or batch file.
>> > The system cannot find the path specified.
>> > The system cannot find the path specified.
>> >
>> > error. the path to svnlook should be sorrounded with quotes or something.
>> >
>> > 2. the example pre-commit file in the zip has this after the call to the
>> script:
>> >
>> > exit $?
>> >
>> > what does it mean? i tried to replace it with
>> >
>> > if not errorlevel 0 exit /b 1
>> >
>> > but it didn't exit the hook script, and continued to run another script the
>> pre-commit hook runs. what is the exit code your script uses when there is a
>> rule violation?
>> >
>> >
>> > i'd be happy if you could fix those problems.
>> >
>> > here's my entire pre-commit.bat, translated to windows syntax:
>> >
>> > set REPOS=%1
>> > set TXN=%2
>> >
>> > set CWD=%REPOS%/hooks
>> > set SVNLOOK="C:/Program Files (x86)/Subversion/bin/svnlook"
>> >
>> > set ACCESS_HOOK=%CWD%/pre-commit-access-control-hook.pl
>> > set CONTROL_FILE=%CWD%/control-file.ini
>> >
>> > rem PRE-COMMIT HOOK
>> >
>> > C:\Perl\bin\perl %ACCESS_HOOK% -svnlook %SVNLOOK% -file %CONTROL_FILE% -t
>> %TXN% %REPOS%
>> >
>> > if not errorlevel 0 (
>> >  echo Goto TortoiseSVN settings ^> Edit button, add the following line to
>> [auto-props]: >&2
>> >  echo *.resx = svn:needs-lock >&2
>> >  echo and make sure you set >&2
>> >  echo enable-auto-props = yes >&2
>> >  exit /b 1
>> > )
>> >
>> > and then it calls some other script, which is run even if the
>> pre-commit-acces-control-hook fails. i do get the error message, e.g.
>> >
>> >  ERROR: Commit failed for the following reasons:
>> >  Property "svn:needs-lock" needed for file
>> "Fantasy.NET/trunk/Fantasy.Presentation/AboutBoxForm.resx".
>> >         Must match string '*'.
>> >
>> > but the commit doesn't stop.
>> >
>> > thanks,
>> > tsahi
>> >
>> > --
>> > The day Micro$oft sells something that doesn't SUCK
>> > is the day they start selling vacuum cleaners.
>> > http://www.geocities.com/tsahi_75
>> >
>> >
>> >
>> > ----- Original Message ----
>> >> From: Bob Proulx
>> >> To: users_at_subversion.tigris.org
>> >> Sent: Friday, March 13, 2009 9:30:40 AM
>> >> Subject: Re: EOL Check Hook Script?
>> >>
>> >> David Weintraub wrote:
>> >> > ou can download the hook script here:
>> >> >
>> >>
>> >> Cool stuff.  Thanks for sharing!
>> >>
>> >> Bob
>> >
>> >
>> >
>> >
>> >
>>
>>
>>
>> --
>> --
>> David Weintraub
>> qazwart_at_gmail.com
>
>
>
>
>

-- 
--
David Weintraub
qazwart_at_gmail.com
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1355764
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-03-19 15:47:44 CET

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.