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

Re: start-commit to enforce needs-lock?

From: Dave Lawrence <dlawrence_at_ad-holdings.co.uk>
Date: 2007-08-07 18:57:38 CEST

Andy Levy wrote:
> On 8/7/07, A. M. Passy <amarcpassy@gmail.com> wrote:
>> I'm looking for a way to enforce the setting of the svn:needs-lock
>> property for new and imported files. I've read the appropriate
>> sections of the svnbook and read a whole lot of the mailing list
>> traffic. I understand that using a pre-commit hook is considered bad,
>> because one is modifying an in-process transaction (though as an
>> aside, no one has explained exactly under what conditions, i.e._why_
>> it is bad - the comments are all in the mode of "there be dragons").
>
> It's bad because (and this is only one of several reasons, I'm sure)
> if a hook modifies a transaction in-flight, the WC is out of sync with
> the repository immediately after the transaction is committed. If I
> commit a file to the repository, upon completion of the transaction,
> my copy of the file should be identical in all ways to the copy in the
> repository.

My understanding is that the correct thing to do is to use the
pre-commit hook to validate the commit, and reject it if it doesn't
conform. The user receives an error and the ball is now back in their
court - they must add the needs-lock property and try again.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Aug 7 18:56:38 2007

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.