mercurial/revset.py
changeset 22730 aeacc2055f0d
parent 22729 f7b0ebe6ad42
child 22731 22c669f3a7f9
equal deleted inserted replaced
22729:f7b0ebe6ad42 22730:aeacc2055f0d
  2289 
  2289 
  2290     def __sub__(self, other):
  2290     def __sub__(self, other):
  2291         """Returns a new object with the substraction of the two collections.
  2291         """Returns a new object with the substraction of the two collections.
  2292 
  2292 
  2293         This is part of the mandatory API for smartset."""
  2293         This is part of the mandatory API for smartset."""
  2294         raise NotImplementedError()
  2294         c = other.__contains__
       
  2295         return self.filter(lambda r: not c(r))
  2295 
  2296 
  2296     def filter(self, condition):
  2297     def filter(self, condition):
  2297         """Returns this smartset filtered by condition as a new smartset.
  2298         """Returns this smartset filtered by condition as a new smartset.
  2298 
  2299 
  2299         `condition` is a callable which takes a revision number and returns a
  2300         `condition` is a callable which takes a revision number and returns a