Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hgweb/webcommands.py @ 49004: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
49003:a0674e916fb6 | 49004:f254fc73d956 |
---|---|
561 if path and path[-1:] != b"/": | 561 if path and path[-1:] != b"/": |
562 path += b"/" | 562 path += b"/" |
563 l = len(path) | 563 l = len(path) |
564 abspath = b"/" + path | 564 abspath = b"/" + path |
565 | 565 |
566 for full, n in pycompat.iteritems(mf): | 566 for full, n in mf.items(): |
567 # the virtual path (working copy path) used for the full | 567 # the virtual path (working copy path) used for the full |
568 # (repository) path | 568 # (repository) path |
569 f = decodepath(full) | 569 f = decodepath(full) |
570 | 570 |
571 if f[:l] != path: | 571 if f[:l] != path: |
1518 entries, summary, _doc = h[0:3] | 1518 entries, summary, _doc = h[0:3] |
1519 yield {b'topic': entries[0], b'summary': summary} | 1519 yield {b'topic': entries[0], b'summary': summary} |
1520 | 1520 |
1521 early, other = [], [] | 1521 early, other = [], [] |
1522 primary = lambda s: s.partition(b'|')[0] | 1522 primary = lambda s: s.partition(b'|')[0] |
1523 for c, e in pycompat.iteritems(commands.table): | 1523 for c, e in commands.table.items(): |
1524 doc = _getdoc(e) | 1524 doc = _getdoc(e) |
1525 if b'DEPRECATED' in doc or c.startswith(b'debug'): | 1525 if b'DEPRECATED' in doc or c.startswith(b'debug'): |
1526 continue | 1526 continue |
1527 cmd = primary(c) | 1527 cmd = primary(c) |
1528 if getattr(e[0], 'helpbasic', False): | 1528 if getattr(e[0], 'helpbasic', False): |