Show More
@@ -944,8 +944,17 b' def limit(repo, subset, x):' | |||||
944 | # i18n: "limit" is a keyword |
|
944 | # i18n: "limit" is a keyword | |
945 | raise error.ParseError(_("limit expects a number")) |
|
945 | raise error.ParseError(_("limit expects a number")) | |
946 | ss = subset.set() |
|
946 | ss = subset.set() | |
947 |
os = getset(repo, baseset(repo), l[0]) |
|
947 | os = getset(repo, baseset(repo), l[0]) | |
948 | return baseset([r for r in os if r in ss]) |
|
948 | bs = baseset([]) | |
|
949 | it = iter(os) | |||
|
950 | for x in xrange(lim): | |||
|
951 | try: | |||
|
952 | y = it.next() | |||
|
953 | if y in ss: | |||
|
954 | bs.append(y) | |||
|
955 | except (StopIteration): | |||
|
956 | break | |||
|
957 | return bs | |||
949 |
|
958 | |||
950 | def last(repo, subset, x): |
|
959 | def last(repo, subset, x): | |
951 | """``last(set, [n])`` |
|
960 | """``last(set, [n])`` |
General Comments 0
You need to be logged in to leave comments.
Login now