mercurial/revset.py
changeset 22793 ff6689b47e48
parent 22792 bec4365a0707
child 22794 4aa1bfb54f43
equal deleted inserted replaced
22792:bec4365a0707 22793:ff6689b47e48
   666     # in the correct order.
   666     # in the correct order.
   667     args.ascending()
   667     args.ascending()
   668     result = (filteredset(s, subset.__contains__, ascending=True) +
   668     result = (filteredset(s, subset.__contains__, ascending=True) +
   669               filteredset(args, subset.__contains__, ascending=True))
   669               filteredset(args, subset.__contains__, ascending=True))
   670 
   670 
   671     # Wrap result in a filteredset since it's an _addset, which doesn't
   671     # Wrap result in a filteredset since it's an addset, which doesn't
   672     # implement all the necessary functions to be consumed by callers.
   672     # implement all the necessary functions to be consumed by callers.
   673     return filteredset(result, lambda r: True, ascending=True)
   673     return filteredset(result, lambda r: True, ascending=True)
   674 
   674 
   675 def descendants(repo, subset, x):
   675 def descendants(repo, subset, x):
   676     """``descendants(set)``
   676     """``descendants(set)``
  2283         kwargs = {}
  2283         kwargs = {}
  2284         if self.isascending() and other.isascending():
  2284         if self.isascending() and other.isascending():
  2285             kwargs['ascending'] = True
  2285             kwargs['ascending'] = True
  2286         if self.isdescending() and other.isdescending():
  2286         if self.isdescending() and other.isdescending():
  2287             kwargs['ascending'] = False
  2287             kwargs['ascending'] = False
  2288         return _addset(self, other, **kwargs)
  2288         return addset(self, other, **kwargs)
  2289 
  2289 
  2290     def __sub__(self, other):
  2290     def __sub__(self, other):
  2291         """Returns a new object with the substraction of the two collections.
  2291         """Returns a new object with the substraction of the two collections.
  2292 
  2292 
  2293         This is part of the mandatory API for smartset."""
  2293         This is part of the mandatory API for smartset."""
  2458         return self._ascending is not None and self._ascending
  2458         return self._ascending is not None and self._ascending
  2459 
  2459 
  2460     def isdescending(self):
  2460     def isdescending(self):
  2461         return self._ascending is not None and not self._ascending
  2461         return self._ascending is not None and not self._ascending
  2462 
  2462 
  2463 class _addset(abstractsmartset):
  2463 class addset(abstractsmartset):
  2464     """Represent the addition of two sets
  2464     """Represent the addition of two sets
  2465 
  2465 
  2466     Wrapper structure for lazily adding two structures without losing much
  2466     Wrapper structure for lazily adding two structures without losing much
  2467     performance on the __contains__ method
  2467     performance on the __contains__ method
  2468 
  2468