discovery: update undecided from common directly within partialdiscovery
authorBoris Feld <boris.feld@octobus.net>
Fri, 28 Dec 2018 03:34:23 +0100
changeset 41168 1d30be90c9dc
parent 41167 870a89c6909d
child 41169 3ce5b96482c6
discovery: update undecided from common directly within partialdiscovery The object knows when there are changes in the "common" set, so it is a good place to update the undecided set.
mercurial/setdiscovery.py
--- a/mercurial/setdiscovery.py	Fri Dec 28 03:23:37 2018 +0100
+++ b/mercurial/setdiscovery.py	Fri Dec 28 03:34:23 2018 +0100
@@ -180,6 +180,7 @@
     def addcommons(self, commons):
         """registrer nodes known as common"""
         self._common.addbases(commons)
+        self._common.removeancestorsfrom(self.undecided)
 
     def hasinfo(self):
         """return True is we have any clue about the remote state"""
@@ -324,7 +325,6 @@
         if sample:
             commoninsample = set(n for i, n in enumerate(sample) if yesno[i])
             disco.addcommons(commoninsample)
-            disco._common.removeancestorsfrom(disco.undecided)
 
     result = disco.commonheads()
     elapsed = util.timer() - start