On 2020-09-17 16:38, Ben Franksen wrote:
> Also note that the "context" in a contexted patch usually
> consists of negated patches (we have to walk backwards along the history
> to reach the patch we reference).

Sorry, this is wrong. In fact, all contexted patches contain only
positive prims. We even test this as a property (an invariant that holds
for all contexted patches contained in a V3 Conflictor, see
prop_ctxPositive in src/Darcs/Patch/V3/Contexted.hs and
harness/Darcs/Test/Patch/Properties/RepoPatchV3.hs).

I must admit that I was surprised by this. Apparently the only reason we
need Contexted patches at all is to cancel the negating effects of this
or previous conflictors involved in the same conflict. Indeed, all
occurrences of ctxAdd* in src/Darcs/Patch/V3/Core.hs take patches from
the effect of either the LHS ('r') or the RHS Conflictor ('s') as
argument, or some commuted variant of either. Inspection of the code
further reveals that indeed everywhere we add patches from the effect
without (re-)inverting them, we actually remove patches from the context
that we previously added during merge or commute.

On a more fundamental level, I think the set of contexted patches that a
conflictor (knows that it) conflicts with really corresponds to a set of
paths branching off the side in the tree view, which makes it pretty
obvious that they must all be positive.

Cheers
Ben

_______________________________________________
darcs-users mailing list
darcs-users@osuosl.org
https://lists.osuosl.org/mailman/listinfo/darcs-users

Reply via email to