revset: use `subset &` in `rev`
This takes advantage of the `fullreposet` smartness and yields a nice
speedup.
revset #0: rev(25)
0) wall 0.005480 comb 0.000000 user 0.000000 sys 0.000000 (best of 305)
1) wall 0.000052 comb 0.000000 user 0.000000 sys 0.000000 (best of 21891)
--- a/mercurial/revset.py Wed Sep 17 19:52:34 2014 -0700
+++ b/mercurial/revset.py Wed Sep 17 11:00:09 2014 -0700
@@ -1346,7 +1346,7 @@
except (TypeError, ValueError):
# i18n: "rev" is a keyword
raise error.ParseError(_("rev expects a number"))
- return subset.filter(lambda r: r == l)
+ return subset & baseset([l])
def matching(repo, subset, x):
"""``matching(revision [, field])``