This is an archive of the discontinued Mercurial Phabricator instance.

import-checker: allow symbol imports from mercurial.pycompat
ClosedPublic

Authored by indygreg on Oct 6 2019, 5:22 PM.

Details

Summary

Currently, the source transformer inserts
from mercurial.pycompat import delattr, getattr, hasattr, setattr, open, unicode
to the top of every file. As part of getting rid of the source transformer,
we'll need to have source code call these wrappers directly. Rather than
rewrite all call sites to call pycompat.*, I think it makes sense to import
needed symbols via explicit imports. That requires loosening the import checker
to allow this.

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 6 2019, 5:22 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.