diff --git a/mercurial/discovery.py b/mercurial/discovery.py --- a/mercurial/discovery.py +++ b/mercurial/discovery.py @@ -431,6 +431,7 @@ def _postprocessobsolete(pushop, futurec repo = pushop.repo unfi = repo.unfiltered() tonode = unfi.changelog.node + torev = unfi.changelog.rev public = phases.public getphase = unfi._phasecache.phase ispublic = (lambda r: getphase(unfi, r) == public) @@ -460,8 +461,7 @@ def _postprocessobsolete(pushop, futurec while localcandidate: nh = localcandidate.pop() # run this check early to skip the evaluation of the whole branch - if (nh in futurecommon - or unfi[nh].phase() <= public): + if (nh in futurecommon or ispublic(torev(nh))): newhs.add(nh) continue