mercurial/phases.py
changeset 15697 21eb048edc19
parent 15696 0cb45fef99ba
child 15705 e34f4d1f0dbb
equal deleted inserted replaced
15696:0cb45fef99ba 15697:21eb048edc19
   234         else:
   234         else:
   235             return 0
   235             return 0
   236     finally:
   236     finally:
   237         lock.release()
   237         lock.release()
   238 
   238 
       
   239 def visibleheads(repo):
       
   240     """return the set of visible head of this repo"""
       
   241     # XXX we want a cache on this
       
   242     sroots = repo._phaseroots[2]
       
   243     if sroots:
       
   244         # XXX very slow revset. storing heads or secret "boundary" would help.
       
   245         revset = repo.set('heads(not (%ln::))', sroots)
       
   246 
       
   247         vheads = [ctx.node() for ctx in revset]
       
   248         if not vheads:
       
   249             vheads.append(nullid)
       
   250     else:
       
   251         vheads = repo.heads()
       
   252     return vheads
       
   253 
   239 def analyzeremotephases(repo, subset, roots):
   254 def analyzeremotephases(repo, subset, roots):
   240     """Compute phases heads and root in a subset of node from root dict
   255     """Compute phases heads and root in a subset of node from root dict
   241 
   256 
   242     * subset is heads of the subset
   257     * subset is heads of the subset
   243     * roots is {<nodeid> => phase} mapping. key and value are string.
   258     * roots is {<nodeid> => phase} mapping. key and value are string.