Well, I don't think I'm going to be understand these patches, but in they go. I'm glad that at least Jason knows what's going on inside, which makes you at least two (hey, maybe somebody else on the list...)
> Fri Aug 24 11:34:27 PDT 2007 David Roundy <[EMAIL PROTECTED]>
> * fix commutation bug on conflicted patches.
> Note: this breaks an existing test by revealing
> a bug in the (incomplete) remerge function.
> Mon Aug 27 09:46:35 PDT 2007 David Roundy <[EMAIL PROTECTED]>
> * define remove_subsequenceFL.
Seems fine.
> Mon Aug 27 11:17:12 PDT 2007 David Roundy <[EMAIL PROTECTED]>
> * more work on remerge.
> -conflicted_commute_context (p2 :< Conflicted ics ip1) = toPerhaps $
> +conflicted_commute_context (p2 :< Conflicted ics ip1) = toPerhapsUnknown $
> -conflicted_commute_context (p2 :< Cancelled ics ip1) = toPerhaps $
> +conflicted_commute_context (p2 :< Cancelled ics ip1) = toPerhapsUnknown $
Huh. Are there things affected by the same problem?
> +splitAtFL :: Int -> FL a C(x z) -> (FL a :> FL a) C(x z)
> +splitAtFL 0 xs = NilFL :> xs
> +splitAtFL _ NilFL = NilFL :> NilFL
> +splitAtFL n (x:>:xs) = case splitAtFL (n-1) xs of
> + (xs':>xs'') -> (x:>:xs' :> xs'')
This seems to be subtly different from splitAt:
splitAt (-1) ['a','b'] == ("","ab")
not that I think it would matter...
> [more work on remerge.
> David Roundy <[EMAIL PROTECTED]>**20070827181712]
> <
> > {
> hunk ./src/Darcs/Patch/Merge.lhs 33
> import Darcs.Patch.Ordered ( MyEq, EqCheck(..), (=/\=),
> (:<)(..), (:\/:)(..), (:/\:)(..),FL(..),RL(..),
> (:\./:)(..), (:>)(..),
> - reverseFL, reverseRL
> + reverseFL, reverseRL,
> + splitAtFL, lengthFL
> )
> hunk ./src/Darcs/Patch/Merge.lhs 36
> -import Darcs.Patch.Commute ( commute, head_permutationsRL )
> +import Darcs.Patch.Commute ( commute, head_permutationsRL,
> remove_subsequenceFL )
> import Darcs.Sealed ( Sealed(..), seal, unseal, mapSeal )
> #include "impossible.h"
> hunk ./src/Darcs/Patch/Merge.lhs 39
> +import GHC.Base ( unsafeCoerce# )
>
> new_merge :: (Patch :\/: Patch) C(x y) -> Maybe ((Patch :/\: Patch) C(x y))
> new_merge (p1:\/:p2) = do ip1' :< p2' <- commute (p2 :< invert p1)
> hunk ./src/Darcs/Patch/Merge.lhs 193
> cs2f left NilFL = left :> NilFL
> cs2f left (x@(Conflicted NilFL _):>:xs) = cs2f (left +>+ (x :>: NilFL)) xs
> cs2f left (x@(Conflicted cs _):>:xs) =
> - case conflict_away left (invertFLRL cs) of
> - left' -> case conflict_to_end' (invert (join_patchesFL cs) :>
> (x:>:xs)) of
> - xs' :> confls -> case cs2f left' xs' of
> - a :> b -> a :> b +>+ confls
> + case remove_already_conflicted left cs of
> + Sealed cs' ->
> + case conflict_away left (invertFLRL cs') of
> + left' -> case conflict_to_end' (invert (join_patchesFL cs') :>
> (x:>:xs)) of
> + x':>:xs' :> confls -> case cs2f (left'+>+(x':>:NilFL)) xs' of
> + a :> b -> a :> b +>+ confls
> + NilFL :> _ -> impossible
> cs2f left (x:>:xs) = cs2f (left +>+ (x :>: NilFL)) xs
> +commuteFL :: (FL Patch :> FL Patch) C(a b) -> Maybe ((FL Patch :> FL Patch)
> C(a b))
seems ok
> +float_conflicted :: RL Patch C(a b) -> FL Patch C(b b)
> +float_conflicted NilRL = NilFL
> +float_conflicted (x@(Conflicted _ _):<:xs) = x :>: float_conflicted xs
> +float_conflicted (x :<: xs) = case commuteFL (float_conflicted xs :> x :>:
> NilFL) of
> + Nothing -> impossible
> + Just (_ :> fc) -> unsafeCoerce# fc
don't really understand this one; seems to be 'get rid of anything that
isn't Conflicted'
> +remove_already_conflicted :: FL Patch C(a b) -> FL Patch C(b c) -> Sealed
> (FL Patch C(b))
> +remove_already_conflicted NilFL xs = seal xs
> +remove_already_conflicted _ NilFL = seal NilFL
mostly over my head, sadly
> + Just (r' :> csp') ->
> + case splitAtFL (lengthFL (r' +>+ csp') - 1) (r'
> +>+ csp') of
this use of splitAtFL reminds me of Data.List.init
--
Eric Kow http://www.loria.fr/~kow
PGP Key ID: 08AC04F9 Merci de corriger mon français.
pgpI8SOaBcIRf.pgp
Description: PGP signature
_______________________________________________ darcs-devel mailing list [email protected] http://lists.osuosl.org/mailman/listinfo/darcs-devel
