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

How do I allow only one person at a time to edit a file?

From: David Kramer <david_at_thekramers.net>
Date: 2004-12-03 15:57:32 CET

We're moving from PVCS (Ewwwww) to svn, but a few of the developers are
fighting it. I'm trying to address their points in a meaningful manner.

There are two files in our system that contain a list of resources with
unique ID numbers. When someone needs to allocate new ones, they lock the
file, put in new entries, then check in and unlock.

I need to come up with a way of controlling access to these files. I've
gotten the concession that I can rely on an advisory locking (i.e. social
convention rather than hard lock), but I would rather block access.

There are a couple of ways I can think of, but this must already be a
solved problem, so I would like some feedback.

I was thinking that I could put a property called "Locked" set to the
userid of the locker on the file. Then a start-commit hook could block
commits on files that have this property. The problems with this are that
it requires other developers to check for that property on those two files
before editing, and that the locker must remove the property before
checking in, which gives a small opportunity for someone else to grab it.
Unless the start-commit hook was smart enought to let the user matching
that userid to commit. It would then remove the lock. Is that doable?

Another option is to simply use the property and rely on social
convention. The number of developers involved is small enough that this
may work. Yes, it's simpler, but riskier.

Am I missing an option? How do others do this? Windows developers must
face this all the time.

Thanks

-- 
DDDD   David Kramer         david_at_thekramers.net       http://thekramers.net
DK KD  
DKK D  Where are we going, and why are we in this handbasket? 
DDDD  
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Dec 3 16:02:15 2004

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.