# HG changeset patch # User Yuya Nishihara # Date 2016-08-20 08:50:23 # Node ID 323f0c4b43f4219e45fd75a437c997944ec3b790 # Parent 5bda147c3139ce502a4266d4dc0f7894b075d6fe revset: categorize wdir() as very fast function The cost of wdir() should be identical to or cheaper than _intlist(). diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -2606,7 +2606,7 @@ def _optimize(x, small): w = 100 # very slow elif f == "ancestor": w = 1 * smallbonus - elif f in ('reverse', 'limit', 'first', '_intlist'): + elif f in ('reverse', 'limit', 'first', 'wdir', '_intlist'): w = 0 elif f == "sort": w = 10 # assume most sorts look at changelog