Locking use question

Locking use question

Hi folks,

I am writing up a description of the locking GUI in TSVN, and having
read through the SVN locking docs, it is unclear whether there are any
real use cases for locking _without_ having set the svn:needs-lock
property. If I lock a file it stops others checking in before me, but
doesn't stop them modifying their local copies. Once I unlock, they can
merge my changes in with any they have made in the meantime, which still
follows the copy-modify-merge model. Is there a use for this which I may
have missed, or is locking really only useful in conjunction with the
svn:needs-lock property?

Re: Locking use question

On Tue, 26 Apr 2005, Simon Large wrote:

> I am writing up a description of the locking GUI in TSVN, and having
> read through the SVN locking docs, it is unclear whether there are any
> real use cases for locking _without_ having set the svn:needs-lock
> property. If I lock a file it stops others checking in before me, but
> doesn't stop them modifying their local copies. Once I unlock, they can
> merge my changes in with any they have made in the meantime, which still
> follows the copy-modify-merge model. Is there a use for this which I may
> have missed, or is locking really only useful in conjunction with the
> svn:needs-lock property?
>

Say you do a large reorganization of the file (or reindent it or
something) and don't want to risk to get lots of conflicts. Then you might
lock the file, without the svn:needs-lock property.OK, you push the merge
burden on others, so you still have to communicate. I'm not sure how
useful this will be in practice.

Re: Locking use question

On Apr 26, 2005, at 2:58 PM, Peter N. Lundblad wrote:

> On Tue, 26 Apr 2005, Simon Large wrote:
>
>> I am writing up a description of the locking GUI in TSVN, and having
>> read through the SVN locking docs, it is unclear whether there are any
>> real use cases for locking _without_ having set the svn:needs-lock
>> property. If I lock a file it stops others checking in before me, but
>> doesn't stop them modifying their local copies. Once I unlock, they
>> can
>> merge my changes in with any they have made in the meantime, which
>> still
>> follows the copy-modify-merge model. Is there a use for this which I
>> may
>> have missed, or is locking really only useful in conjunction with the
>> svn:needs-lock property?
>>
> Say you do a large reorganization of the file (or reindent it or
> something) and don't want to risk to get lots of conflicts. Then you
> might
> lock the file, without the svn:needs-lock property.OK, you push the
> merge
> burden on others, so you still have to communicate. I'm not sure how
> useful this will be in practice.
>

Or, perhaps an admin wants to guarantee that nobody will delete a
certain file during a 24 hour period, even though it's a text file.

Re: Locking use question

Ben Collins-Sussman wrote:

> On Apr 26, 2005, at 2:58 PM, Peter N. Lundblad wrote:
>
>> On Tue, 26 Apr 2005, Simon Large wrote:
>>
>>> I am writing up a description of the locking GUI in TSVN, and having
>>> read through the SVN locking docs, it is unclear whether there are
>>> any real use cases for locking _without_ having set the
>>> svn:needs-lock property. If I lock a file it stops others checking
>>> in before me, but doesn't stop them modifying their local copies.
>>> Once I unlock, they can
>>> merge my changes in with any they have made in the meantime, which
>>> still
>>> follows the copy-modify-merge model. Is there a use for this which I
>>> may
>>> have missed, or is locking really only useful in conjunction with
>>> the svn:needs-lock property?
>>>
>> Say you do a large reorganization of the file (or reindent it or
>> something) and don't want to risk to get lots of conflicts. Then you
>> might
>> lock the file, without the svn:needs-lock property.OK, you push the
>> merge
>> burden on others, so you still have to communicate. I'm not sure how
>> useful this will be in practice.

I thought of something like that, but then I thought that if the changes
are that sticky, I would rather do the merge myself and be sure it is
right ;-)

> Or, perhaps an admin wants to guarantee that nobody will delete a
> certain file during a 24 hour period, even though it's a text file.

Re: Locking use question

On Apr 26, 2005, at 3:17 PM, Simon Large wrote:
>
> OK, that is plausible. I will put it in with suitable caveats.
>

Your intuition is right, though: 95% of the time, it makes sense to
use svn:need-lock. We just didn't want to make the locking system and
the communication system depend on each other. They're deliberately
designed as separate systems, but are meant to work together.

Re: Locking use question

On Tue, 2005-04-26 at 15:36, Simon Large wrote:
> Hi folks,
>
> I am writing up a description of the locking GUI in TSVN, and having
> read through the SVN locking docs, it is unclear whether there are any
> real use cases for locking _without_ having set the svn:needs-lock
> property.

If everyone is simply used to locking every file before editing, they
will find out about lock conflicts without the need for svn:needs-lock
to enforce the lock-before-edit requirement on them.

Also, even if it doesn't protect anyone else, locking a file still
protects you. If you've informed everyone else through some other
mechanism, then you might consider it their problem if they forget.