resolve issue1848: Patch.Choices.makeEverythingSooner is incorrect
------------------------------------------------------------------
> Florent Becker <florent.becker@ens-lyon.org>**20100603141933
> Ignore-this: ef9ea4cb04d313c668b3854409e5f451
> This made selection of patches with --match buggy when choosing Last or
> FirstReversed patches. This affected primary patch selection in rollback,
> record --ask, and any other command with --reverse.
> ] hunk ./src/Darcs/Patch/Choices.hs 373
> case commuteRL (bubble :> tp) of
> Nothing -> mes middle (tp :<: bubble) ls
> Just (tp' :> bubble') -> mes (tp' :<: middle) bubble' ls
> - mes middle bubble NilFL = (reverseRL middle) :> mapFL_FL (\tp -> PC tp True) (reverseRL bubble)
> + mes middle bubble NilFL = (reverseRL middle) :> mapFL_FL (\tp -> PC tp False) (reverseRL bubble)
This was a fun patch to discuss (one of the more gratifying aspects of
Darcs hacking for me)
http://irclog.perlgeek.de/darcs/2010-06-03#i_2398787
So there are three kinds of patches we're dealing with here:
- really interesting patches - explicitly selected with a matcher
- slightly interesting patches - not explicitly selected, but depended
on by interesting patches
- boring patches - neither depended on or explictly selected
The key problem solved by makeEverythingSooner above is that after
matching, we only know if a patch is interesting or not-so-interesting.
Among the not-so-interesting patches, we want to know if it's actually
slightly-interesting (depended upon) or really actually boring. To find
out, the makeEverythingSooner function commutes all the interesting
patches past each one of the not-so-interesting ones. If it commutes
past; it's boring. If it *fails* to commute, then it's actually
slightly-interesting.
After doing this commutation work, we are left with 3 kinds of patches:
- really interesting ones - in the 'bubble' and tagged with True
- slightly interesting ones - in the 'bubble' and tagged with False
- boring patches - in the 'middle' of mes.
At this stage of the work, we can now lose the distinction between
really interesting and slightly interesting patches. We want to
set all patches to 'slightly interesting' and let the user pick out
the ones she considers to be really interesting. So we should tag
all the patches False, except oops, we were tagging them True, so
commands like darcs rollback -p were effectively selecting all the
patches without so much as asking the user.
Applied, thanks!
--
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9
|