464 Changeset in draft phase.""" |
464 Changeset in draft phase.""" |
465 getargs(x, 0, 0, _("draft takes no arguments")) |
465 getargs(x, 0, 0, _("draft takes no arguments")) |
466 pc = repo._phasecache |
466 pc = repo._phasecache |
467 return [r for r in subset if pc.phase(repo, r) == phases.draft] |
467 return [r for r in subset if pc.phase(repo, r) == phases.draft] |
468 |
468 |
|
469 def extra(repo, subset, x): |
|
470 """``extra(label, [value])`` |
|
471 Changesets with the given label in the extra metadata, with the given |
|
472 optional value.""" |
|
473 |
|
474 l = getargs(x, 1, 2, _('extra takes at least 1 and at most 2 arguments')) |
|
475 label = getstring(l[0], _('first argument to extra must be a string')) |
|
476 value = None |
|
477 |
|
478 if len(l) > 1: |
|
479 value = getstring(l[1], _('second argument to extra must be a string')) |
|
480 |
|
481 def _matchvalue(r): |
|
482 extra = repo[r].extra() |
|
483 return label in extra and (value is None or value == extra[label]) |
|
484 |
|
485 return [r for r in subset if _matchvalue(r)] |
|
486 |
469 def filelog(repo, subset, x): |
487 def filelog(repo, subset, x): |
470 """``filelog(pattern)`` |
488 """``filelog(pattern)`` |
471 Changesets connected to the specified filelog. |
489 Changesets connected to the specified filelog. |
472 """ |
490 """ |
473 |
491 |