revset: use `subset &` in `follow`
authorPierre-Yves David <pierre-yves.david@fb.com>
Wed, 17 Sep 2014 10:59:16 -0700
changeset 22535 44f471102f3a
parent 22534 6261b9c549a2
child 22536 8040a44aab1c
revset: use `subset &` in `follow` This takes advantage of the `fullreposet` smartness. revset #0: follow(COPYING) 0) wall 0.002446 comb 0.000000 user 0.000000 sys 0.000000 (best of 735) 1) wall 0.000331 comb 0.000000 user 0.000000 sys 0.000000 (best of 5672)
mercurial/revset.py
--- a/mercurial/revset.py	Wed Sep 17 10:58:50 2014 -0700
+++ b/mercurial/revset.py	Wed Sep 17 10:59:16 2014 -0700
@@ -834,7 +834,7 @@
     else:
         s = _revancestors(repo, baseset([c.rev()]), followfirst)
 
-    return subset.filter(s.__contains__)
+    return subset & s
 
 def follow(repo, subset, x):
     """``follow([file])``