comparison mercurial/revset.py @ 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 015c0d1087a3
children 46a96dd4d976
comparison
equal deleted inserted replaced
25633:0f44d35731d6 25634:1ddefcfcd3e6
1111 cl = repo.changelog 1111 cl = repo.changelog
1112 for b, ls in repo.branchmap().iteritems(): 1112 for b, ls in repo.branchmap().iteritems():
1113 hs.update(cl.rev(h) for h in ls) 1113 hs.update(cl.rev(h) for h in ls)
1114 # XXX using a set to feed the baseset is wrong. Sets are not ordered. 1114 # XXX using a set to feed the baseset is wrong. Sets are not ordered.
1115 # This does not break because of other fullreposet misbehavior. 1115 # This does not break because of other fullreposet misbehavior.
1116 # XXX We should not be using '.filter' here, but combines subset with '&'
1117 # XXX We should combine with subset first: 'subset & baseset(...)'. This is 1116 # XXX We should combine with subset first: 'subset & baseset(...)'. This is
1118 # necessary to ensure we preserve the order in subset. 1117 # necessary to ensure we preserve the order in subset.
1119 return baseset(hs).filter(subset.__contains__) 1118 return baseset(hs) & subset
1120 1119
1121 def heads(repo, subset, x): 1120 def heads(repo, subset, x):
1122 """``heads(set)`` 1121 """``heads(set)``
1123 Members of set with no children in set. 1122 Members of set with no children in set.
1124 """ 1123 """