Mercurial > public > mercurial-scm > hg
diff mercurial/debugcommands.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 | c9774f5fa729 |
line wrap: on
line diff
--- a/mercurial/debugcommands.py Thu Mar 03 17:39:20 2022 -0800 +++ b/mercurial/debugcommands.py Thu Mar 03 18:28:30 2022 -0800 @@ -492,7 +492,7 @@ b2caps = bundle2.bundle2caps(peer) if b2caps: ui.writenoi18n(b'Bundle2 capabilities:\n') - for key, values in sorted(pycompat.iteritems(b2caps)): + for key, values in sorted(b2caps.items()): ui.write(b' %s\n' % key) for v in values: ui.write(b' %s\n' % v) @@ -2388,7 +2388,7 @@ if f in ms: # If file is in mergestate, we have already processed it's extras continue - for k, v in pycompat.iteritems(d): + for k, v in d.items(): fm_extras.startitem() fm_extras.data(file=f) fm_extras.data(key=k) @@ -2405,7 +2405,7 @@ names = set() # since we previously only listed open branches, we will handle that # specially (after this for loop) - for name, ns in pycompat.iteritems(repo.names): + for name, ns in repo.names.items(): if name != b'branches': names.update(ns.listnames(repo)) names.update( @@ -2699,7 +2699,7 @@ fullpaths = opts['full'] files, dirs = set(), set() adddir, addfile = dirs.add, files.add - for f, st in pycompat.iteritems(dirstate): + for f, st in dirstate.items(): if f.startswith(spec) and st.state in acceptable: if fixpaths: f = f.replace(b'/', pycompat.ossep) @@ -4270,7 +4270,7 @@ for opt in cmdutil.remoteopts: del opts[opt[1]] args = {} - for k, v in pycompat.iteritems(opts): + for k, v in opts.items(): if v: args[k] = v args = pycompat.strkwargs(args)