revset: use `subset &` in bare `p1()`
This takes advantage of the `fullreposet` smartness and yields a nice
speedup.
revset #0: p1()
0) wall 0.003256 comb 0.010000 user 0.010000 sys 0.000000 (best of 527)
1) wall 0.000066 comb 0.000000 user 0.000000 sys 0.000000 (best of 23224)
--- a/mercurial/revset.py Wed Sep 17 11:00:09 2014 -0700
+++ b/mercurial/revset.py Wed Sep 17 10:59:52 2014 -0700
@@ -1198,7 +1198,9 @@
"""
if x is None:
p = repo[x].p1().rev()
- return subset.filter(lambda r: r == p)
+ if p >= 0:
+ return subset & baseset([p])
+ return baseset([])
ps = set()
cl = repo.changelog