1753 def roots(repo, subset, x): |
1753 def roots(repo, subset, x): |
1754 """``roots(set)`` |
1754 """``roots(set)`` |
1755 Changesets in set with no parent changeset in set. |
1755 Changesets in set with no parent changeset in set. |
1756 """ |
1756 """ |
1757 s = getset(repo, fullreposet(repo), x) |
1757 s = getset(repo, fullreposet(repo), x) |
1758 subset = subset & s# baseset([r for r in s if r in subset]) |
1758 parents = repo.changelog.parentrevs |
1759 cs = _children(repo, subset, s) |
1759 def filter(r): |
1760 return subset - cs |
1760 for p in parents(r): |
|
1761 if 0 <= p and p in s: |
|
1762 return False |
|
1763 return True |
|
1764 return subset & s.filter(filter) |
1761 |
1765 |
1762 def sort(repo, subset, x): |
1766 def sort(repo, subset, x): |
1763 """``sort(set[, [-]key...])`` |
1767 """``sort(set[, [-]key...])`` |
1764 Sort set by keys. The default sort order is ascending, specify a key |
1768 Sort set by keys. The default sort order is ascending, specify a key |
1765 as ``-key`` to sort in descending order. |
1769 as ``-key`` to sort in descending order. |