equal
deleted
inserted
replaced
135 boolean. Optional `condrepr` provides a printable representation of |
135 boolean. Optional `condrepr` provides a printable representation of |
136 the given `condition`. |
136 the given `condition`. |
137 |
137 |
138 This is part of the mandatory API for smartset.""" |
138 This is part of the mandatory API for smartset.""" |
139 # builtin cannot be cached. but do not needs to |
139 # builtin cannot be cached. but do not needs to |
140 if cache and util.safehasattr(condition, '__code__'): |
140 if cache and hasattr(condition, '__code__'): |
141 condition = util.cachefunc(condition) |
141 condition = util.cachefunc(condition) |
142 return filteredset(self, condition, condrepr) |
142 return filteredset(self, condition, condrepr) |
143 |
143 |
144 def slice(self, start, stop): |
144 def slice(self, start, stop): |
145 """Return new smartset that contains selected elements from this set""" |
145 """Return new smartset that contains selected elements from this set""" |
1125 in self. Therefore `self & other = other`. |
1125 in self. Therefore `self & other = other`. |
1126 |
1126 |
1127 This boldly assumes the other contains valid revs only. |
1127 This boldly assumes the other contains valid revs only. |
1128 """ |
1128 """ |
1129 # other not a smartset, make is so |
1129 # other not a smartset, make is so |
1130 if not util.safehasattr(other, 'isascending'): |
1130 if not hasattr(other, 'isascending'): |
1131 # filter out hidden revision |
1131 # filter out hidden revision |
1132 # (this boldly assumes all smartset are pure) |
1132 # (this boldly assumes all smartset are pure) |
1133 # |
1133 # |
1134 # `other` was used with "&", let's assume this is a set like |
1134 # `other` was used with "&", let's assume this is a set like |
1135 # object. |
1135 # object. |