diff --git a/mercurial/setdiscovery.py b/mercurial/setdiscovery.py --- a/mercurial/setdiscovery.py +++ b/mercurial/setdiscovery.py @@ -173,11 +173,11 @@ (all tracked revisions are known locally) """ - def __init__(self, repo, targetheads): + def __init__(self, repo, targetheads, srvheads): self._repo = repo self._targetheads = targetheads - self._common = repo.changelog.incrementalmissingrevs() - self._undecided = None + self._common = repo.changelog.incrementalmissingrevs(srvheads) + self.undecided = set(self._common.missingancestors(self._targetheads)) self.missing = set() def addcommons(self, commons): @@ -212,14 +212,7 @@ def iscomplete(self): """True if all the necessary data have been gathered""" - return self._undecided is not None and not self._undecided - - @property - def undecided(self): - if self._undecided is not None: - return self._undecided - self._undecided = set(self._common.missingancestors(self._targetheads)) - return self._undecided + return not self.undecided def commonheads(self): """the heads of the known common set""" @@ -293,10 +286,9 @@ # full blown discovery - disco = partialdiscovery(local, ownheads) # treat remote heads (and maybe own heads) as a first implicit sample # response - disco.addcommons(srvheads) + disco = partialdiscovery(local, ownheads, srvheads) disco.addinfo(zip(sample, yesno)) full = False