mercurial/revset.py
changeset 20729 caa69cb223b0
parent 20728 1c8b62c0a47e
child 20730 180d47e1fb68
--- a/mercurial/revset.py	Thu Mar 13 19:12:36 2014 -0700
+++ b/mercurial/revset.py	Fri Mar 14 10:21:56 2014 -0700
@@ -2397,6 +2397,22 @@
             return orderedlazyset(self, condition, ascending=self._ascending)
         return lazyset(self, condition)
 
+    def ascending(self):
+        if self._ascending is None:
+            self.sort()
+            self._ascending = True
+        else:
+            if not self._ascending:
+                self.reverse()
+
+    def descending(self):
+        if self._ascending is None:
+            self.sort(reverse=True)
+            self._ascending = False
+        else:
+            if self._ascending:
+                self.reverse()
+
     def _iterator(self):
         """Iterate over both collections without repeating elements