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

Re: Enforcing locks for the entire repository

From: Troy Curtis Jr <troycurtisjr_at_gmail.com>
Date: 2007-02-01 06:28:11 CET

On 1/31/07, Ryan Schmidt <subversion-2007a@ryandesign.com> wrote:
>
> On Jan 31, 2007, at 16:13, Fedor, Halina ((Mission Systems)) wrote:
>
> > Is there any kind of script that is available that will enforce a
> > repository-level (global) lock/unlock policy? The reason is
> > because one of our planned subversion repositories will contain
> > mostly unmergeable files...In other words, we want the needs-lock
> > property to be applied to the entire repository contents and any
> > new files added to it.
> >
> > I was not sure if the pre-lock-require-needs-lock.py would meet our
> > needs.. The description reads"..verifies that the PATH that USER is
> > attempting to lock has the svn:needs-lock property set on it,
> > returning success if it does"…implies that only files that already
> > have the needs-lock will enable a user to lock it for exclusive
> > use; however, will the needs-lock need to be set manually for each
> > and every new file that gets created or is there an automatic way
> > we can do this via some sort of other script?
> >
> > We are also looking to enforce locks for only certain filetypes for
> > our source code repository. Didn't know if there might also be a
> > way to do this via a script (e.g. any new files that get committed
> > that contain a .pdf, .gif, etc. extension, for example, will
> > automatically have their svn:needs-lock property set to true upon
> > commit).
>
> For both cases, you will need to write a pre-commit hook script that
> rejects the commit of any file that does not have the properties you
> want. You will examine the contents of the in-progress transaction
> using svnlook. For the unmergeable-file repository, your script will
> want to make sure that each and every file has the svn:needs-lock
> property. For the source repository, you will want to limit that
> restriction to just certain filename extensions.
>
>
> --
>
> To reply to the mailing list, please use your mailer's Reply To All
> function
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>
>

You can also instruct your users/developers to configure their svn
client to automatically set that property when you add files. This is
not an enforcement policy, you will still need the pre-commit hook for
that, but it would be more convenient for the users. In fact, you
could include a quick blurb that is output from your hook script when
it fails because the needs-lock property is not set that tells the
user how to set the auto-prop feature.

See "auto-props" at
http://svnbook.red-bean.com/nightly/en/svn.customization.html#svn.advanced.confarea.opts.config
for more information.

-- 
"Beware of spyware. If you can, use the Firefox browser." - USA Today
Download now at http://getfirefox.com
Registered Linux User #354814 ( http://counter.li.org/)
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Feb 1 06:28:36 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.