comparison mercurial/revset.py @ 22728:bf5ff3686100

abstractsmartset: add default implementation for __and__
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 02 Oct 2014 19:21:40 -0500
parents 0f3e240a1c35
children f7b0ebe6ad42
comparison
equal deleted inserted replaced
22727:0f3e240a1c35 22728:bf5ff3686100
2272 2272
2273 def __and__(self, other): 2273 def __and__(self, other):
2274 """Returns a new object with the intersection of the two collections. 2274 """Returns a new object with the intersection of the two collections.
2275 2275
2276 This is part of the mandatory API for smartset.""" 2276 This is part of the mandatory API for smartset."""
2277 raise NotImplementedError() 2277 return self.filter(other.__contains__)
2278 2278
2279 def __add__(self, other): 2279 def __add__(self, other):
2280 """Returns a new object with the union of the two collections. 2280 """Returns a new object with the union of the two collections.
2281 2281
2282 This is part of the mandatory API for smartset.""" 2282 This is part of the mandatory API for smartset."""