Page MenuHomePhabricator

extensions: make `hg nonexistent` not crash with PyOxidizer

Authored by martinvonz on Jul 14 2020, 4:18 PM.



When running hg nonexistent, we try to look for extensions that
provide that command. We do that by looking for files in the
hgext.__file__ directory. However, PyOxidizer doesn't provide a
__file__, so we crash when running with PyOxidizer.

We should be able to look for the command in built-in extensions, but
we seem to already have code for skipping the scan when running in a
frozen binary, so I just modified that code instead.

By the way, it also seems like we should be able to search for
extensions in the hgext3rd module, but we don't do that yet either
(before or after this patch).

Diff Detail

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

Event Timeline

martinvonz created this revision.Jul 14 2020, 4:18 PM
Alphare accepted this revision.Jul 15 2020, 12:03 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.