On Wed, Sep 03, 2003 at 10:19:37AM +0200, Rafael Garcia-Suarez wrote:
> Ronald Cannes wrote:
> > What I would REALLY like is a lease based system where person A gets
> > exclusive access to a resource for a spesific amount of time, such as 2
> > hours or a day. For instance, to obtain exclusive access for 30 minutes, I'd
> > like to do a "svn lock <url> -t 30m". Without the "-t" option, the
> > exclusiveness would not expire until I commited. I would also like the
> > ability to do a "svn unlock <url>" to force the lease to expire.
> >
> > After the lease period, person B can get to the resource. If person A still
> > has the resource (he forgot to commit before the lease time expired), he
> > gets an error. He didn't commit within the time he requested so now it's his
> > problem - now he has to merge/resolve when person B has commited, but that's
> > how I would like it to work.
>
> Sounds like this could be implemented with the combination of a commit hook
> and a bit of shell + crontab programming.
Yup, quite doable. The locking plan sitting in notes/ is the long-term
goal. For a short term, you should be able to do this relatively easily
with a small (command-line) client tool (written in Python or Perl) which
interacts with a CGI script on the server to maintain a lock database. A
pre-commit hook script can then check the if any of the modified files are
present in the lock database and held by somebody besides the committer. A
post-commit hook can then clear the appropriate files from the lock
database (if desired). The cron job can periodically expire files, or you
can simply test the expiration when you investigate whether a lock is
present.
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 Wed Sep 3 20:39:20 2003