mercurial/setdiscovery.py
branchstable
changeset 23130 ced632394371
parent 23084 3ef893520a85
child 23191 86c35b7ae300
--- a/mercurial/setdiscovery.py	Sat Nov 01 23:17:50 2014 +0000
+++ b/mercurial/setdiscovery.py	Sat Nov 01 23:52:53 2014 +0000
@@ -203,15 +203,19 @@
         if full:
             ui.note(_("sampling from both directions\n"))
             sample = _takefullsample(dag, undecided, size=fullsamplesize)
+            targetsize = fullsamplesize
         elif common:
             # use cheapish initial sample
             ui.debug("taking initial sample\n")
             sample = _takefullsample(dag, undecided, size=fullsamplesize)
+            targetsize = fullsamplesize
         else:
             # use even cheaper initial sample
             ui.debug("taking quick initial sample\n")
             sample = _takequicksample(dag, undecided, size=initialsamplesize,
                                       initial=True)
+            targetsize = initialsamplesize
+        sample = _limitsample(sample, targetsize)
 
         roundtrips += 1
         ui.progress(_('searching'), roundtrips, unit=_('queries'))