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

login
register
mail settings
Submitter Boris Feld
Date Jan. 4, 2019, 10:45 p.m.
Message ID <b9f78a736cf666a008de.1546641925@localhost.localdomain>
Download mbox | patch
Permalink /patch/37474/
State Accepted
Headers show

Comments

Boris Feld - Jan. 4, 2019, 10:45 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 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.

Patch

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