Mercurial > hg
comparison mercurial/revset.py @ 22737:e03ece039b3a
spanset: use base implementation for __sub__
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Fri, 03 Oct 2014 00:31:18 -0500 |
parents | 3439b66f506e |
children | 70a0664008ea |
comparison
equal
deleted
inserted
replaced
22736:3439b66f506e | 22737:e03ece039b3a |
---|---|
2917 def __nonzero__(self): | 2917 def __nonzero__(self): |
2918 for r in self: | 2918 for r in self: |
2919 return True | 2919 return True |
2920 return False | 2920 return False |
2921 | 2921 |
2922 def __sub__(self, x): | |
2923 filterfunc = x.__contains__ | |
2924 return orderedlazyset(self, lambda r: not filterfunc(r), | |
2925 ascending=self.isascending()) | |
2926 | |
2927 def __add__(self, x): | 2922 def __add__(self, x): |
2928 kwargs = {} | 2923 kwargs = {} |
2929 if self.isascending() and x.isascending(): | 2924 if self.isascending() and x.isascending(): |
2930 kwargs['ascending'] = True | 2925 kwargs['ascending'] = True |
2931 if self.isdescending() and x.isdescending(): | 2926 if self.isdescending() and x.isdescending(): |