You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Andy Bolstridge <an...@bolstridge.plus.com> on 2009/08/04 10:09:48 UTC

RE: commit desing based on wc-ng

My suggestion is to keep it real simple. Simple is good.

If multiple locking is needed, perhaps the simplest solution there is to lock all WCs according to the repository path - if a lock is held on a directory, you cannot lock on a subdir; but you can create a new lock for an unrelated directory.

eg. 

repo has:
  trunk/project1/subdirA

someone commits to project1, and they then try to add to subdirA whilst the commit is in-progress. This will block as subdirA is part of the lock path. (a simple comparison of the paths should be sufficient to detect this).

If they try to add to project2 however, this is fine - a new lock is created for that operation.

This doesn't solve the problem if a user has a WC embedded inside another WC - eg, they have subdirA/test/Project2 checked out. But I'd argue that this situation isn't a very common one, and isn't good practice. The worst that happens is that the unrelated embedded WC is locked for the duration of other operations.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2379940

RE: commit desing based on wc-ng

Posted by Bert Huijben <rh...@sharpsvn.net>.
> -----Original Message-----
> From: Stefan Sperling [mailto:stsp@elego.de]
> Sent: dinsdag 4 augustus 2009 12:31
> To: Andy Bolstridge
> Cc: dev@subversion.tigris.org
> Subject: Re: commit desing based on wc-ng
> 
> On Tue, Aug 04, 2009 at 03:09:48AM -0700, Andy Bolstridge wrote:
> > My suggestion is to keep it real simple. Simple is good.
> 
> Yes.
> 
> > If multiple locking is needed, perhaps the simplest solution there is
> > to lock all WCs according to the repository path - if a lock is held
> > on a directory, you cannot lock on a subdir; but you can create a new
> > lock for an unrelated directory.
> >
> > eg.
> >
> > repo has: trunk/project1/subdirA
> >
> > someone commits to project1, and they then try to add to subdirA
> > whilst the commit is in-progress. This will block as subdirA is part
> > of the lock path. (a simple comparison of the paths should be
> > sufficient to detect this).
> >
> > If they try to add to project2 however, this is fine - a new lock is
> > created for that operation.
> >
> > This doesn't solve the problem if a user has a WC embedded inside
> > another WC - eg, they have subdirA/test/Project2 checked out. But I'd
> > argue that this situation isn't a very common one, and isn't good
> > practice.
> 
> Embedded WCs happen all the time when people switch subtrees to
> different
> branches, or when they use externals. Committing to switched subtrees
> at the same time as their parent working copy does already work today,
> so we cannot break this. Committing to externals at the same time as
> their parent directory does not work right now, but I don't see why we
> should not fix this with WC-NG.

Note that committing externals with a parent working copy sometimes works,
because some checks in the commit runner are not strict enough. (You can
check this behavior with depth empty; then pass the individual files you
like to commit.. All selected files and the common parent must be in the
same repository.)

At least this works with 1.4.x-1.6.x. And because depth is not infinity some
types of changes (e.g. deletes of directories) don't work.

	Bert

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2379959

Re: commit desing based on wc-ng

Posted by Stefan Sperling <st...@elego.de>.
On Tue, Aug 04, 2009 at 03:09:48AM -0700, Andy Bolstridge wrote:
> My suggestion is to keep it real simple. Simple is good.

Yes.

> If multiple locking is needed, perhaps the simplest solution there is
> to lock all WCs according to the repository path - if a lock is held
> on a directory, you cannot lock on a subdir; but you can create a new
> lock for an unrelated directory.
> 
> eg. 
> 
> repo has: trunk/project1/subdirA
> 
> someone commits to project1, and they then try to add to subdirA
> whilst the commit is in-progress. This will block as subdirA is part
> of the lock path. (a simple comparison of the paths should be
> sufficient to detect this).
> 
> If they try to add to project2 however, this is fine - a new lock is
> created for that operation.
> 
> This doesn't solve the problem if a user has a WC embedded inside
> another WC - eg, they have subdirA/test/Project2 checked out. But I'd
> argue that this situation isn't a very common one, and isn't good
> practice.

Embedded WCs happen all the time when people switch subtrees to different
branches, or when they use externals. Committing to switched subtrees
at the same time as their parent working copy does already work today,
so we cannot break this. Committing to externals at the same time as
their parent directory does not work right now, but I don't see why we
should not fix this with WC-NG.

So while I think one lock per WC is good enough, I don't think comparing
paths is a good strategy for managing the locks. We should be using the
working copy DB handles to key our locks.

Stefan

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2379945