generatorset: move iteration code into _iterator
_iterator handles the generator iteration. The `__iter__` method will need
changes to handle ordering-related information.
--- 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)