[PATCH 2 of 4] revset: remove useless code to reorder weights of 'or' expression

Matt Mackall mpm at selenic.com
Tue May 26 18:54:46 CDT 2015


On Wed, 2015-05-27 at 07:54 +0900, Yuya Nishihara wrote:
> On Tue, 26 May 2015 11:14:27 -0500, Matt Mackall wrote:
> > On Wed, 2015-05-27 at 00:00 +0900, Yuya Nishihara wrote:
> > > # HG changeset patch
> > > # User Yuya Nishihara <yuya at tcha.org>
> > > # Date 1430040452 -32400
> > > #      Sun Apr 26 18:27:32 2015 +0900
> > > # Node ID 70591283d99dcc442f0e7bdb9afa603eb18bfac1
> > > # Parent  3c41bb6a51f96c0e4409f6b21689f61c16e149b2
> > > revset: remove useless code to reorder weights of 'or' expression
> > > 
> > > Perhaps there was copy-paste error.
> > 
> > There's an error here, but this is not the fix.
> > 
> > If we have an expression like
> > 
> >  "contains('set:grep(keyword)') or branch(default)"
> > 
> > ..we can optimize this expression by finding everything on branch(foo)
> > first before grepping every file in every revision.
> > 
> > So if wb > wa, we should swap a and b.
> 
> Hmm, but doesn't it change the order of the result set?
> I think "sort(A + B)" == "sort(B + A)", but "A + B" != "B + A".

Good point. But at the same time, we have a & b doing the same sort of
swapping. For now, you should replace this with a note of the missed
opportunity.

-- 
Mathematics is the supreme nostalgia of our time.



More information about the Mercurial-devel mailing list