changeset 20609:56ecc82fcd67

revset: added orderedlazyset class
author Lucas Moscovicz <lmoscovicz@fb.com>
date Wed, 05 Feb 2014 15:24:08 -0800
parents a3ca1d032926
children 34bb07e70c68
files mercurial/revset.py
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revset.py	Thu Feb 27 23:17:37 2014 -0600
+++ b/mercurial/revset.py	Wed Feb 05 15:24:08 2014 -0800
@@ -2210,6 +2210,14 @@
     def set(self):
         return set([r for r in self])
 
+class orderedlazyset(lazyset):
+    """Subclass of lazyset which subset can be ordered either ascending or
+    descendingly
+    """
+    def __init__(self, subset, condition, ascending=True):
+        super(orderedlazyset, self).__init__(subset, condition)
+        self._ascending = ascending
+
 class generatorset(object):
     """Wrapper structure for generators that provides lazy membership and can
     be iterated more than once.