1502 ps -= {node.nullrev} |
1502 ps -= {node.nullrev} |
1503 return subset & ps |
1503 return subset & ps |
1504 |
1504 |
1505 def _phase(repo, subset, *targets): |
1505 def _phase(repo, subset, *targets): |
1506 """helper to select all rev in <targets> phases""" |
1506 """helper to select all rev in <targets> phases""" |
1507 s = repo._phasecache.getrevset(repo, targets) |
1507 return repo._phasecache.getrevset(repo, targets, subset) |
1508 return subset & s |
|
1509 |
1508 |
1510 @predicate('draft()', safe=True) |
1509 @predicate('draft()', safe=True) |
1511 def draft(repo, subset, x): |
1510 def draft(repo, subset, x): |
1512 """Changeset in draft phase.""" |
1511 """Changeset in draft phase.""" |
1513 # i18n: "draft" is a keyword |
1512 # i18n: "draft" is a keyword |
1610 @predicate('public()', safe=True) |
1609 @predicate('public()', safe=True) |
1611 def public(repo, subset, x): |
1610 def public(repo, subset, x): |
1612 """Changeset in public phase.""" |
1611 """Changeset in public phase.""" |
1613 # i18n: "public" is a keyword |
1612 # i18n: "public" is a keyword |
1614 getargs(x, 0, 0, _("public takes no arguments")) |
1613 getargs(x, 0, 0, _("public takes no arguments")) |
1615 phase = repo._phasecache.phase |
1614 return _phase(repo, subset, phases.public) |
1616 target = phases.public |
|
1617 condition = lambda r: phase(repo, r) == target |
|
1618 return subset.filter(condition, condrepr=('<phase %r>', target), |
|
1619 cache=False) |
|
1620 |
1615 |
1621 @predicate('remote([id [,path]])', safe=False) |
1616 @predicate('remote([id [,path]])', safe=False) |
1622 def remote(repo, subset, x): |
1617 def remote(repo, subset, x): |
1623 """Local revision that corresponds to the given identifier in a |
1618 """Local revision that corresponds to the given identifier in a |
1624 remote repository, if present. Here, the '.' identifier is a |
1619 remote repository, if present. Here, the '.' identifier is a |