[PATCH 1 of 4] revset: added orderedlazyset class

Lucas Moscovicz lmoscovicz at fb.com
Thu Feb 27 17:54:09 CST 2014


# HG changeset patch
# User Lucas Moscovicz <lmoscovicz at fb.com>
# Date 1391642648 28800
#      Wed Feb 05 15:24:08 2014 -0800
# Node ID 8ed224ecdf558b57481b5d21cd9d4944f70dec0f
# Parent  11f983ebe4c1a2df8db42cc1bf1f8bba46b89967
revset: added orderedlazyset class

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -2204,6 +2204,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.


More information about the Mercurial-devel mailing list