darcs

Patch 261 resolve issue1848: Patch.Choices.makeEverythingSooner ...

Title resolve issue1848: Patch.Choices.makeEverythingSooner ...
Superseder Nosy List galbolle, kowey, mornfall
Related Issues
Status accepted Assigned To
Milestone

Created on 2010-06-03.14:20:21 by galbolle, last changed 2011-05-10.17:35:55 by darcswatch. Tracked on DarcsWatch.

Files
File name Status Uploaded Type Edit Remove
resolve-issue1848_-patch_choices_makeeverythingsooner-is-incorrect.dpatch galbolle, 2010-06-03.14:20:21 text/x-darcs-patch
unnamed galbolle, 2010-06-03.14:20:21
See mailing list archives for discussion on individual patches.
Messages
msg11212 (view) Author: galbolle Date: 2010-06-03.14:20:21
1 patch for repository http://darcs.net:

Thu Jun  3 16:19:33 CEST 2010  Florent Becker <florent.becker@ens-lyon.org>
  * resolve issue1848: Patch.Choices.makeEverythingSooner is incorrect
  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.
Attachments
msg11215 (view) Author: kowey Date: 2010-06-03.16:34:05
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
msg11219 (view) Author: darcswatch Date: 2010-06-03.17:20:58
This patch bundle (with 1 patches) was just applied to the repository http://darcs.net/.
This message was brought to you by DarcsWatch
http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-3ca50cc830cb941195ba05c1043d0a89f0050a0a
msg11223 (view) Author: mornfall Date: 2010-06-03.20:16:35
Hi!

Eric Kow <kowey@darcs.net> writes:
[snip snip]
> 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.

oh but not losing this distinction could make a nice UI improvement! I
think if you are using matchers and interactive selection, it would be
nice to see if the patch you are looking at was selected by a matcher or
is there because of a dependency. It would be perfect if you could ask
darcs which really-interesting patch caused it to be included, but
that's probably not very straightforward, implementation-wise. But even
marking "slightly interesting" patches as such could reduce confusion in
a few situations. What do you think?

Yours,
   Petr.
msg14060 (view) Author: darcswatch Date: 2011-05-10.17:35:55
This patch bundle (with 1 patches) was just applied to the repository http://darcs.net/reviewed.
This message was brought to you by DarcsWatch
http://darcswatch.nomeata.de/repo_http:__darcs.net_reviewed.html#bundle-3ca50cc830cb941195ba05c1043d0a89f0050a0a
History
Date User Action Args
2010-06-03 14:20:21galbollecreate
2010-06-03 14:23:02darcswatchsetdarcswatchurl: http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-3ca50cc830cb941195ba05c1043d0a89f0050a0a
2010-06-03 16:34:05koweysetnosy: + kowey
messages: + msg11215
2010-06-03 17:20:58darcswatchsetstatus: needs-review -> accepted
messages: + msg11219
2010-06-03 20:16:35mornfallsetnosy: + mornfall
messages: + msg11223
2011-05-10 17:35:55darcswatchsetmessages: + msg14060