Show More
@@ -143,6 +143,11 b' class changelog(revlog.revlog):' | |||||
143 | if i not in self.filteredrevs: |
|
143 | if i not in self.filteredrevs: | |
144 | return self.node(i) |
|
144 | return self.node(i) | |
145 |
|
145 | |||
|
146 | def __contains__(self, rev): | |||
|
147 | """filtered version of revlog.__contains__""" | |||
|
148 | return (revlog.revlog.__contains__(self, rev) | |||
|
149 | and rev not in self.filteredrevs) | |||
|
150 | ||||
146 | def __iter__(self): |
|
151 | def __iter__(self): | |
147 | """filtered version of revlog.__iter__""" |
|
152 | """filtered version of revlog.__iter__""" | |
148 | if len(self.filteredrevs) == 0: |
|
153 | if len(self.filteredrevs) == 0: |
@@ -277,6 +277,8 b' class revlog(object):' | |||||
277 |
|
277 | |||
278 | def tip(self): |
|
278 | def tip(self): | |
279 | return self.node(len(self.index) - 2) |
|
279 | return self.node(len(self.index) - 2) | |
|
280 | def __contains__(self, rev): | |||
|
281 | return 0 <= rev < len(self) | |||
280 | def __len__(self): |
|
282 | def __len__(self): | |
281 | return len(self.index) - 1 |
|
283 | return len(self.index) - 1 | |
282 | def __iter__(self): |
|
284 | def __iter__(self): |
General Comments 0
You need to be logged in to leave comments.
Login now