Patchwork D2647: setdiscovery: make progress on most connected groups each roundtrip

login
register
mail settings
Submitter phabricator
Date May 21, 2019, 10:01 p.m.
Message ID <987ec506459fa77586b762ab1eb6a076@localhost.localdomain>
Download mbox | patch
Permalink /patch/40168/
State Not Applicable
Headers show

Comments

phabricator - May 21, 2019, 10:01 p.m.
martinvonz updated this revision to Diff 15210.
martinvonz edited the summary of this revision.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2647?vs=15208&id=15210

REVISION DETAIL
  https://phab.mercurial-scm.org/D2647

AFFECTED FILES
  mercurial/setdiscovery.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers, indygreg, marmoute
Cc: indygreg, mercurial-devel

Patch

diff --git a/mercurial/setdiscovery.py b/mercurial/setdiscovery.py
--- a/mercurial/setdiscovery.py
+++ b/mercurial/setdiscovery.py
@@ -110,13 +110,14 @@ 
     (all tracked revisions are known locally)
     """
 
-    def __init__(self, repo, targetheads):
+    def __init__(self, repo, targetheads, respectsize):
         self._repo = repo
         self._targetheads = targetheads
         self._common = repo.changelog.incrementalmissingrevs()
         self._undecided = None
         self.missing = set()
         self._childrenmap = None
+        self._respectsize = respectsize
 
     def addcommons(self, commons):
         """register nodes known as common"""
@@ -241,6 +242,8 @@ 
 
         # update from roots
         revsroots = set(repo.revs('roots(%ld)', revs))
+        if not self._respectsize:
+            size = max(size, len(revsroots))
 
         childrenrevs = self._childrengetter()
 
@@ -373,7 +376,7 @@ 
 
     # full blown discovery
 
-    disco = partialdiscovery(local, ownheads)
+    disco = partialdiscovery(local, ownheads, remote.limitedarguments)
     # treat remote heads (and maybe own heads) as a first implicit sample
     # response
     disco.addcommons(knownsrvheads)