equal
deleted
inserted
replaced
353 return vheads |
353 return vheads |
354 |
354 |
355 |
355 |
356 def visiblebranchmap(repo): |
356 def visiblebranchmap(repo): |
357 """return a branchmap for the visible set""" |
357 """return a branchmap for the visible set""" |
358 # XXX Recomputing this data on the fly is very slow. We should build a |
358 return repo.filtered('unserved').branchmap() |
359 # XXX cached version while computing the standard branchmap version. |
|
360 sroots = repo._phasecache.phaseroots[phases.secret] |
|
361 if sroots or repo.obsstore: |
|
362 vbranchmap = {} |
|
363 for branch, nodes in repo.branchmap().iteritems(): |
|
364 # search for secret heads. |
|
365 for n in nodes: |
|
366 if repo[n].phase() >= phases.secret: |
|
367 nodes = None |
|
368 break |
|
369 # if secret heads were found we must compute them again |
|
370 if nodes is None: |
|
371 s = repo.set('heads(branch(%s) - secret() - extinct())', |
|
372 branch) |
|
373 nodes = [c.node() for c in s] |
|
374 vbranchmap[branch] = nodes |
|
375 else: |
|
376 vbranchmap = repo.branchmap() |
|
377 return vbranchmap |
|