Mercurial > evolve
diff hgext/evolve.py @ 1193:de73285cf504
discovery: do not build sample if undecided is smaller than sample size
This prevents crash with coming change in the mercurial discovery.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Wed, 07 Jan 2015 15:24:47 -0800 |
parents | a556fff7adcf |
children | 9e3f332f7630 |
line wrap: on
line diff
--- a/hgext/evolve.py Mon Jan 05 19:04:32 2015 -0800 +++ b/hgext/evolve.py Wed Jan 07 15:24:47 2015 -0800 @@ -2390,7 +2390,10 @@ while undecided: ui.note(_("sampling from both directions\n")) - sample = _takefullsample(dag, undecided, size=fullsamplesize) + if len(undecided) < fullsamplesize: + sample = set(undecided) + else: + sample = _takefullsample(dag, undecided, size=fullsamplesize) roundtrips += 1 ui.debug("query %i; still undecided: %i, sample size is: %i\n"