mirror of
https://github.com/facebook/sapling.git
synced 2024-10-06 23:07:18 +03:00
phases: add a function to compute visible heads
This function will be used to hide secret changeset.
This commit is contained in:
parent
3d9a6a91e3
commit
1fd5692284
@ -236,6 +236,21 @@ def pushphase(repo, nhex, oldphasestr, newphasestr):
|
||||
finally:
|
||||
lock.release()
|
||||
|
||||
def visibleheads(repo):
|
||||
"""return the set of visible head of this repo"""
|
||||
# XXX we want a cache on this
|
||||
sroots = repo._phaseroots[2]
|
||||
if sroots:
|
||||
# XXX very slow revset. storing heads or secret "boundary" would help.
|
||||
revset = repo.set('heads(not (%ln::))', sroots)
|
||||
|
||||
vheads = [ctx.node() for ctx in revset]
|
||||
if not vheads:
|
||||
vheads.append(nullid)
|
||||
else:
|
||||
vheads = repo.heads()
|
||||
return vheads
|
||||
|
||||
def analyzeremotephases(repo, subset, roots):
|
||||
"""Compute phases heads and root in a subset of node from root dict
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user