changeset 23807:e97e363a7000

setdiscovery: delay sample building calls to gather them in a single place Some of the logic around sample building is duplicated in the sample builders, it would clean up thing to extract it in the top function, but this requires all codes to be in the same place. This changeset mostly exists to make the next one more clear.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Wed, 07 Jan 2015 09:30:06 -0800
parents d6cbbe3baef0
children 07d0f59e0ba7
files mercurial/setdiscovery.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/setdiscovery.py	Tue Jan 06 16:32:23 2015 -0800
+++ b/mercurial/setdiscovery.py	Wed Jan 07 09:30:06 2015 -0800
@@ -198,13 +198,14 @@
                 ui.note(_("sampling from both directions\n"))
             else:
                 ui.debug("taking initial sample\n")
-            sample = _takefullsample(dag, undecided, size=fullsamplesize)
+            samplefunc = _takefullsample
             targetsize = fullsamplesize
         else:
             # use even cheaper initial sample
             ui.debug("taking quick initial sample\n")
-            sample = _takequicksample(dag, undecided, size=initialsamplesize)
+            samplefunc = _takequicksample
             targetsize = initialsamplesize
+        sample = samplefunc(dag, undecided, targetsize)
         sample = _limitsample(sample, targetsize)
 
         roundtrips += 1