changeset 23811:e2b262e2ee73

setdiscovery: stop using '_setupsample' in '_takefullsample' Very few of the return values of '_setupsample' remain in use, so we directly retrieve the value we care about and drop the '_setupsample' call.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Wed, 07 Jan 2015 17:17:56 -0800
parents b681d3a2bf04
children db58186dd8e3
files mercurial/setdiscovery.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/setdiscovery.py	Wed Jan 07 12:09:51 2015 -0800
+++ b/mercurial/setdiscovery.py	Wed Jan 07 17:17:56 2015 -0800
@@ -105,9 +105,10 @@
     return sample
 
 def _takefullsample(dag, nodes, size):
-    always, sample, desiredlen = _setupsample(dag, nodes, size)
-    if sample is None:
+    always = dag.headsetofconnecteds(nodes)
+    if size <= len(always):
         return always
+    sample = set()
     # update from heads
     _updatesample(dag, nodes, sample, always)
     # update from roots