# HG changeset patch # User Pierre-Yves David # Date 2014-10-11 00:30:09 # Node ID 1ddefcfcd3e6da10e44d3de094c9e4265c5c9deb # Parent 0f44d35731d69937c98ad9e1368cb6bd2ca6d029 revsets: use '&' instead of '.filter' in head More high level operations are more likely to be optimised. diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -1113,10 +1113,9 @@ def head(repo, subset, x): 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)``