This is an archive of the discontinued Mercurial Phabricator instance.

py3: define and use pycompat.iteritems() for hgext/
ClosedPublic

Authored by indygreg on Oct 7 2019, 4:05 PM.

Details

Summary

.iteritems() -> .items() is the last source transform being performed.
But it is also the most widely used.

This commit adds a pycompat.iteritems symbol and imports it in place
of .iteritems() for usage in hgext/. I chose to stop at just hgext/
because the patch will be large and it is an easy boundary to stop at
since we can disable source transformation on a per-package basis.

There are places where the type does implement items() and we could
call items() directly. However, this would require critical thought
and I thought it would be easier to just blindly change the code. We
know which call sites need to be audited in the future because they
have "pycompat.iteritems."

With this change, we no longer perform source transformation on
hgext!

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

indygreg created this revision.Oct 7 2019, 4:05 PM
This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.