mercurial/discovery.py
changeset 18104 a2cebd3e4daa
parent 18103 83cb1a1a705d
child 18120 88990d3e3d75
equal deleted inserted replaced
18103:83cb1a1a705d 18104:a2cebd3e4daa
   336     if unsynced:
   336     if unsynced:
   337         repo.ui.warn(_("note: unsynced remote changes!\n"))
   337         repo.ui.warn(_("note: unsynced remote changes!\n"))
   338 
   338 
   339 def visibleheads(repo):
   339 def visibleheads(repo):
   340     """return the set of visible head of this repo"""
   340     """return the set of visible head of this repo"""
   341     # XXX we want a cache on this
   341     return repo.filtered('unserved').heads()
   342     sroots = repo._phasecache.phaseroots[phases.secret]
       
   343     if sroots or repo.obsstore:
       
   344         # XXX very slow revset. storing heads or secret "boundary"
       
   345         # would help.
       
   346         revset = repo.set('heads(not (%ln:: + extinct()))', sroots)
       
   347 
       
   348         vheads = [ctx.node() for ctx in revset]
       
   349         if not vheads:
       
   350             vheads.append(nullid)
       
   351     else:
       
   352         vheads = repo.heads()
       
   353     return vheads
       
   354 
   342 
   355 
   343 
   356 def visiblebranchmap(repo):
   344 def visiblebranchmap(repo):
   357     """return a branchmap for the visible set"""
   345     """return a branchmap for the visible set"""
   358     return repo.filtered('unserved').branchmap()
   346     return repo.filtered('unserved').branchmap()