Show More
@@ -1162,6 +1162,8 b' def limit(repo, subset, x):' | |||
|
1162 | 1162 | raise error.ParseError(_("limit requires one to three arguments")) |
|
1163 | 1163 | # i18n: "limit" is a keyword |
|
1164 | 1164 | lim = getinteger(args.get('n'), _("limit expects a number"), default=1) |
|
1165 | if lim < 0: | |
|
1166 | raise error.ParseError(_("negative number to select")) | |
|
1165 | 1167 | # i18n: "limit" is a keyword |
|
1166 | 1168 | ofs = getinteger(args.get('offset'), _("limit expects a number"), default=0) |
|
1167 | 1169 | if ofs < 0: |
@@ -1192,6 +1194,8 b' def last(repo, subset, x):' | |||
|
1192 | 1194 | if len(l) == 2: |
|
1193 | 1195 | # i18n: "last" is a keyword |
|
1194 | 1196 | lim = getinteger(l[1], _("last expects a number")) |
|
1197 | if lim < 0: | |
|
1198 | raise error.ParseError(_("negative number to select")) | |
|
1195 | 1199 | os = getset(repo, fullreposet(repo), l[0]) |
|
1196 | 1200 | os.reverse() |
|
1197 | 1201 | result = [] |
@@ -1001,7 +1001,14 b' Test first (=limit) and last' | |||
|
1001 | 1001 | $ log 'limit(all(), 1, -1)' |
|
1002 | 1002 | hg: parse error: negative offset |
|
1003 | 1003 | [255] |
|
1004 | ||
|
1004 | $ log 'limit(all(), -1)' | |
|
1005 | hg: parse error: negative number to select | |
|
1006 | [255] | |
|
1007 | $ log 'limit(all(), 0)' | |
|
1008 | ||
|
1009 | $ log 'last(all(), -1)' | |
|
1010 | hg: parse error: negative number to select | |
|
1011 | [255] | |
|
1005 | 1012 | $ log 'last(all(), 0)' |
|
1006 | 1013 | $ log 'last(all(), 1)' |
|
1007 | 1014 | 9 |
General Comments 0
You need to be logged in to leave comments.
Login now