This is an archive of the discontinued Mercurial Phabricator instance.

py3: don't run source transformer on hgext3rd (extensions)
ClosedPublic

Authored by martinvonz on Jul 8 2019, 12:52 PM.

Details

Summary

It's unclear why the source transformer runs on hgext3rd. It's been
like that since it was introduced in 1c22400db72d (mercurial:
implement a source transforming module loader on Python 3,
2016-07-04), and that commit didn't say anything about it (but it says
that it doesn't have "support [...] for extensions").

I find that the current handling of hgext3rd just makes it harder to
convert extensions to Python 3. It makes you convert a bunch of
strings passed to getattr() and kwargs[] to r'' that could otherwise
have been left alone. It's also really confusing that the source
transformer runs when you import the extension as "extensions.foo=",
but not as "extension.foo=/some/path".

I suppose there is small number of (very simple) extensions that would
have worked without this patch that would now be broken. It seems okay
to me to break those.

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

martinvonz created this revision.Jul 8 2019, 12:52 PM
pulkit accepted this revision.Jul 8 2019, 5:37 PM
This revision is now accepted and ready to land.Jul 8 2019, 5:37 PM