changeset 20658:d7e96dd8e995

revset: added sort method to orderedlazyset
author Lucas Moscovicz <lmoscovicz@fb.com>
date Tue, 25 Feb 2014 10:36:23 -0800
parents 379e89e4b079
children 4f68acdb22ff
files mercurial/revset.py
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revset.py	Fri Feb 07 08:44:18 2014 -0800
+++ b/mercurial/revset.py	Tue Feb 25 10:36:23 2014 -0800
@@ -2277,6 +2277,15 @@
         return orderedlazyset(self, lambda r: r not in x,
                 ascending=self._ascending)
 
+    def sort(self, reverse=False):
+        if reverse:
+            if self._ascending:
+                self._subset.sort(reverse=reverse)
+        else:
+            if not self._ascending:
+                self._subset.sort(reverse=reverse)
+        self._ascending = not reverse
+
     def reverse(self):
         self._subset.reverse()
         self._ascending = not self._ascending