Mercurial > hg-stable
changeset 22797:61ecabeeadb3
generatorset: move iteration code into _iterator
_iterator handles the generator iteration. The `__iter__` method will need
changes to handle ordering-related information.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Fri, 03 Oct 2014 20:48:28 -0700 |
parents | 43f664bf2e1e |
children | 586d7058ea48 |
files | mercurial/revset.py |
diffstat | 1 files changed, 5 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/revset.py Fri Oct 03 20:43:48 2014 -0700 +++ b/mercurial/revset.py Fri Oct 03 20:48:28 2014 -0700 @@ -2626,10 +2626,10 @@ self._finished = False if iterasc is not None: if iterasc: - self.fastasc = self.__iter__ + self.fastasc = self._iterator self.__contains__ = self._asccontains else: - self.fastdesc = self.__iter__ + self.fastdesc = self._iterator self.__contains__ = self._desccontains def __nonzero__(self): @@ -2680,6 +2680,9 @@ return False def __iter__(self): + return self._iterator() + + def _iterator(self): if self._finished: return iter(self._genlist)