##// END OF EJS Templates
revset: use 'next()' to detect end of iteration in 'limit'...
Pierre-Yves David -
r25144:81a39544 default
parent child Browse files
Show More
@@ -1145,12 +1145,11 def limit(repo, subset, x):
1145 result = []
1145 result = []
1146 it = iter(os)
1146 it = iter(os)
1147 for x in xrange(lim):
1147 for x in xrange(lim):
1148 try:
1148 y = next(it, None)
1149 y = it.next()
1149 if y is None:
1150 if y in ss:
1150 break
1151 elif y in ss:
1151 result.append(y)
1152 result.append(y)
1152 except (StopIteration):
1153 break
1154 return baseset(result)
1153 return baseset(result)
1155
1154
1156 def last(repo, subset, x):
1155 def last(repo, subset, x):
General Comments 0
You need to be logged in to leave comments. Login now