From patchwork Thu Jan 10 08:54:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [FOLLOW-UP] discovery: re-adjust a conditional wrongly changed From: Boris Feld X-Patchwork-Id: 37606 Message-Id: <1914c8346174a7c204e5.1547110476@Laptop-Boris.lan> To: mercurial-devel@mercurial-scm.org Date: Thu, 10 Jan 2019 09:54:36 +0100 # HG changeset patch # User Boris Feld # Date 1547091348 -3600 # Thu Jan 10 04:35:48 2019 +0100 # Node ID 1914c8346174a7c204e5623684cbff5188a3e847 # Parent 17a1956764728e8c9dd1101573dca12523e482bb # EXP-Topic discovery-followup # Available At https://bitbucket.org/octobus/mercurial-devel/ # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 1914c8346174 discovery: re-adjust a conditional wrongly changed In 71b0db4fa027 we updated this conditional to `<=`. As Yuya Nishihara pointed out, this was wrong. diff --git a/mercurial/setdiscovery.py b/mercurial/setdiscovery.py --- a/mercurial/setdiscovery.py +++ b/mercurial/setdiscovery.py @@ -150,7 +150,7 @@ def _takefullsample(repo, headrevs, revs _updatesample(revs, revsroots, sample, children.__getitem__) assert sample sample = _limitsample(sample, size) - if len(sample) <= size: + if len(sample) < size: more = size - len(sample) sample.update(random.sample(list(revs - sample), more)) return sample