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

Locking issues

From: D.J. Heap <dj_at_shadyvale.net>
Date: 2005-04-13 01:39:17 CEST

I've been testing the locking functionality a bit in preparation for
using it, and have found what seem to be a couple of issues. Although I
haven't been able to follow the lists very well for quite a while, I
have read the locking notes and believe I have a decent understanding of
how it works (and hopefully should work).

The first issue is when I lock an out-of-date file (especially with the
needs-lock property on). The file is not currently locked by anyone
else (and if needs-lock was on, it is changed to editable from
read-only) so I get the lock, edit the file, and fail to commit because
I'm out of date. This seems to defeat the purpose of the lock in the
first place (to prevent wasting my time on unmergeable changes).
Shouldn't there at least be some notification at lock time that the file
is out of date?

Here's a transcript (D:\Temp\trwc is a test working copy, D:\Temp\trwc2
is a 2nd test working copy of the same repo):

D:\Temp>svn lock trwc\file.txt
'file.txt' locked by user 'dj'.

D:\Temp>notepad trwc\file.txt

D:\Temp>svn commit -m "test" trwc
Sending trwc\file.txt
Transmitting file data .
Committed revision 3.

D:\Temp>svn lock trwc2\file.txt
'file.txt' locked by user 'dj'.

D:\Temp>notepad trwc2\file.txt

D:\Temp>svn commit -m "test" trwc2
Sending trwc2\file.txt
Transmitting file data .svn: Commit failed (details follow):
svn: Out of date: 'file.txt' in transaction '3-1'

D:\Temp>

This transcript is from Windows, but I tested and got the same results
on Linux.

The second issue is probably Windows only -- assuming the needs-lock
property was on the file and you run the above transcript, if you issue
an 'update' and get a conflict, the file.txt is read-only and cannot be
edited. And on Windows it cannot be reverted either -- the revert fails
with 'Access denied' due to the read-only flag. It seems like a
conflict should leave the file editable, and revert (and possibly other
commands?) need to pay attention to the needs-lock property and remove
read-only-ness when necessary.

So, are these real issues or is my understanding incomplete? I can look
deeper into them this weekend if they are real issues and try coming up
with fixes.

DJ

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Apr 13 01:40:02 2005

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