Mercurial > forks > mercurial
changeset 53187:8916d51bd551
phases: directly call reachableroot on the changelog
We don't need to go through the richer function and to build a baseset. We can
directly call the changelog method.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 16 Apr 2025 11:33:30 +0200 |
parents | 4a40ce4da3f0 |
children | 13cf4192d252 |
files | mercurial/phases.py |
diffstat | 1 files changed, 5 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/phases.py Wed Apr 16 11:32:35 2025 +0200 +++ b/mercurial/phases.py Wed Apr 16 11:33:30 2025 +0200 @@ -1214,9 +1214,6 @@ * `heads`: define the first subset * `roots`: define the second we subtract from the first""" - # prevent an import cycle - # phases > dagop > patch > copies > scmutil > obsolete > obsutil > phases - from . import dagop if not roots: return heads @@ -1241,7 +1238,11 @@ # remove candidate that are ancestors of other heads new_heads.update(candidates) prunestart = repo.revs(b"parents(%ld) and not null", new_heads) - pruned = dagop.reachableroots(repo, candidates, prunestart) + pruned = repo.changelog.reachableroots( + candidates.min(), + list(candidates), + list(prunestart), + ) new_heads.difference_update(pruned) # PERF-XXX: do we actually need a sorted list here? Could we simply return