Mercurial > public > mercurial-scm > hg-stable
diff mercurial/phases.py @ 34819:eb6375651974
phase: gather remote phase information in a summary object
We keep useful phase information around. The data will be reused with detecting
push-race in later changesets.
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Wed, 11 Oct 2017 18:39:04 +0200 |
parents | e2c42f751b06 |
children | eb1b964b354b |
line wrap: on
line diff
--- a/mercurial/phases.py Wed Oct 11 18:39:34 2017 +0200 +++ b/mercurial/phases.py Wed Oct 11 18:39:04 2017 +0200 @@ -604,6 +604,27 @@ publicheads = newheads(repo, subset, draftroots) return publicheads, draftroots +class remotephasessummary(object): + """summarize phase information on the remote side + + :publishing: True is the remote is publishing + :publicheads: list of remote public phase heads (nodes) + :draftheads: list of remote draft phase heads (nodes) + :draftroots: list of remote draft phase root (nodes) + """ + + def __init__(self, repo, remotesubset, remoteroots): + unfi = repo.unfiltered() + self._allremoteroots = remoteroots + + self.publishing = remoteroots.get('publishing', False) + + ana = analyzeremotephases(repo, remotesubset, remoteroots) + self.publicheads, self.draftroots = ana + # Get the list of all "heads" revs draft on remote + dheads = unfi.set('heads(%ln::%ln)', self.draftroots, remotesubset) + self.draftheads = [c.node() for c in dheads] + def newheads(repo, heads, roots): """compute new head of a subset minus another