Patchwork [5,of,8] discovery: update undecided from common directly within partialdiscovery

login
register
mail settings
Submitter Boris Feld
Date Dec. 31, 2018, 5:35 p.m.
Message ID <53455b1ab93ea86f6c7a.1546277752@Laptop-Boris.lan>
Download mbox | patch
Permalink /patch/37409/
State Superseded
Headers show

Comments

Boris Feld - Dec. 31, 2018, 5:35 p.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1545964463 -3600
#      Fri Dec 28 03:34:23 2018 +0100
# Node ID 53455b1ab93ea86f6c7ad1b57716f44753447ab4
# Parent  6eb53e3f1bc514d4cb376d84b2bdd1302d27f8e2
# EXP-Topic discovery-refactor
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 53455b1ab93e
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.

Patch

diff --git a/mercurial/setdiscovery.py b/mercurial/setdiscovery.py
--- a/mercurial/setdiscovery.py
+++ b/mercurial/setdiscovery.py
@@ -181,6 +181,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"""
@@ -322,7 +323,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