mercurial/discovery.py
changeset 18104 a2cebd3e4daa
parent 18103 83cb1a1a705d
child 18120 88990d3e3d75
--- a/mercurial/discovery.py	Mon Dec 17 17:42:34 2012 +0100
+++ b/mercurial/discovery.py	Mon Dec 17 17:27:12 2012 +0100
@@ -338,19 +338,7 @@
 
 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):