revset-_ancestor: use & instead of filter
The & operation is more likely optimised.
::10
before) wall 0.028189 comb 0.030000 user 0.030000 sys 0.000000 (best of 100)
after) wall 0.001050 comb 0.000000 user 0.000000 sys 0.000000 (best of 2326)
::tip
before) wall 0.081132 comb 0.080000 user 0.080000 sys 0.000000 (best of 100)
after) wall 0.055418 comb 0.050000 user 0.050000 sys 0.000000 (best of 100)
--- a/mercurial/revset.py Thu Oct 16 14:46:37 2014 -0700
+++ b/mercurial/revset.py Tue Sep 30 15:03:54 2014 -0500
@@ -347,7 +347,7 @@
if not heads:
return baseset()
s = _revancestors(repo, heads, followfirst)
- return subset.filter(s.__contains__)
+ return subset & s
def ancestors(repo, subset, x):
"""``ancestors(set)``