[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 returns 409 failure

From: Maddes <maddes_svnlists_at_arcor.de>
Date: 2007-09-17 22:20:03 CEST

About the 409 error:
I just searched the web a little bit. Have you already read
http://svn.haxx.se/users/archive-2007-03/0880.shtml ?
Maybe updating to 1.4.5 helps.

About the pre-commit hook:
Please look in the man pages for your sh, if your sh shell does not
support "declare" then you can not "add" the errors.
Attached is my typical pre-commit hook script which runs on my Debian
4.0r1 "Etch" server. (/bin/sh is bash here)

Maddes

On 17.09.2007 20:37, Jette Derriche wrote:
> On Sun, 2007-09-16 at 02:48 +0200, Maddes wrote:
>> I now what you are looking for, and it is fairly easy with some
>> scripting knowledge.
>>
>> My pre-commit hook looks like the following on Linux, where I also do
>> all the checks possible and only exit at the end, as I don't want the
>> user to commit and get the first error, commit again and get the second
>> error, and so on, that's why I "add" the errors.
>
> That sounds reasonable...
>
>> declare -i RC_ALL=0
>>
>> # Make sure that the log message contains some text.
>> $SVNLOOK log -t "$TXN" "$REPOS" | \
>> grep "[a-zA-Z0-9]" > /dev/null \
>> || { RC_ALL+=1; echo -e "$0:\nLog message empty!!!\n " 1>&2; }
>>
>> ...
>>
>> # All checks done
>> echo All checks done. RC=${RC_ALL} 1>&2
>>
>> # Enable next line when testing
>> #RC_ALL=999
>>
>> exit ${RC_ALL}
>
> I have incorporated your script into mine... but now I get:
>
> ----------------------
> svn: 'pre-commit' hook failed with error output:
> declare: not found
> RC_ALL+=1: not found
> svn: MERGE of '/path/to/repo/project': 409 Conflict
> (http://svn.example.com)
> ----------------------
>
> My script now looks like this...
>
>
> ----------------------
> #!/bin/sh
> REPOS="$1"
> TXN="$2"
>
> declare -i RC_ALL=0
>
> # Make sure that the log message contains some text.
> SVNLOOK=/usr/local/bin/svnlook
> $SVNLOOK log -t "$TXN" "$REPOS" | \
> grep "[a-zA-Z0-9]" > /dev/null \
> || { RC_ALL+=1 echo -e "$0:\nLog message empty!!!\n " 1>&2; }
>
> # All checks done
> exit ${RC_ALL}
> ----------------------
>
> Any ideas?
>
> /Jette
>
>
>
> ---------------------------------------------------------------------
> 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 Mon Sep 17 22:20:22 2007

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.