This is an archive of the discontinued Mercurial Phabricator instance.

resourceutil: account for the non-resource-like file hierarchy under py2exe
ClosedPublic

Authored by mharbison72 on Jan 31 2020, 11:02 PM.

Details

Summary

After 9e367157a990, config files for py2exe were expected to be in
C:\Program Files\Mercurial\mercurial\defaultrc because of the implied resource
structure of 'mercurial.defaultrc.*.rc', relative to the executable.
Accomodating this would require changes to the WIX and Inno scripts (and perhaps
the script that generates the WIX script), as well as 3rd party bundlers like
TortoiseHg. But these files aren't read as resources anyway- they fall back to
the filesystem APIs. (If we really wanted to carry on the charade, the
installer would have to also sprinkle various empty __init__.py files around.)

Instead, this simply prunes the 'mercurial.' portion of the resource name when
run with py2exe. (PyOxidizer uses the resources API, not the filesystem
fallback, so it is unaffected.) Since this hack only affects the py2 Windows
installers and is less risky, I think it's reasonable. We haven't needed to
load any 3rd party resource up to this point, and would have to make packaging
changes anyway to handle that.

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

mharbison72 created this revision.Jan 31 2020, 11:02 PM

This is meant for stable. We will also need D8052 before tagging the release. I'm going to see if I can fix the version field in the the Inno installer, but that's not critical like this.

indygreg accepted this revision.
This revision is now accepted and ready to land.Feb 1 2020, 6:53 PM