[PATCH 06 of 10 V3] discovery: update undecided from common directly within partialdiscovery

Boris Feld boris.feld at octobus.net
Fri Jan 4 17:45:25 EST 2019


# HG changeset patch
# User Boris Feld <boris.feld at octobus.net>
# Date 1545964463 -3600
#      Fri Dec 28 03:34:23 2018 +0100
# Node ID b9f78a736cf666a008de914ab30ff84c4a9c973e
# Parent  944c2173a32073584a22f8de8c0e348245065c1e
# EXP-Topic discovery-refactor
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r b9f78a736cf6
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.

diff --git a/mercurial/setdiscovery.py b/mercurial/setdiscovery.py
--- a/mercurial/setdiscovery.py
+++ b/mercurial/setdiscovery.py
@@ -180,6 +180,7 @@ class partialdiscovery(object):
     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"""
@@ -321,7 +322,6 @@ def findcommonheads(ui, local, remote,
         if sample:
             commoninsample = set(n for i, n in enumerate(sample) if yesno[i])
             disco.addcommons(commoninsample)
-            disco._common.removeancestorsfrom(disco.undecided)
 
     # heads(common) == heads(common.bases) since common represents common.bases
     # and all its ancestors


More information about the Mercurial-devel mailing list