The script and ini file I sent earlier will accomplish what you want. Read
through the ini file (which is well commented regarding each sections
behavior) and configure it as needed. Either comment out all of the
functionality other than the svn:needs-lock section, or update the other
sections to match your access controls, etc..
I call this through a pre-commit script (that you also need to modify for
your installation locations):
#!/bin/sh
REPOS="$1"
TXN="$2"
CWD="/export/svn/scriptlocation"
SVNLOOK="/usr/bin/svnlook"
DEBUG_LEVEL=1 # 0: No debug, >=1: Debug
ACCESS_HOOK="$CWD/pre-commit-access-control-hook.pl"
CONTROL_FILE="$CWD/control-file.ini"
$ACCESS_HOOK -debug $DEBUG_LEVEL -svnlook \
$SVNLOOK -file $CONTROL_FILE -t $TXN $REPOS
exit $?
>when I say never seen one... I mean I looked throughout the archive of
>subversion-users and everyone that asked about svn:needs-lock always gets
>told the same thing "set up your clients to apply svn:needs-lock then use a
>hook script to check that it is applied and reject if it is not" which is
>great advice... however the problem is that whenever anyone has ever asked
>how to actually program a hook script to do just that... everyone points
>them to the SVN book or example scripts but they really do not help for
>hook
>scripts...at least in this case...
>
>so does anyone know of a hook script, that works or has been tested, that
>can check for svn:needs-lock for a pre-commit hook script?
>
>On 11/10/06, Phil <plabonte@gmail.com> wrote:
>>
>>the problem is that I am not a programmer and I have never seen a script
>>posted that can actually do the checking... I tried to find one on google
>>or
>>a "how to program a hook script" one myself (with my limited knowledge)
>>without success...
>>
>>On 11/10/06, Ryan Schmidt <subversion-2006d@ryandesign.com> wrote:
>> >
>> > On Nov 10, 2006, at 12:42, Phil wrote:
>> >
>> > > All I really need is something to set svn:needs-lock on all
>> > > commited files...
>> > > perhaps someone can point me in the right direction?
>> > >
>> > > I am no programmer unfortunately... I am not too interested in
>> > > checking to see if the file has it set or not... I would rather
>> > > just set it to svn:needs-lock for everything...
>> > >
>> > > is this possible at the server end? I know I can do this with auto-
>> > > props at the client side... but that is too risky...
>> >
>> > No, that's really not how it's done in Subversion. There is no way to
>> > force all files to be that way on the server side. The Subversion way
>> > to do it is:
>> >
>> > - Set up the clients to set the property on the desired files, e.g.
>> > with auto-props
>> > - Install a pre-commit hook to reject commits of files that do not
>> > have tho property
>> >
>> >
>>
_________________________________________________________________
Use your PC to make calls at very low rates
https://voiceoam.pcs.v2s.live.com/partnerredirect.aspx
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Sat Nov 11 01:07:27 2006