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

Re: Exclusive Locking: 2nd draft

From: Ben Collins-Sussman <sussman_at_collab.net>
Date: 2004-05-21 18:17:41 CEST

On Thu, 2004-05-20 at 11:22, Ben Collins-Sussman wrote:

>
> Use case #1: svn client
>
> LOCK -----> path cannot be locked or committed by anyone else.
>
> GET -----> returns path@HEAD universally. existence of lock is
> irrelevant.
>
> commit ----> allowed on path IFF you own the lock.
> (ra_svn does this using its own protocol,
> ra_dav does this via deltaV:
> MKACTIVITY, CHECKOUT, PUT, MERGE)
>
> UNLOCK ----> lock is removed. others can lock or commit the path.
>
>
> Use case #2: dumb dav client
>
> LOCK -----> path cannot be locked or committed by anyone else.
>
> GET -----> returns path@HEAD universally. existence of lock is
> irrelevant.
>
> PUT ----> if (autoversioning is on)
> instant commit. allowed, assuming you own the lock.
> else
> return error("Use deltaV, you dummy.")
>
> UNLOCK ----> lock is removed. others can lock or commit the path.

At Branko's request, allow me to rephrase this latest proposal from a
libsvn_fs-centric point of view, rather than a DAV point of view.

* Create a 'locks' table that maps a single locked path to a list of
users.

* svn_fs_lock/unlock() would add, delete or update a row in the locks
table.

* Any transaction attempting to be committed will have its changed-paths
compared to the locks table. If someone other than a lock-holder is
attempting to change a locked path, the commit is rejected. (As an
optimization, this check can be done "earlier" -- when the change is
made, rather than when the whole transaction is committed.)

That's it. Very simple. No special txns, no weird rules for reading.
Easy to implement in libsvn_fs for svn 1.1.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri May 21 18:23:15 2004

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.