changeset 22729:f7b0ebe6ad42

abstractsmartset: add default implementation for __add__
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 02 Oct 2014 19:22:03 -0500
parents bf5ff3686100
children aeacc2055f0d
files mercurial/revset.py
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revset.py	Thu Oct 02 19:21:40 2014 -0500
+++ b/mercurial/revset.py	Thu Oct 02 19:22:03 2014 -0500
@@ -2280,7 +2280,12 @@
         """Returns a new object with the union of the two collections.
 
         This is part of the mandatory API for smartset."""
-        raise NotImplementedError()
+        kwargs = {}
+        if self.isascending() and other.isascending():
+            kwargs['ascending'] = True
+        if self.isdescending() and other.isdescending():
+            kwargs['ascending'] = False
+        return _addset(self, other, **kwargs)
 
     def __sub__(self, other):
         """Returns a new object with the substraction of the two collections.