comparison mercurial/logcmdutil.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 642e31cb55f0
comparison
equal deleted inserted replaced
48912:a0674e916fb6 48913:f254fc73d956
325 branch = ctx.branch() 325 branch = ctx.branch()
326 # don't show the default branch name 326 # don't show the default branch name
327 if branch != b'default': 327 if branch != b'default':
328 self.ui.write(columns[b'branch'] % branch, label=b'log.branch') 328 self.ui.write(columns[b'branch'] % branch, label=b'log.branch')
329 329
330 for nsname, ns in pycompat.iteritems(self.repo.names): 330 for nsname, ns in self.repo.names.items():
331 # branches has special logic already handled above, so here we just 331 # branches has special logic already handled above, so here we just
332 # skip it 332 # skip it
333 if nsname == b'branches': 333 if nsname == b'branches':
334 continue 334 continue
335 # we will use the templatename as the color name since those two 335 # we will use the templatename as the color name since those two
989 opts[b'_matchfiles'] = matchargs 989 opts[b'_matchfiles'] = matchargs
990 elif wopts.filter_revisions_by_pats and not wopts.follow: 990 elif wopts.filter_revisions_by_pats and not wopts.follow:
991 opts[b'_patslog'] = list(wopts.pats) 991 opts[b'_patslog'] = list(wopts.pats)
992 992
993 expr = [] 993 expr = []
994 for op, val in sorted(pycompat.iteritems(opts)): 994 for op, val in sorted(opts.items()):
995 if not val: 995 if not val:
996 continue 996 continue
997 revop, listop = _opt2logrevset[op] 997 revop, listop = _opt2logrevset[op]
998 if revop and b'%' not in revop: 998 if revop and b'%' not in revop:
999 expr.append(revop) 999 expr.append(revop)