revset: made descgeneratorset a private class
authorLucas Moscovicz <lmoscovicz@fb.com>
Wed, 12 Mar 2014 17:19:46 -0700
changeset 20707 1d5d6f622b94
parent 20706 efb34b066e7a
child 20708 17c89e5a5627
revset: made descgeneratorset a private class This class is not supposed to be used outside revset.py since it only wraps content that is used by baseset typed classes. It only gets created by revset operations or private methods.
mercurial/revset.py
--- a/mercurial/revset.py	Wed Mar 12 17:18:54 2014 -0700
+++ b/mercurial/revset.py	Wed Mar 12 17:19:46 2014 -0700
@@ -46,7 +46,7 @@
                     if parent != node.nullrev:
                         heapq.heappush(h, -parent)
 
-    return descgeneratorset(iterate())
+    return _descgeneratorset(iterate())
 
 def _revdescendants(repo, revs, followfirst):
     """Like revlog.descendants() but supports followfirst."""
@@ -2413,9 +2413,14 @@
         self._cache[x] = False
         return False
 
-class descgeneratorset(_generatorset):
-    """ Same structure as _generatorset but stops iterating after it goes past
+class _descgeneratorset(_generatorset):
+    """Wrap a generator of descending elements for lazy iteration
+
+    Same structure as _generatorset but stops iterating after it goes past
     the value when asked for membership and the element is not contained
+
+    This class does not duck-type baseset and it's only supposed to be used
+    internally
     """
     def __contains__(self, x):
         if x in self._cache: