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

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

From: Dale Worley <dworley_at_pingtel.com>
Date: 2004-12-03 16:14:55 CET

This doesn't solve the stated problem, but may solve the larger problem:

1. Check out the file. 2. Add your proposed unique ID numbers. 3. Attempt
to check in. If the check-in fails, revert the file and go back to 2
(probably with different ID numbers). If the check-in succeeds, you have
successfully reserved the ID numbers.

This isn't much different from what your people are doing already, since
with a lock, if a check-out fails, they have to wait a while and try again.

Dale

-----Original Message-----
From: David Kramer [mailto:david@thekramers.net]
Sent: Friday, December 03, 2004 9:58 AM
To: users@subversion.tigris.org
Subject: How do I allow only one person at a time to edit a file?

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
---------------------------------------------------------------------
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:19:53 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.