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

Re: Needs lock + move

From: Simon Large <simon.tortoisesvn_at_gmail.com>
Date: Tue, 26 Apr 2011 15:18:13 +0100

On 26 April 2011 14:12, Hans-Emil Skogh <Hans-Emil.Skogh_at_tritech.se> wrote:
>>> I noticed today that you don't need to acquire the lock to move a
>>> file that has the needs-lock property set.
>>> Not sure, but wouldn't it be a good idea to at least warn if you are
>>> removing a file with the needs-lock property without being in
>>> possession of the lock? I guess the lock is not strictly there for
>>> the purpose of preventing deletes of files that other people might be
>>> working on, but when needs-lock is set on a file it would make sense
>>> (imho) to use it as such.
>>
>> Wouldn't something like this need to be implemented in the svn library?
>
> It's a pure client side decision, so there is no _need_ to implement it in the svn lib. That being said:
>
> Preferably it should, yes. Ideally I think needs lock should prevent delete operations where the lock has not been acquired. But since it doesn't, I guess that they have decided that the lock concept should only apply to changes that might require a merge. That does make sense in a way.
>
> However, I think it would make sense to implement this in TortoiseSVN. Providing a warning is pretty straight forward, at least in the case of a move/rename where we always display a dialog anyway. (Delete is a little bit different. Then we would need to pop up a warning dialog where there usually is no dialog at all. Maybe not ideal...) I think this is a good idea here as additional information/a reminder to the user. Even if core SVN has decided to omit it.

The lock is there to prevent a commit unless you have the lock.
svn:needs-lock is used to set the read-only state as a warning not to
waste your time editing the file without first getting the lock.
Delete and rename are somewhat different cases; without the lock you
cannot commit the delete or rename, but even if you go ahead and
delete a file in the WC and are then unable to commit, you have not
wasted a lot of effort. The only case I could come up with where
client side work is wasted is if you are doing some major renaming
work which you are then unable to commit.

Simon

-- 
:       ___
:  oo  // \\      "De Chelonian Mobile"
: (_,\/ \_/ \     TortoiseSVN
:   \ \_/_\_/>    The coolest Interface to (Sub)Version Control
:   /_/   \_\     http://tortoisesvn.net
------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=757&dsMessageId=2724375
To unsubscribe from this discussion, e-mail: [dev-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2011-04-26 16:18:15 CEST

This is an archived mail posted to the TortoiseSVN Dev mailing list.