[PATCH 1 of 4] revset: added orderedlazyset class

Lucas Moscovicz lmoscovicz at fb.com
Thu Feb 27 16:12:48 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 730d872f70ae8b6d7b509cc31c6f85f02c1a1186
# 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, order=None):
+        super(orderedlazyset, self).__init__(subset, condition)
+        self._order = order
+
 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