[darcs-users] Matching patches in reversed order

Eric Kow kowey at darcs.net
Thu Dec 10 23:27:11 UTC 2009


Hi Florent,

On Fri, Nov 13, 2009 at 11:31:32 +0100, Florent Becker wrote:
> in SelectChanges.lhs, there are two bug lines in iswanted:
> 
> iswanted Last opts p = bug "don't support patch matching with Last in
> wasp"
> iswanted FirstReversed opts p = bug "don't support patch matching with
> FirstReversed in wasp"

I haven't had a chance to look into this in detail yet, but in case it
helps, I've tried to rehabilitate my wiki page from 2006 when I was
trying to work what the selection code was doing.  I guess everything
in that page is either obsolete or stuff you already figured out, but
just in case...

http://wiki.darcs.net/Development/DarcsInternals/PatchSelection

> iswanted :: Patchy p => MatchCriterion (PatchInfoAnd p)
> iswanted First opts p = match_a_patch opts . hopefully $ p
> iswanted LastReversed opts p = match_a_patch opts . hopefully . invert $
> p
> iswanted Last opts p = match_a_patch opts . hopefully . invert $ p
> --bug "don't support patch matching with Last in wasp"
> iswanted FirstReversed opts p = match_a_patch opts . hopefully $ p
> --bug "don't support patch matching with FirstReversed in wasp"

I'm still not 100% clear on how last/reversed interact.  Is it just
the case that reversed gives them to you most recent first and last
inverts them?

One explanation, if my table is right, may just be that we never
needed them:

FirstReversed will only be triggered in the ask-deps case [in reverse
order for convenience, first because we are not undoing things].  If I
recall correctly, we currently do not have matchers for deps (although I
guess it's fairly sane to want to do ``darcs record --ask-deps --match
'hunk foo'``)

Likewise, Last is only used in code that selects prim patches (revert
and the rollback prim selector)

Hope these musings are of some value,

-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-users/attachments/20091210/df1e57de/attachment.pgp>


More information about the darcs-users mailing list