Page MenuHomePhabricator

extensions: refactor function for obtaining disabled extension help

Authored by indygreg on Mar 29 2020, 9:30 PM.



The way this worked before was hgext.index was consulted.
This file appears to only be present on some Windows distributions.

This file contains a dict mapping extension name to its summary line,
not its full docstring.

The problem with this is that code in the help system was calling
this function to resolve help text. If hgext.index was present,
only the summary line would be displayed. If not, the full extension
help would be printed.

This commit changes the function to not use hgext.index such that
it always returns the full extension help text.

As a result of this change, test-extension.t and test-qrecord.t
now pass when run from environments that have an hgext.index.

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

indygreg created this revision.Mar 29 2020, 9:30 PM

I noticed inconsistencies with this too. I was wondering if we should populate __index__ with the full help text to avoid that. (The other inconsistency that comes to mind is printing out the disabled extension list in hg help extensions.) While it is apparently only used for py2exe based stuff, it might be handy with PyOxidizer too, until that gains the ability to enumerate and read embedded *.py files and directories as resources.

This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.