[darcs-devel] darcs patch: function to determine active/inactive patches.

David Roundy droundy at darcs.net
Mon Aug 13 16:50:35 UTC 2007


On Sun, Aug 12, 2007 at 02:28:13PM +0200, Eric Y. Kow wrote:
> > Here's a function in the Cancellation module to determine which
> > patches are active, and make the inactive patches Cancelled.
> 
> I'm pushing this, but I've only gotten a basic gist of it, not looked
> very hard.

No problem.  It's pretty small and self-contained (and doesn't yet affect
any of darcs' behavior).

> > +cancel_patches :: FL Patch C(a b) -> Sealed (FL Patch) C(a)
> > +cancel_patches x = cancel_marked_patches $ mark_cancelled_patches
> > +                   $ mapFL_FL uncancel x
> 
> This seems a bit confusing! Why would there be cancelled patches to
> mark if we've just uncancelled them?  And then why bother cancelling
> the marked patches if they were already cancelled when we marked them?

We're recomputing which patches are cancelled, so we start by uncancelling
all patches but leaving the *cancellation* patches, from which we compute
(and mark) which ones *should* be cancelled, and then we cancel those
ones.

> > +remove_from_sequence_unless_depended_upon
> > +    :: Patch C(a b) -> FL Patch C(b c) -> Maybe (Sealed (FL Patch) C(a))
> 
> I think I understand this one: given a sequence p xs (i.e. p before xs),
> if p commutes past xs, then xs does not depend on it, so we can ignore p
> (however, we must return the commuted xs').  If it fails to commute we
> return Nothing.
> 
> The 'removing' consists of ignoring p.  That it, is it 'p' that we are
> trying to remove.

Right.
-- 
David Roundy
Department of Physics
Oregon State University
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.osuosl.org/pipermail/darcs-devel/attachments/20070813/ce1ac64a/attachment.pgp


More information about the darcs-devel mailing list