# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 2017-09-20 02:16:55 # Node ID 1d6558f5ea74cd9b26225e8033936cd338025748 # Parent fc3b8483c6cb4eef8671867194eb064f898f38a8 tersestatus: sort the dictionary before iterating on it There has report of flakiness in test-status-terse.t. In the terse code, we are iterating on a dictionary without sorting and since python dicts are unordered, that can be a reason behind the flakiness. Before we have a better implementation for the terse thing, let's make sure current implementation possess minimum bugs. Differential Revision: https://phab.mercurial-scm.org/D740 diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -536,7 +536,7 @@ def tersestatus(root, statlist, status, rs = [] newls = [] - for par, files in pardict.iteritems(): + for par, files in sorted(pardict.iteritems()): lenpar = numfiles(par) if lenpar == len(files): newls.append(par)