revset: added __add__ method to baseset class
authorLucas Moscovicz <lmoscovicz@fb.com>
Thu, 06 Feb 2014 11:37:16 -0800
changeset 20417 827561a99569
parent 20416 e72bcc245ecb
child 20418 454c143b9955
revset: added __add__ method to baseset class
mercurial/revset.py
--- a/mercurial/revset.py	Thu Feb 06 11:33:36 2014 -0800
+++ b/mercurial/revset.py	Thu Feb 06 11:37:16 2014 -0800
@@ -2067,5 +2067,10 @@
             x = x.set()
         return baseset([y for y in self if y in x])
 
+    def __add__(self, x):
+        s = self.set()
+        l = [r for r in x if r not in s]
+        return baseset(list(self) + l)
+
 # tell hggettext to extract docstrings from these functions:
 i18nfunctions = symbols.values()