changeset 22730:aeacc2055f0d

abstractsmartset: add default implementation for __sub__
author Pierre-Yves David <pierre-yves.david@fb.com>
date Thu, 02 Oct 2014 19:22:17 -0500
parents f7b0ebe6ad42
children 22c669f3a7f9
files mercurial/revset.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revset.py	Thu Oct 02 19:22:03 2014 -0500
+++ b/mercurial/revset.py	Thu Oct 02 19:22:17 2014 -0500
@@ -2291,7 +2291,8 @@
         """Returns a new object with the substraction of the two collections.
 
         This is part of the mandatory API for smartset."""
-        raise NotImplementedError()
+        c = other.__contains__
+        return self.filter(lambda r: not c(r))
 
     def filter(self, condition):
         """Returns this smartset filtered by condition as a new smartset.