mercurial/revset.py
changeset 23139 e53f6b72a0e4
parent 23127 7361d8244efb
child 23162 69524a05a7fa
equal deleted inserted replaced
23136:6eab50a34fed 23139:e53f6b72a0e4
  2549             self._list
  2549             self._list
  2550             return iter(self)
  2550             return iter(self)
  2551         return it()
  2551         return it()
  2552 
  2552 
  2553     def _trysetasclist(self):
  2553     def _trysetasclist(self):
  2554         """populate the _asclist attribut if possible and necessary"""
  2554         """populate the _asclist attribute if possible and necessary"""
  2555         if self._genlist is not None and self._asclist is None:
  2555         if self._genlist is not None and self._asclist is None:
  2556             self._asclist = sorted(self._genlist)
  2556             self._asclist = sorted(self._genlist)
  2557 
  2557 
  2558     @property
  2558     @property
  2559     def fastasc(self):
  2559     def fastasc(self):
  2742         if self._finished:
  2742         if self._finished:
  2743             return iter(self._genlist)
  2743             return iter(self._genlist)
  2744 
  2744 
  2745         # We have to use this complex iteration strategy to allow multiple
  2745         # We have to use this complex iteration strategy to allow multiple
  2746         # iterations at the same time. We need to be able to catch revision
  2746         # iterations at the same time. We need to be able to catch revision
  2747         # removed from `consumegen` and added to genlist in another instance.
  2747         # removed from _consumegen and added to genlist in another instance.
  2748         #
  2748         #
  2749         # Getting rid of it would provide an about 15% speed up on this
  2749         # Getting rid of it would provide an about 15% speed up on this
  2750         # iteration.
  2750         # iteration.
  2751         genlist = self._genlist
  2751         genlist = self._genlist
  2752         nextrev = self._consumegen().next
  2752         nextrev = self._consumegen().next
  2937         return None
  2937         return None
  2938 
  2938 
  2939 class fullreposet(_spanset):
  2939 class fullreposet(_spanset):
  2940     """a set containing all revisions in the repo
  2940     """a set containing all revisions in the repo
  2941 
  2941 
  2942     This class exists to host special optimisation.
  2942     This class exists to host special optimization.
  2943     """
  2943     """
  2944 
  2944 
  2945     def __init__(self, repo):
  2945     def __init__(self, repo):
  2946         super(fullreposet, self).__init__(repo)
  2946         super(fullreposet, self).__init__(repo)
  2947 
  2947 
  2948     def __and__(self, other):
  2948     def __and__(self, other):
  2949         """fullrepo & other -> other
  2949         """As self contains the whole repo, all of the other set should also be
  2950 
  2950         in self. Therefore `self & other = other`.
  2951         As self contains the whole repo, all of the other set should also be in
       
  2952         self. Therefor `self & other = other`.
       
  2953 
  2951 
  2954         This boldly assumes the other contains valid revs only.
  2952         This boldly assumes the other contains valid revs only.
  2955         """
  2953         """
  2956         # other not a smartset, make is so
  2954         # other not a smartset, make is so
  2957         if not util.safehasattr(other, 'isascending'):
  2955         if not util.safehasattr(other, 'isascending'):