setdiscovery: stop using '_setupsample' in '_takefullsample'
authorPierre-Yves David <pierre-yves.david@fb.com>
Wed, 07 Jan 2015 17:17:56 -0800
changeset 23811 e2b262e2ee73
parent 23810 b681d3a2bf04
child 23812 db58186dd8e3
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.
mercurial/setdiscovery.py
--- 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