Show More
@@ -502,7 +502,12 def draft(repo, subset, x): | |||
|
502 | 502 | def extra(repo, subset, x): |
|
503 | 503 | """``extra(label, [value])`` |
|
504 | 504 | Changesets with the given label in the extra metadata, with the given |
|
505 |
optional value. |
|
|
505 | optional value. | |
|
506 | ||
|
507 | If `value` starts with `re:`, the remainder of the value is treated as | |
|
508 | a regular expression. To match a value that actually starts with `re:`, | |
|
509 | use the prefix `literal:`. | |
|
510 | """ | |
|
506 | 511 | |
|
507 | 512 | l = getargs(x, 1, 2, _('extra takes at least 1 and at most 2 arguments')) |
|
508 | 513 | label = getstring(l[0], _('first argument to extra must be a string')) |
@@ -510,10 +515,11 def extra(repo, subset, x): | |||
|
510 | 515 | |
|
511 | 516 | if len(l) > 1: |
|
512 | 517 | value = getstring(l[1], _('second argument to extra must be a string')) |
|
518 | kind, value, matcher = _stringmatcher(value) | |
|
513 | 519 | |
|
514 | 520 | def _matchvalue(r): |
|
515 | 521 | extra = repo[r].extra() |
|
516 |
return label in extra and (value is None or |
|
|
522 | return label in extra and (value is None or matcher(extra[label])) | |
|
517 | 523 | |
|
518 | 524 | return [r for r in subset if _matchvalue(r)] |
|
519 | 525 |
General Comments 0
You need to be logged in to leave comments.
Login now