changeset 25634:1ddefcfcd3e6

revsets: use '&' instead of '.filter' in head More high level operations are more likely to be optimised.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Fri, 10 Oct 2014 17:30:09 -0700
parents 0f44d35731d6
children 7fdd1782fc4e
files mercurial/revset.py
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revset.py	Sat Jun 20 11:07:36 2015 -0400
+++ b/mercurial/revset.py	Fri Oct 10 17:30:09 2014 -0700
@@ -1113,10 +1113,9 @@
         hs.update(cl.rev(h) for h in ls)
     # XXX using a set to feed the baseset is wrong. Sets are not ordered.
     # This does not break because of other fullreposet misbehavior.
-    # XXX We should not be using '.filter' here, but combines subset with '&'
     # XXX We should combine with subset first: 'subset & baseset(...)'. This is
     # necessary to ensure we preserve the order in subset.
-    return baseset(hs).filter(subset.__contains__)
+    return baseset(hs) & subset
 
 def heads(repo, subset, x):
     """``heads(set)``