revset: use `subset &` in bare `p2()`
This takes advantage of the `fullreposet` smartness with a nice
speedup. It's a similar speedup to `p1()` when a merge is in progress
(the non merge case is already lightning fast anyway.)
--- a/mercurial/revset.py Wed Sep 17 10:59:52 2014 -0700
+++ b/mercurial/revset.py Wed Sep 17 11:00:03 2014 -0700
@@ -1217,7 +1217,9 @@
ps = repo[x].parents()
try:
p = ps[1].rev()
- return subset.filter(lambda r: r == p)
+ if p >= 0:
+ return subset & baseset([p])
+ return baseset([])
except IndexError:
return baseset([])