# HG changeset patch # User Pierre-Yves David # Date 2022-03-13 14:53:29 # Node ID 186223795e4ae1b00121c48230c51d6e0a7b7105 # Parent 5b65721a75ebdf796002673b7adb2c6e2ef7ee6f subsetmaker: stabilize the computation of `scratch` subset `heads` is set, order of the element are not deterministic and we need to stabilize that if we want to get reproducible results. Differential Revision: https://phab.mercurial-scm.org/D12394 diff --git a/contrib/perf-utils/subsetmaker.py b/contrib/perf-utils/subsetmaker.py --- a/contrib/perf-utils/subsetmaker.py +++ b/contrib/perf-utils/subsetmaker.py @@ -102,7 +102,9 @@ def scratch(repo, subset, x): for x in range(n): if not heads: break - pick = rand.choice(list(heads)) + pickable = list(heads) + pickable.sort() + pick = rand.choice(pickable) heads.remove(pick) assert pick not in selected selected.add(pick)