comparison mercurial/revset.py @ 22861:546fa6576815

revset: restore order of `or` operation as in Mercurial 2.9 Lazy revset broke the ordering of the `or` revset. We now stop assuming that two ascending revset are combine into an ascending one. Behavior in 3.0: 3:4 or 2:5 == [2, 3, 4, 5] Behavior in 2.9: 3:4 or 2:5 == [3, 4, 2, 5] We are adding a test for it. For unclear reason, the performance `or` revset with expensive filter are getting even worse than they used to be. This is probably caused by extra uncached containment check or iteration. revset #9: author(lmoscovicz) or author(mpm) before) wall 3.487583 comb 3.490000 user 3.490000 sys 0.000000 (best of 3) after) wall 4.481486 comb 4.480000 user 4.470000 sys 0.010000 (best of 3) revset #10: author(mpm) or author(lmoscovicz) before) wall 3.164839 comb 3.170000 user 3.160000 sys 0.010000 (best of 3) after) wall 4.574965 comb 4.570000 user 4.570000 sys 0.000000 (best of 3)
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 09 Oct 2014 04:24:51 -0700
parents 1dd178277cf5
children 9e5576f822cc
comparison
equal deleted inserted replaced
22860:1dd178277cf5 22861:546fa6576815
2281 2281
2282 def __add__(self, other): 2282 def __add__(self, other):
2283 """Returns a new object with the union of the two collections. 2283 """Returns a new object with the union of the two collections.
2284 2284
2285 This is part of the mandatory API for smartset.""" 2285 This is part of the mandatory API for smartset."""
2286 kwargs = {} 2286 return addset(self, other)
2287 if self.isascending() and other.isascending():
2288 kwargs['ascending'] = True
2289 if self.isdescending() and other.isdescending():
2290 kwargs['ascending'] = False
2291 return addset(self, other, **kwargs)
2292 2287
2293 def __sub__(self, other): 2288 def __sub__(self, other):
2294 """Returns a new object with the substraction of the two collections. 2289 """Returns a new object with the substraction of the two collections.
2295 2290
2296 This is part of the mandatory API for smartset.""" 2291 This is part of the mandatory API for smartset."""