[darcs-devel] Activation Patches

Ian Lynagh igloo at earth.li
Sat Jun 2 07:28:19 PDT 2007


On Thu, May 31, 2007 at 07:49:38PM -0700, Jason Dagit wrote:
> 
> >> The first property we implemented was to handle the dependency between
> >> the activation patch and the activated patch.  It looks like this:
> >> activation_commute_patch :: (Patch, Patch) -> Perhaps (Patch, Patch)
> >> activation_commute_patch (p1, Activation p2 [])
> >>  | eq_patches p1 p2 = Failed
> >
> >It would be nice if we had a name to carry around, rather than having to
> >carry around the actual patch. I think doing so would allow you to
> >eliminate the context that you carry around, which would simplify
> >things.
> 
> Would activations not be a patch if done that way?

The activation itself would be a patch, but rather than /containing/ a
patch (and context) it would contain only a patch name.

i.e., in concrete Haskell terms, rather than having

data PrimPatch = Hunk ...
               | ...
               | Activation PrimPatch [PrimPatch]

we'd have something like:

data PrimPatch = PrimPatch Name PrimContent
data PrimContent = Hunk ...
                 | ...
                 | Activation Name

> Supposing we implemented an activation patch as just the name of the
> patch which it activates?

I think that with the above you mean the same thing that I meant.

> I think maybe, but if I'm right then it's not something I've mentioned
> to you yet :)  David and I would like to introduce anonymous patches
> and name patches to help reduce the ways in which conflicts can occur
> and also to (hopefully) increase the ability of composite patches to
> commute freely.

I'm not following what you mean here.

> >(We can make names using a scheme like:
> >The n'th primpatch in the named patch N has name N.n)
> 
> Sort of Name.index?

Right.


Thanks
Ian



More information about the darcs-devel mailing list