comparison mercurial/revset.py @ 20417:827561a99569

revset: added __add__ method to baseset class
author Lucas Moscovicz <lmoscovicz@fb.com>
date Thu, 06 Feb 2014 11:37:16 -0800
parents e72bcc245ecb
children 454c143b9955
comparison
equal deleted inserted replaced
20416:e72bcc245ecb 20417:827561a99569
2065 def __and__(self, x): 2065 def __and__(self, x):
2066 if isinstance(x, baseset): 2066 if isinstance(x, baseset):
2067 x = x.set() 2067 x = x.set()
2068 return baseset([y for y in self if y in x]) 2068 return baseset([y for y in self if y in x])
2069 2069
2070 def __add__(self, x):
2071 s = self.set()
2072 l = [r for r in x if r not in s]
2073 return baseset(list(self) + l)
2074
2070 # tell hggettext to extract docstrings from these functions: 2075 # tell hggettext to extract docstrings from these functions:
2071 i18nfunctions = symbols.values() 2076 i18nfunctions = symbols.values()