Mercurial > hg-stable
changeset 23815:31e75a362d44
setdiscovery: drop '_setupsample' usage in '_takequicksample'
For '_takefullsample' we can just retrieve the list of head directly and
ignore the rest of the complex return values. This was the last call to the
infamous '_updatesample' function.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Tue, 06 Jan 2015 17:07:44 -0800 |
parents | 6a5877a73141 |
children | 34d4b58580d1 |
files | mercurial/setdiscovery.py |
diffstat | 1 files changed, 3 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/setdiscovery.py Wed Jan 07 10:32:17 2015 -0800 +++ b/mercurial/setdiscovery.py Tue Jan 06 17:07:44 2015 -0800 @@ -95,10 +95,9 @@ return always, set(), desiredlen def _takequicksample(dag, nodes, size): - always, sample, desiredlen = _setupsample(dag, nodes, size) - if sample is None: - return always - sample = always + sample = dag.headsetofconnecteds(nodes) + if size <= len(sample): + return _limitsample(sample, size) _updatesample(dag, None, sample, quicksamplesize=size) return sample