Patchwork [FOLLOW-UP] discovery: re-adjust a conditional wrongly changed

login
register
mail settings
Submitter Boris Feld
Date Jan. 10, 2019, 8:54 a.m.
Message ID <1914c8346174a7c204e5.1547110476@Laptop-Boris.lan>
Download mbox | patch
Permalink /patch/37606/
State Accepted
Headers show

Comments

Boris Feld - Jan. 10, 2019, 8:54 a.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# 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.
Yuya Nishihara - Jan. 10, 2019, 11:04 a.m.
On Thu, 10 Jan 2019 09:54:36 +0100, Boris Feld wrote:
> # HG changeset patch
> # User Boris Feld <boris.feld@octobus.net>
> # 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

Queued, thanks.

Patch

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