Show More
@@ -279,7 +279,8 b' def author(repo, subset, x):' | |||||
279 | """ |
|
279 | """ | |
280 | # i18n: "author" is a keyword |
|
280 | # i18n: "author" is a keyword | |
281 | n = encoding.lower(getstring(x, _("author requires a string"))) |
|
281 | n = encoding.lower(getstring(x, _("author requires a string"))) | |
282 | return [r for r in subset if n in encoding.lower(repo[r].user())] |
|
282 | kind, pattern, matcher = _substringmatcher(n) | |
|
283 | return [r for r in subset if matcher(encoding.lower(repo[r].user()))] | |||
283 |
|
284 | |||
284 | def bisect(repo, subset, x): |
|
285 | def bisect(repo, subset, x): | |
285 | """``bisect(string)`` |
|
286 | """``bisect(string)`` | |
@@ -1188,6 +1189,11 b' def _stringmatcher(pattern):' | |||||
1188 | pattern = pattern[8:] |
|
1189 | pattern = pattern[8:] | |
1189 | return 'literal', pattern, pattern.__eq__ |
|
1190 | return 'literal', pattern, pattern.__eq__ | |
1190 |
|
1191 | |||
|
1192 | def _substringmatcher(pattern): | |||
|
1193 | kind, pattern, matcher = _stringmatcher(pattern) | |||
|
1194 | if kind == 'literal': | |||
|
1195 | matcher = lambda s: pattern in s | |||
|
1196 | return kind, pattern, matcher | |||
1191 |
|
1197 | |||
1192 | def tag(repo, subset, x): |
|
1198 | def tag(repo, subset, x): | |
1193 | """``tag([name])`` |
|
1199 | """``tag([name])`` | |
@@ -1219,6 +1225,10 b' def tagged(repo, subset, x):' | |||||
1219 | def user(repo, subset, x): |
|
1225 | def user(repo, subset, x): | |
1220 | """``user(string)`` |
|
1226 | """``user(string)`` | |
1221 | User name contains string. The match is case-insensitive. |
|
1227 | User name contains string. The match is case-insensitive. | |
|
1228 | ||||
|
1229 | If `string` starts with `re:`, the remainder of the string is treated as | |||
|
1230 | a regular expression. To match a user that actually contains `re:`, use | |||
|
1231 | the prefix `literal:`. | |||
1222 | """ |
|
1232 | """ | |
1223 | return author(repo, subset, x) |
|
1233 | return author(repo, subset, x) | |
1224 |
|
1234 |
General Comments 0
You need to be logged in to leave comments.
Login now