revset: added reverse method to addset
authorLucas Moscovicz <lmoscovicz@fb.com>
Thu, 13 Mar 2014 18:57:30 -0700
changeset 20723 fb9852c46a42
parent 20722 6894223ebc38
child 20724 e9a64b3f2925
revset: added reverse method to addset This method is needed to duck type generatorset.
mercurial/revset.py
--- a/mercurial/revset.py	Thu Mar 13 13:29:04 2014 -0700
+++ b/mercurial/revset.py	Thu Mar 13 18:57:30 2014 -0700
@@ -2409,6 +2409,11 @@
     def set(self):
         return self
 
+    def reverse(self):
+        self._list.reverse()
+        if self._ascending is not None:
+            self._ascending = not self._ascending
+
 class _generatorset(object):
     """Wrap a generator for lazy iteration