You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by David Kramer <da...@thekramers.net> on 2004/12/03 14:57:32 UTC

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@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

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

Posted by David Kramer <da...@thekramers.net>.
On Fri, 3 Dec 2004, Dale Worley wrote:

> 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.

(Hi, Dale.  Funny how my social circles are overlapping like crazy)

It's really pretty different, and let me explain part of the the problem I 
neglected to mention.

The unique IDs are not human-allocated, they are assigned by a GUI 
development tool (I don't know what it is and have never seen it).  That 
means that (1) The wall-clock time between getting the file with the UIDs 
and being ready to commit it could be substantial, and (2) if the process 
fails because someone else modified the file while they were working, the 
developer has to redo all their work from scratch.  

-------------------------------------------------------------------
DDDD   David Kramer                           http://thekramers.net
DK KD  
DKK D  "Remember folks - Traffic lights timed for 35 mph
DK KD  are also timed for 70 mph."
DDDD                                                    Jim Samuels 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

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

Posted by kf...@collab.net.
Ben Collins-Sussman <su...@collab.net> writes:
> Or, wait a month or so for svn 1.2, which is going to feature real
> locking.

Ben's in the right ball park, but note that "or so".  A month is the
soonest it would be ready; I think two or three is more realistic.

> We've already got the repository doing locks, as well as mod_dav_svn
> and svnserve.  Next week, we're going to start working on client-side
> support.

Yay!

-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

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

Posted by Ben Collins-Sussman <su...@collab.net>.
On Dec 3, 2004, at 9:14 AM, Dale Worley wrote:

> 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.
>

Or, wait a month or so for svn 1.2, which is going to feature real 
locking.

We've already got the repository doing locks, as well as mod_dav_svn 
and svnserve.  Next week, we're going to start working on client-side 
support.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

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

Posted by Dale Worley <dw...@pingtel.com>.
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@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