tersestatus: sort the dictionary before iterating on it
authorPulkit Goyal <7895pulkit@gmail.com>
Wed, 20 Sep 2017 07:46:55 +0530
changeset 34289 1d6558f5ea74
parent 34288 fc3b8483c6cb
child 34290 4f969b9e0cf5
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
mercurial/cmdutil.py
--- a/mercurial/cmdutil.py	Sun Sep 03 20:06:45 2017 +0530
+++ b/mercurial/cmdutil.py	Wed Sep 20 07:46:55 2017 +0530
@@ -536,7 +536,7 @@
 
         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)