Mercurial > hg
changeset 23816:34d4b58580d1
setdiscovery: document '_takequicksample'
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Wed, 07 Jan 2015 20:44:20 -0800 |
parents | 31e75a362d44 |
children | 813aaaf2aff3 |
files | mercurial/setdiscovery.py |
diffstat | 1 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/setdiscovery.py Tue Jan 06 17:07:44 2015 -0800 +++ b/mercurial/setdiscovery.py Wed Jan 07 20:44:20 2015 -0800 @@ -95,6 +95,14 @@ return always, set(), desiredlen def _takequicksample(dag, nodes, size): + """takes a quick sample of size <size> + + It is meant for initial sampling and focuses on querying heads and close + ancestors of heads. + + :dag: a dag object + :nodes: set of nodes to discover + :size: the maximum size of the sample""" sample = dag.headsetofconnecteds(nodes) if size <= len(sample): return _limitsample(sample, size)