revset: document the choice made in __generatorset.__iter__
authorPierre-Yves David <pierre-yves.david@fb.com>
Tue, 16 Sep 2014 23:42:41 -0700
changeset 22494 14f6cebfcb8a
parent 22491 5e16fe6fdd32
child 22495 668b26d32bf6
revset: document the choice made in __generatorset.__iter__ The method code looks a bit ugly but has good reasons to. We document them to prevent naive refactoring in the future.
mercurial/revset.py
--- a/mercurial/revset.py	Sat Aug 30 02:25:23 2014 +0200
+++ b/mercurial/revset.py	Tue Sep 16 23:42:41 2014 -0700
@@ -2648,6 +2648,12 @@
                 yield x
             return
 
+        # We have to use this complex iteration strategy to allow multiple
+        # iterations at the same time. We need to be able to catch revision
+        # removed from `consumegen` and added to genlist in another instance.
+        #
+        # Getting rid of it would provide an about 15% speed up on this
+        # iteration.
         i = 0
         genlist = self._genlist
         consume = self._consumegen()