[darcs-devel] Example Conflicts

David Roundy droundy at darcs.net
Wed Aug 1 10:54:43 PDT 2007


On Wed, Aug 01, 2007 at 01:58:29AM +0100, Ian Lynagh wrote:
> Hi all,

Hi Ian!

> Some further questions:
> 
> On Tue, Jul 31, 2007 at 05:15:19PM -0700, Jason Dagit wrote:
> > 
> > Suppose you have 3 patches, A, B and C.  A and B conflict and C depends on A.

As Ian points out below, since C depends on A, C conflicts with B.  I think
this was the flaw in Jason's reasoning below (which was corrected by Ian).

> > You merge A and B by choosing to cancel A in favor of B.  Now you want
> > to pull C into  your repository.
> > 
> > I was explaining it like thus:
> > First you get X[](A)X[](B)
> > Now you cancel A, so remerge brings B back to life.  So then you have:
> > X[](A) B (Cancel A)
> 
> Am I right in thinking that there is only 1 "cancel A" patch, so for
> example if you and I both cancel A and then pull from each other there
> is no conflict?

My thought is that you can have multipel "Cancel A" patches, but they won't
conflict with each other.  In fact, a "Cancel" patch can commute trivially
with everything, since it only contains the name of the patch it cancels.

> And the "cancel A" patch doesn't have any sort of reference to B in it?

Right.

> If I unpull B then does A remain cancelled?

Yes.

> What UI do you have in mind for cancelling patches?

I'm thinking of a "resolve-conflicts" command which provides an interactive
prompt like revert, asking "would you like to cancel this change?".  It's a
bit hokey, and one would hope we could do better, but this is all I've
thought of so far.

> > Definition:
> > The pristine state of the repository consists of the set of active
> > changes that do not conflict with any other active changes.
> > 
> > The pristine state of the repo:
> > { C }
> > Or should this be empty because C depends on A which has a conflict?
> 
> { C } doesn't make sense, as you can't have C in a repo state without
> also having A.

Right, the pristine state should be { }.

> I think you want:
> 
> Definition:
> The pristine state of the repository consists of the set of active
> changes such that both:
> * the change does not conflict with any other active changes
> * all the dependencies of the patch is in the pristine state.

The latter part of this is implied by the former, with a proper definition
of "conflict".  If patch C depends on patch A which conflicts with patch B,
then patch C conflicts with patch B.
-- 
David Roundy
Department of Physics
Oregon State University


More information about the darcs-devel mailing list