Mercurial > hg
comparison mercurial/similar.py @ 48913:f254fc73d956
global: bulk replace simple pycompat.iteritems(x) with x.items()
pycompat.iteritems() just calls .items().
This commit applies a regular expression search and replace to convert
simple instances of pycompat.iteritems() with .items(). There are still
a handful of calls to pycompat.iteritems() remaining. But these all have
more complicated expressions that I wasn't comfortable performing an
automated replace on. In addition, some simple replacements were withheld
because they broke pytype. These will be handled by their own changesets.
Differential Revision: https://phab.mercurial-scm.org/D12318
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Thu, 03 Mar 2022 18:28:30 -0800 |
parents | 6000f5b25c9b |
children | 493034cc3265 |
comparison
equal
deleted
inserted
replaced
48912:a0674e916fb6 | 48913:f254fc73d956 |
---|---|
7 | 7 |
8 | 8 |
9 from .i18n import _ | 9 from .i18n import _ |
10 from . import ( | 10 from . import ( |
11 mdiff, | 11 mdiff, |
12 pycompat, | |
13 ) | 12 ) |
14 | 13 |
15 | 14 |
16 def _findexactmatches(repo, added, removed): | 15 def _findexactmatches(repo, added, removed): |
17 """find renamed files that have no changes | 16 """find renamed files that have no changes |
95 myscore = _score(a, data) | 94 myscore = _score(a, data) |
96 if myscore > bestscore: | 95 if myscore > bestscore: |
97 copies[a] = (r, myscore) | 96 copies[a] = (r, myscore) |
98 progress.complete() | 97 progress.complete() |
99 | 98 |
100 for dest, v in pycompat.iteritems(copies): | 99 for dest, v in copies.items(): |
101 source, bscore = v | 100 source, bscore = v |
102 yield source, dest, bscore | 101 yield source, dest, bscore |
103 | 102 |
104 | 103 |
105 def _dropempty(fctxs): | 104 def _dropempty(fctxs): |