##// END OF EJS Templates
revset-limit: remove user of baseset.append...
Pierre-Yves David -
r22804:5385314e default
parent child Browse files
Show More
@@ -1015,16 +1015,16 b' def limit(repo, subset, x):'
1015 raise error.ParseError(_("limit expects a number"))
1015 raise error.ParseError(_("limit expects a number"))
1016 ss = subset.set()
1016 ss = subset.set()
1017 os = getset(repo, spanset(repo), l[0])
1017 os = getset(repo, spanset(repo), l[0])
1018 bs = baseset()
1018 result = []
1019 it = iter(os)
1019 it = iter(os)
1020 for x in xrange(lim):
1020 for x in xrange(lim):
1021 try:
1021 try:
1022 y = it.next()
1022 y = it.next()
1023 if y in ss:
1023 if y in ss:
1024 bs.append(y)
1024 result.append(y)
1025 except (StopIteration):
1025 except (StopIteration):
1026 break
1026 break
1027 return bs
1027 return baseset(result)
1028
1028
1029 def last(repo, subset, x):
1029 def last(repo, subset, x):
1030 """``last(set, [n])``
1030 """``last(set, [n])``
General Comments 0
You need to be logged in to leave comments. Login now