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

Re: auto props / locking

From: Ryan Schmidt <subversion-2006Q1_at_ryandesign.com>
Date: 2006-05-01 23:42:39 CEST

On May 1, 2006, at 04:56, Nico Kadel-Garcia wrote:

> Each repository can have its own post-commit script. That script
> can look for certain types of files and automatically set their
> "needs-lock" properties, with associated messages.

It cannot. A hook must not modify the transaction which is being
committed. If it does, the client's working copy will be corrupt,
because the working copy will think it is up to date, but in fact is
not (because the hook has changed the transaction without information
the client, because there is no mechanism by which the client could
be informed of this). The best the hook can safely do is maintain its
own working copy of the relevant part of the repository, modify the
properties of the relevant files there if necessary, and commit a
second revision. Maintaining this working copy is messy, and the user
would have to do an "svn update" right after committing in order to
get any potential property modifications the post-commit hook made.
It's rather ugly.

> Alternatively, a pre-commit script could detect certain file types
> and refuse to accept changes to them unless they have been set to
> "needs-lock" or actually locked, to force users to lock them.

Yes, that's the more Subversion way to handle it.

To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon May 1 23:53:59 2006

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.