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

Re: preventing commits (this is *not* a classic hook question)

From: Lorenz <lorenznl_at_yahoo.com>
Date: Tue, 20 Mar 2012 16:14:56 +0000

Bob Archer wrote:

>> Hello,
>>
>> I'm wondering if there is any strategy for temporary preventing people from
>> committing to a svn repository, without the person who sets the hook (or sth
>> similar) being the admin of the svn repository. Thus, in this case, there is no
>> option to directly access the /hooks/ folder.
>
>Create a project in your repository that contains a config file of some type.
>Give write access to this path only to those people that you want to be able to
>enable/disable checkins.
>
>Create a working copy of said config project and check it out on your svn server.
>Have your hook script update the working copy (or perhaps have a cron job that
>updates this wc every 60 seconds or whatever) and read this config file to
>determine if commits are allowed.
>
>All the users will have to do is edit the config file and commit it.

slight modification to that solution:

Create a revprop in revision 0 in your repository that contains a the
block/noblock information
Give write access to this revprop only to those people that you want
to be able to enable/disable checkins.

Have your hook script check this revprop to determine if commits are
allowed.

All the users will have to do is edit the revprop (no commit
required).

Original version has the side benefit of providing an audit trail for
the configuration changes.

-- 
Lorenz
Received on 2012-03-20 17:13:55 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.