Show More
@@ -1287,17 +1287,19 b' def limit(repo, subset, x):' | |||
|
1287 | 1287 | """``limit(set, [n])`` |
|
1288 | 1288 | First n members of set, defaulting to 1. |
|
1289 | 1289 | """ |
|
1290 | args = getargsdict(x, 'limit', 'set n') | |
|
1291 | if 'set' not in args: | |
|
1290 | 1292 | # i18n: "limit" is a keyword |
|
1291 |
|
|
|
1293 | raise error.ParseError(_("limit requires one or two arguments")) | |
|
1292 | 1294 | try: |
|
1293 | 1295 | lim = 1 |
|
1294 |
if |
|
|
1296 | if 'n' in args: | |
|
1295 | 1297 | # i18n: "limit" is a keyword |
|
1296 |
lim = int(getstring( |
|
|
1298 | lim = int(getstring(args['n'], _("limit requires a number"))) | |
|
1297 | 1299 | except (TypeError, ValueError): |
|
1298 | 1300 | # i18n: "limit" is a keyword |
|
1299 | 1301 | raise error.ParseError(_("limit expects a number")) |
|
1300 |
os = getset(repo, fullreposet(repo), |
|
|
1302 | os = getset(repo, fullreposet(repo), args['set']) | |
|
1301 | 1303 | result = [] |
|
1302 | 1304 | it = iter(os) |
|
1303 | 1305 | for x in xrange(lim): |
General Comments 0
You need to be logged in to leave comments.
Login now