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

Auto setting of the lock property for 1.2, Was: how to get a new project on the links page?

From: Scott Palmer <scott_at_digital-rapids.com>
Date: 2004-12-24 16:52:41 CET

On Dec 24, 2004, at 10:14 AM, Benjamin Pflugmann wrote:

> On Fri 2004-12-24 at 09:28:54 -0500, Scott Palmer wrote:
>> On Dec 24, 2004, at 3:02 AM, Benjamin Pflugmann wrote:
>>>> In 1.2, will we be able to configure the server to automatically set
>>>> this property for any file that is detected as binary?
>>> In Subversion's design, the server may not change any properties
>>> without an explicit commit ...
>>> But you can easily install a pre-commit hook that is rejecting any
>>> commit where not all binary files have that property set...
>> Is it the client or the server that decides if a file is binary or
>> not?
> It's the client. ...

> The decision whether a file is considered binary or not is based on
> it's svn:mime-type property...

Yes but as you point out below there is also an automated process that
sets the mime type, so in effect the decision of whether a file is
considered binary or not is based on a heuristic OR the mime type
specified manually or by auto-props.

> http://svnbook.red-bean.com/en/1.1/svn-book.html#svn-ch-7-sect-2.4
> describes when svn:mime-type is set and how you can influence
> automatically setting it.

"Subversion runs a very basic heuristic to determine if that file
consists of human-readable or non-human-readable content. If the
latter is the decision made, Subversion will automatically set the
svn:mime-type property on that file to application/octet-stream"

>> It would be nice if the client-side auto-props could be made to set
>> this.
> You can ...
>> Instead of using a filename pattern,
> ... but only with file patterns.
> But what you are missing to your luck is being able to set a property
> based on the value of another property. But as was said before, you
> can now easily reject commits having binary files without the
> need-lock property. And writing a script for the client-side that
> looks for all binary files and sets this property shouldn't be to hard
> to do, either.

But there is no way to use the same heuristic to set the "needs lock"
property automatically. I think there should be. Rejecting commits
with a pre-commit hook keeps the repository sane, but frustrates the
developer because, well, it always frustrates the developer when a
commit fails :).

For the same reason svn:mime-type is handled automatically (e.g. you
could just use a pre-commit hook to reject the commit in the case that
the mime type wasn't set properly for a binary file), the same ability
is needed for svn:lock (or whatever the name was). Manually needing to
set properties on files is awkward, that is why the auto-props feature
is present in the first place. The more things that can be effectively
automated the better.

Considering how close the current implementation is to being able to do
this, I suggest a config option be added to tell subversion to handle
the lock property automatically for all files that it would not do an
automatic merge for. That seems to cover the common cases for when
locking is really more required than optional.



To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Sat Dec 25 23:40:34 2004

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.