[PATCH 2 of 2] revset: added __add__ method to baseset class

Lucas Moscovicz lmoscovicz at fb.com
Thu Feb 6 13:42:23 CST 2014


# HG changeset patch
# User Lucas Moscovicz <lmoscovicz at fb.com>
# Date 1391715436 28800
#      Thu Feb 06 11:37:16 2014 -0800
# Node ID 3ab8d986e51808fc3e56e63125a6a38a9d0d2418
# Parent  eacef209ab9af32854c4f9255bd5552ffb06b23f
revset: added __add__ method to baseset class

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -2055,5 +2055,10 @@
             x = x.set()
         return baseset([y for y in s 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()


More information about the Mercurial-devel mailing list