[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: Andy Levy <andy.levy_at_gmail.com>
Date: 2007-08-07 17:57:29 CEST

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.

It's been discussed on the list numerous times, I'm surprised you
didn't find anything beyond "don't do that."

> But I notice that there is the "start-commit" hook, which happens
> before the transaction is created. What's wrong with adding the
> property if not present at that point?

I would think the same dangers lurk here. You're still changing the
content that's been transmitted by the client without notifying the
client.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Aug 7 17:55:54 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.