diff --git a/mercurial/discovery.py b/mercurial/discovery.py --- a/mercurial/discovery.py +++ b/mercurial/discovery.py @@ -338,19 +338,7 @@ def checkheads(repo, remote, outgoing, r def visibleheads(repo): """return the set of visible head of this repo""" - # XXX we want a cache on this - sroots = repo._phasecache.phaseroots[phases.secret] - if sroots or repo.obsstore: - # XXX very slow revset. storing heads or secret "boundary" - # would help. - revset = repo.set('heads(not (%ln:: + extinct()))', sroots) - - vheads = [ctx.node() for ctx in revset] - if not vheads: - vheads.append(nullid) - else: - vheads = repo.heads() - return vheads + return repo.filtered('unserved').heads() def visiblebranchmap(repo): diff --git a/tests/test-obsolete-divergent.t b/tests/test-obsolete-divergent.t --- a/tests/test-obsolete-divergent.t +++ b/tests/test-obsolete-divergent.t @@ -91,7 +91,7 @@ check that mercurial refuse to push $ hg push ../other pushing to ../other searching for changes - abort: push includes divergent changeset: 82623d38b9ba! + abort: push includes divergent changeset: 392fd25390da! [255] $ cd .. diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t --- a/tests/test-obsolete.t +++ b/tests/test-obsolete.t @@ -176,6 +176,7 @@ And that we can't push bumped changeset $ hg push ../tmpa -r 0 --force #(make repo related) pushing to ../tmpa searching for changes + warning: repository is unrelated adding changesets adding manifests adding file changes