diff mercurial/revset.py @ 20708:17c89e5a5627

revset: made addset 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.
author Lucas Moscovicz <lmoscovicz@fb.com>
date Wed, 12 Mar 2014 17:20:26 -0700
parents 1d5d6f622b94
children 71df845d86cf
line wrap: on
line diff
--- a/mercurial/revset.py	Wed Mar 12 17:19:46 2014 -0700
+++ b/mercurial/revset.py	Wed Mar 12 17:20:26 2014 -0700
@@ -2236,7 +2236,7 @@
         return lazyset(self, lambda r: r not in x)
 
     def __add__(self, x):
-        return lazyset(addset(self, x))
+        return lazyset(_addset(self, x))
 
     def __nonzero__(self):
         for r in self:
@@ -2307,9 +2307,14 @@
         self._subset.reverse()
         self._ascending = not self._ascending
 
-class addset(object):
-    """Wrapper structure for lazily adding two structures without losing much
+class _addset(object):
+    """Represent the addition of two sets
+
+    Wrapper structure for lazily adding two structures without losing much
     performance on the __contains__ method
+
+    This class does not duck-type baseset and it's only supposed to be used
+    internally
     """
     def __init__(self, revs1, revs2):
         self._r1 = revs1
@@ -2495,7 +2500,7 @@
             return orderedlazyset(self, lambda r: r not in x, ascending=False)
 
     def __add__(self, x):
-        return lazyset(addset(self, x))
+        return lazyset(_addset(self, x))
 
     def __len__(self):
         if not self._hiddenrevs: