[Updated] D10232: setdiscovery: rearrange code deciding if we will grow the sample

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Mon Mar 22 18:28:49 UTC 2021


Closed by commit rHGf165105400d0: setdiscovery: rearrange code deciding if we will grow the sample (authored by marmoute).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D10232?vs=26495&id=26538

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D10232/new/

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

AFFECTED FILES
  mercurial/setdiscovery.py

CHANGE DETAILS

diff --git a/mercurial/setdiscovery.py b/mercurial/setdiscovery.py
--- a/mercurial/setdiscovery.py
+++ b/mercurial/setdiscovery.py
@@ -429,13 +429,12 @@
     # full blown discovery
 
     # if the server has a limit to its arguments size, we can't grow the sample.
-    hard_limit_sample = remote.limitedarguments
     grow_sample = local.ui.configbool(b'devel', b'discovery.grow-sample')
-    hard_limit_sample = hard_limit_sample and grow_sample
+    grow_sample = grow_sample and not remote.limitedarguments
 
     randomize = ui.configbool(b'devel', b'discovery.randomize')
     disco = partialdiscovery(
-        local, ownheads, hard_limit_sample, randomize=randomize
+        local, ownheads, not grow_sample, randomize=randomize
     )
     if initial_head_exchange:
         # treat remote heads (and maybe own heads) as a first implicit sample
@@ -454,7 +453,7 @@
                 ui.debug(b"taking initial sample\n")
             samplefunc = disco.takefullsample
             targetsize = fullsamplesize
-            if not hard_limit_sample:
+            if grow_sample:
                 fullsamplesize = int(fullsamplesize * samplegrowth)
         else:
             # use even cheaper initial sample



To: marmoute, #hg-reviewers, pulkit
Cc: frank007u, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210322/2cb54913/attachment-0002.html>


More information about the Mercurial-patches mailing list