Comments
Patch
@@ -147,11 +147,23 @@
return filterediter()
- def revs(self, start=0, stop=None):
+ def revs(self, start=0, stop=None, count=None):
"""filtered version of revlog.revs"""
+ if count is not None:
+ if count < 0:
+ stop = 0
+ elif count > 0:
+ stop = len(self)
+ else:
+ stop = start
+
+ curcount = 0
for i in super(changelog, self).revs(start, stop):
if i not in self.filteredrevs:
yield i
+ curcount += 1
+ if count is not None and curcount >= abs(count):
+ break
@util.propertycache
def nodemap(self):