mercurial/phases.py
branchstable
changeset 16535 39d1f83eb05d
parent 16293 bc1d949261c4
child 16588 72319bfd7966
equal deleted inserted replaced
16534:11212babc690 16535:39d1f83eb05d
   261             vheads.append(nullid)
   261             vheads.append(nullid)
   262     else:
   262     else:
   263         vheads = repo.heads()
   263         vheads = repo.heads()
   264     return vheads
   264     return vheads
   265 
   265 
       
   266 def visiblebranchmap(repo):
       
   267     """return a branchmap for the visible set"""
       
   268     # XXX Recomputing this data on the fly is very slow.  We should build a
       
   269     # XXX cached version while computin the standard branchmap version.
       
   270     sroots = repo._phaseroots[secret]
       
   271     if sroots:
       
   272         vbranchmap = {}
       
   273         for branch, nodes in  repo.branchmap().iteritems():
       
   274             # search for secret heads.
       
   275             for n in nodes:
       
   276                 if repo[n].phase() >= secret:
       
   277                     nodes = None
       
   278                     break
       
   279             # if secreat heads where found we must compute them again
       
   280             if nodes is None:
       
   281                 s = repo.set('heads(branch(%s) - secret())', branch)
       
   282                 nodes = [c.node() for c in s]
       
   283             vbranchmap[branch] = nodes
       
   284     else:
       
   285         vbranchmap = repo.branchmap()
       
   286     return vbranchmap
       
   287 
   266 def analyzeremotephases(repo, subset, roots):
   288 def analyzeremotephases(repo, subset, roots):
   267     """Compute phases heads and root in a subset of node from root dict
   289     """Compute phases heads and root in a subset of node from root dict
   268 
   290 
   269     * subset is heads of the subset
   291     * subset is heads of the subset
   270     * roots is {<nodeid> => phase} mapping. key and value are string.
   292     * roots is {<nodeid> => phase} mapping. key and value are string.