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

Re: which version control supports file locking and who has it locked

From: Mark Phippard <markphip_at_gmail.com>
Date: Wed, 8 Jun 2016 14:40:42 -0400

On Mon, Jun 6, 2016 at 9:47 AM, Doug Robinson <doug.robinson_at_wandisco.com>

> Andreas:
> On Mon, Jun 6, 2016 at 3:50 AM, Andreas Stieger <Andreas.Stieger_at_gmx.de>
> wrote:
>> > or knowing who is actually working on a file.
>> Incorrect, this is shown in both TortoiseSVN and svn cli.
> To be more precise, you can know who, in the past, has made changes to
> files
> *and*checked those change into the repository. You cannot know who has
> made changes
> in their working copy and has not yet checked them back into the
> repository (they
> may never do so).
> To know who is actually working on a file requires a level of integration
> that is not
> found in SVN, Git or CVS. I have a vague recollection of an SCM that did
> enable
> such information but I'm not remembering which one it is at the moment.
I am surprised this was left unchallenged. I assumed someone would correct
this, so I did not.

SVN does support this feature .. if you use locking.


If you are using this feature and someone locks a file before editing it,
then you can in fact see this information. The issue is that the SVN
client and working copy is still more or less disconnected from the
server. So you do have to manage lock communication in some manner. If
the user chooses to connect to the server they can see that there is an
active lock on a file but in the more normal disconnected state then they
would not see this until they attempted to acquire a lock on the file.

I would imagine using the lock hooks to post some kind of notification when
a file is locked to enable a more pro-active communication.

The only clients that can handle this better than SVN are ones where the
client is always connected to a central server. Then the client can always
show the current lock state of a file and that it is being edited. SVN
clients only connect when you ask them to (svn update etc.)

For a TSVN users that wants locking, they should set the svn:needs-lock
property on all files that should be locked before editing. This will set
the file to read-only in the working copy so that you know to lock the file
before editing. IDE integrations like Subclipse and AnkhSVN will do this
automatically when you attempt to edit the file.

TSVN can then see locks that are held on files if you look on the server.
I believe doing an update will also bring this information into the working
copy but I could be wrong. Regardless, when you edit a file and thus try
to lock it you will see that it is locked to another user.

Mark Phippard
Received on 2016-06-08 20:40:49 CEST

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.