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

Re: [Issue 533] New - implement reserved checkouts

From: Greg Stein <gstein_at_lyra.org>
Date: 2002-08-01 23:44:05 CEST

On Thu, Aug 01, 2002 at 08:25:15AM -0700, Peter Davis wrote:
> On Thursday 01 August 2002 08:03, issues@subversion.tigris.org wrote:
> > + $ svn lock foo.c
> > +
> > + sets the `svn:locked' property on foo.c, with prop value of the user's
> > + name (perhaps
> > + email address too, whatever other information can be gathered from the
> > + config files and elsewhere), and automatically commits. Thus, if
> > + foo.c is out of date, you can't take out a lock on it, which seems right.
>
> I really like this. I'm what one of the other comments would call an "early

Personally, I don't :-) I'm not a fan of creating a new revision simply
because somebody took out a lock on something they *might* change (they
could revert and cancel their lock). Also, I believe the typical pattern of
behavior is that a person will incrementally take out their advisory locks
as they discover they need to change <whatever> files.

> adopter", and I generally believe that locking is Evil. But this would be

Locking is evil *only* when you have documents that can easily be merged.
Locking is an absolute must for things like .doc or .xls files. Two people
cannot work on those at the same time, and merge their changes later. Thus,
it is a requirement to have a lock.

My thinking has been along this line:

* the server has a CGI script that manages a DB of locks
* a start-commit hook tosses anybody that doesn't hold a lock
* a pre-commit hooks tosses commits to items that are not locked by the
  commiter (read: you must lock everything before committing)
* a post-commit hook clears locks on items which were committed
* a client-side tool interacts with the CGI to:
  - establish a lock
  - remove a lock
  - list existing locks
  - break locks
* the CGI is also responsible for sending emails

Thus, a typical operation will be something like:

$ svn up
...
$ svnres lock foo.c # svnres == "svn reserved checkout tool"
foo.c has been locked.
$ jed foo.c
$ svn commit
...

$ svnres lock bar.c
bar.c is locked by "C. Mike Pilato <cmpilato@collab.net>"
$ svnres break bar.c
bar.c has been unlocked.
"C. Mike Pilato <cmpilato@collab.net>" has been notified.
$ svnres lock bar.c
bar.c has been locked.
...

$ svnres list
bar.c is locked by you.
baz.c is locked by you.
gloo.h is locked by "Ben Collins-Sussman <sussman@collab.net>"
subdir/fnord.c is locked by "Illuminati <fnord@fnord.net>"
...

$ jed foo.c
$ svn commit
ERROR: foo.c is locked by "Karl Fogel <kfogel@collab.net>"

[ that error msg comes rom the pre-commit script; we do have an issue about
  returning the error text, but take it as a hypothetical error msg ]

Note that you could perform some lock operations interactively in your web
browser via the CGI script.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Aug 1 23:41:28 2002

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.