You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Ravi Roy <ra...@gmail.com> on 2010/06/07 05:01:33 UTC

Setting auto-props from Server side ?

Hi,

Just curious if there is a way out to set auto-props for certain binary
files on server side ? I know, it is can be set on Client like TortoiseSVN.

I am using Subversion 1.6.1 on CenOS 5.2 with  APR 1.2.7.

Thanks.

Regards
-RR

Re: Setting auto-props from Server side ?

Posted by Hyrum Wright <hy...@hyrumwright.org>.
On Mon, Jun 7, 2010 at 12:01 AM, Ravi Roy <ra...@gmail.com> wrote:

> Hi,
>
> Just curious if there is a way out to set auto-props for certain binary
> files on server side ? I know, it is can be set on Client like TortoiseSVN.
>

This feature (and similar ones) are bandied about as "repository-dictated
config", and are on the roadmap:
http://subversion.apache.org/roadmap.html

There are preliminary design documents here:
http://svn.apache.org/repos/asf/subversion/trunk/notes/repos-dictated-config

There is a current development timeline, as most of the developers are
working hard on getting 1.7 shipped.  Help is always appreciated, though. :)

-Hyrum

Re: Setting auto-props from Server side ?

Posted by km...@rockwellcollins.com.
Ravi Roy <ra...@gmail.com> wrote on 06/07/2010 12:22:52 AM:
> On Mon, Jun 7, 2010 at 10:41 AM, Ryan Schmidt 
<subversion-2010b@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.

Re: Setting auto-props from Server side ?

Posted by Ravi Roy <ra...@gmail.com>.
On Mon, Jun 7, 2010 at 10:41 AM, Ryan Schmidt <
subversion-2010b@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.

Regards,

-RR

Re: Setting auto-props from Server side ?

Posted by Ryan Schmidt <su...@ryandesign.com>.
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.


Re: Setting auto-props from Server side ?

Posted by Lorenz <lo...@yahoo.com>.
Ravi Roy wrote:
>Just curious if there is a way out to set auto-props for certain binary
>files on server side ? I know, it is can be set on Client like TortoiseSVN.

auto-props are a client side configuration that's shared by all
subversion clients (TSVN only provides a GUI for that task). 

You could put the relevant config file under version control though.
That won't give automatic propagation of changes, but at least you
only have to do an update on the client to get the actual settings (no
manual fiddeling in config files)
-- 

Lorenz