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

Re: Implementing the Lock->Edit->Unlock cycle

From: Eric Johnson <eric_at_tibco.com>
Date: Wed, 28 Sep 2016 09:40:23 -0700

Hi Anton,

On 9/28/16 8:46 AM, Anton Shepelev wrote:
> Hello, all
>
> We are migrating to SVN from the dreaded SourceSafe
> and should like to retain, if only at the start, the
> exclusive check-out process, with the following
> *atomic* operations which should be performed as
> easily as possible:
>
> 1. lock and update,
> lest one might accidentally start editing an
> old version of some file.
Subversion supports locks. However, it sounds like they do not work the
way you want them to.

Subversion's locks do not prevent anyone from editing files. They merely
slow other people, besides the owner of the lock, from committing changes.

"svn update" is your friend. Just encourage users to do updates before
they start editing.

Also, the lock-before-edit approach doesn't actually solve the problem
of making sure users have the latest. My recollection from using VSS was
that integration problems showed up more frequently, not less. I think
this was from the illusion that I have the latest version of the file I
want to edit (since I got the lock), so my files are probably all going
to be consistent. In practice, other developers change APIs, and I only
discover that by keeping current on the latest code changes.

The Subversion approach quickly trains users to get the latest changes
frequently.
> 2. commit and unlock.
Commits and locks are independent.
>
> Can SVN be configured to have such operations, and
> how?
I suspect you could tie yourself up into knots trying to write hook
scripts that accomplish some of what you want, but by the time you get
them working just the way you think you want them, you'll discover that
you probably don't want them that way.

Eric.
>
> We plan to use it mainly from the AnkhSVN plugin for
> Visual Studio, but I think the question belongs
> here.
>
Received on 2016-09-28 18:40:31 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.