Mercurial > public > mercurial-scm > hg-stable
diff mercurial/revset.py @ 34038:37b82485097f
revset: do not flip "and" arguments when optimizing
Rewrite `flipand(y, x)` to `andsmally(x, y)` so the AST order is unchanged,
which could be more friendly to developers.
Differential Revision: https://phab.mercurial-scm.org/D579
author | Jun Wu <quark@fb.com> |
---|---|
date | Wed, 30 Aug 2017 16:05:12 -0700 |
parents | 205c47e30a93 |
children | c6c8a52e28c9 |
line wrap: on
line diff
--- a/mercurial/revset.py Wed Aug 30 22:51:28 2017 +0900 +++ b/mercurial/revset.py Wed Aug 30 16:05:12 2017 -0700 @@ -169,8 +169,8 @@ yorder = followorder return getset(repo, getset(repo, subset, x, order), y, yorder) -def flipandset(repo, subset, y, x, order): - # 'flipand(y, x)' is equivalent to 'and(x, y)', but faster when y is small +def andsmallyset(repo, subset, x, y, order): + # 'andsmally(x, y)' is equivalent to 'and(x, y)', but faster when y is small if order == anyorder: yorder = anyorder else: @@ -2101,7 +2101,7 @@ "string": stringset, "symbol": stringset, "and": andset, - "flipand": flipandset, + "andsmally": andsmallyset, "or": orset, "not": notset, "difference": differenceset,