changeset 22494:14f6cebfcb8a

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.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Tue, 16 Sep 2014 23:42:41 -0700
parents 5e16fe6fdd32
children 668b26d32bf6
files mercurial/revset.py
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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()