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

Re: Setting auto-props from Server side ?

From: <kmradke_at_rockwellcollins.com>
Date: Mon, 7 Jun 2010 12:42:19 -0500

Ravi Roy <ravi.aroy_at_gmail.com> wrote on 06/07/2010 12:22:52 AM:
> On Mon, Jun 7, 2010 at 10:41 AM, Ryan Schmidt
<subversion-2010b_at_ryandesign.com
> > wrote:
> On Jun 7, 2010, at 00:01, Ravi Roy wrote:
>
> > Just curious if there is a way out to set auto-props for certain
> binary files on server side ?

> No, there isn't, not a supported way, anyway.
>
> This has come up countless times on the mailing list before. I'm
> sure you can find the discussions in the archives at
http://svn.haxx.se/users/
>
> The strategy I recommend is to install a pre-commit hook that
> rejects commits that do not conform to your guidelines (regarding
> properties or otherwise). Also install a Subversion config file on
> each client to automat the setting of properties that match your
guidelines.
>
> The other strategy is to write a post-commit hook that sets the
> properties you require. However this is not recommended because it
> means the server has to manage a working copy. It also means if a
> client commits a file that doesn't have the properties, the server
> will add them, and then the client's file will be immediately out of
> date and the user will have to run "svn up" to get the update from
> the server. The user won't expect to need to do this so this will be
> confusing to the user.
>
> Thanks Ryan for quick reply. I would check this throug pre-commit hook.
 
A post-commit example to automatically add the needs-lock property is
available at:

http://svn.apache.org/repos/asf/subversion/trunk/contrib/server-side/add-needs-lock.py

It does not require a server side working copy but does need access to
the python bindings. As Ryan said, it isn't recommended to have
the server create new revisions because of the potential user confusion
that can result from newly added files becoming instantly out of date.

Assuming your PYTHONPATH environment already includes the path
to the Subversion python bindings, the post-commit on unix would need to:

/path/to/hook/scripts/add-needs-lock.py -r $2 $1

Kevin R.
Received on 2010-06-07 19:42:59 CEST

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.