Mercurial > public > mercurial-scm > hg
comparison mercurial/cmdutil.py @ 34289:1d6558f5ea74
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
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Wed, 20 Sep 2017 07:46:55 +0530 |
parents | 61714510220d |
children | 4647e0a8d3d7 |
comparison
equal
deleted
inserted
replaced
34288:fc3b8483c6cb | 34289:1d6558f5ea74 |
---|---|
534 par = os.path.dirname(a) | 534 par = os.path.dirname(a) |
535 pardict.setdefault(par, []).append(a) | 535 pardict.setdefault(par, []).append(a) |
536 | 536 |
537 rs = [] | 537 rs = [] |
538 newls = [] | 538 newls = [] |
539 for par, files in pardict.iteritems(): | 539 for par, files in sorted(pardict.iteritems()): |
540 lenpar = numfiles(par) | 540 lenpar = numfiles(par) |
541 if lenpar == len(files): | 541 if lenpar == len(files): |
542 newls.append(par) | 542 newls.append(par) |
543 | 543 |
544 if not newls: | 544 if not newls: |