##// END OF EJS Templates
revset: refactor the non-public phase code...
Pierre-Yves David -
r25621:21a87469 default
parent child Browse files
Show More
@@ -803,16 +803,6 b' def divergent(repo, subset, x):'
803 divergent = obsmod.getrevs(repo, 'divergent')
803 divergent = obsmod.getrevs(repo, 'divergent')
804 return subset & divergent
804 return subset & divergent
805
805
806 def draft(repo, subset, x):
807 """``draft()``
808 Changeset in draft phase."""
809 # i18n: "draft" is a keyword
810 getargs(x, 0, 0, _("draft takes no arguments"))
811 phase = repo._phasecache.phase
812 target = phases.draft
813 condition = lambda r: phase(repo, r) == target
814 return subset.filter(condition, cache=False)
815
816 def extinct(repo, subset, x):
806 def extinct(repo, subset, x):
817 """``extinct()``
807 """``extinct()``
818 Obsolete changesets with obsolete descendants only.
808 Obsolete changesets with obsolete descendants only.
@@ -1472,6 +1462,28 b' def parents(repo, subset, x):'
1472 ps -= set([node.nullrev])
1462 ps -= set([node.nullrev])
1473 return subset & ps
1463 return subset & ps
1474
1464
1465 def _phase(repo, subset, target):
1466 """helper to select all rev in phase <target>"""
1467 phase = repo._phasecache.phase
1468 condition = lambda r: phase(repo, r) == target
1469 return subset.filter(condition, cache=False)
1470
1471 def draft(repo, subset, x):
1472 """``draft()``
1473 Changeset in draft phase."""
1474 # i18n: "draft" is a keyword
1475 getargs(x, 0, 0, _("draft takes no arguments"))
1476 target = phases.draft
1477 return _phase(repo, subset, target)
1478
1479 def secret(repo, subset, x):
1480 """``secret()``
1481 Changeset in secret phase."""
1482 # i18n: "secret" is a keyword
1483 getargs(x, 0, 0, _("secret takes no arguments"))
1484 target = phases.secret
1485 return _phase(repo, subset, target)
1486
1475 def parentspec(repo, subset, x, n):
1487 def parentspec(repo, subset, x, n):
1476 """``set^0``
1488 """``set^0``
1477 The set.
1489 The set.
@@ -1730,16 +1742,6 b' def roots(repo, subset, x):'
1730 cs = _children(repo, subset, s)
1742 cs = _children(repo, subset, s)
1731 return subset - cs
1743 return subset - cs
1732
1744
1733 def secret(repo, subset, x):
1734 """``secret()``
1735 Changeset in secret phase."""
1736 # i18n: "secret" is a keyword
1737 getargs(x, 0, 0, _("secret takes no arguments"))
1738 phase = repo._phasecache.phase
1739 target = phases.secret
1740 condition = lambda r: phase(repo, r) == target
1741 return subset.filter(condition, cache=False)
1742
1743 def sort(repo, subset, x):
1745 def sort(repo, subset, x):
1744 """``sort(set[, [-]key...])``
1746 """``sort(set[, [-]key...])``
1745 Sort set by keys. The default sort order is ascending, specify a key
1747 Sort set by keys. The default sort order is ascending, specify a key
General Comments 0
You need to be logged in to leave comments. Login now