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

Re: pre-revprop-change

From: Ryan Schmidt <subversion-2008a_at_ryandesign.com>
Date: Thu, 28 Feb 2008 16:46:24 -0600

On Feb 28, 2008, at 08:53, Nathan Nobbe wrote:

> On Thu, Feb 28, 2008 at 2:36 AM, Ryan Schmidt wrote:
>
>> First of all, it's called "svn:eol-style" (not "eol:style").
>
> good catch there.
>
>> Second, it's a file property, not a revision property. You do not
>> need a pre-revprop-change hook, because you're not going to be
>> changing a revision property.
>
> i dont see anything here that specifically says, svn:eol-style
> cannot be used as a revision property
> http://svnbook.red-bean.com/en/1.0/ch07s02.html

There's also nothing there that says svn:eol-style cannot be used to
bring about world peace but I don't think it would help that
either. :) Do note that you're looking at the obsolete version of the
book for Subversion 1.0. This is the book for Subversion 1.4 which I
think separates the two types of properties better:

http://svnbook.red-bean.com/en/1.4/svn.ref.properties.html

Some of the built-in Subversion properties only work as revision
properties. The others only work as versioned properties. None of
them work as both.

>> Go to a working copy and set the svn:eol-style property of the file
>> whose line endings you want to specify. For example:
>>
>> cd working-copy
>> svn propset svn:eol-style native foo.txt
>> svn ci -m "foo.txt: setting svn:eol-style to native"
>
> i must have some disconnect regarding usage of these properties..
> is there no way to say, i want all files in this repository,
> beneath this
> directory to have their eol managed by the subversion?

Not by setting just one property, no.

> what about new files? if i create a file and add it to the
> repository,
> without specifying the svn:eol-style property on it, will the eol
> style
> on the file not be managed by the repository?

Nope.

> thats ridiculous,
> considering users may be creating files on their own.. thats
> asking users to get involved in administration tasks; eww.

Without commenting on whether or not it's ridiculous, the solution we
have today is:

1) Set up auto-props in the Subversion config file on each client
according to the rules of your organization. For example, if you want
all .txt files to have svn:eol-style set to native, add an auto-props
rule "*.txt = svn:eol-style=native".

2) Install a pre-commit hook in the repository which rejects the
commit of any file that does not conform to your rules. In the error
message that such a hook prints, you can do whatever you like, for
example direct users to a web site where they can download a pre-made
config file that's set up the way you want your users to set things up.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-02-28 23:48:00 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.