Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/help.py @ 43676:2e017696181f
help: create packages for the help text
These files need to be loaded as resources with PyOxidizer, instead of using
filesystem representations. AFAICT, the resource loading mechanisms only work
for the named package given to it, and can't reach into a subdirectory.
While here, the `help` directory is renamed to `helptext`. Without this, trying
to load external help text crashed in mercurial/help.py when importing `.i18n`,
saying there's no `mercurial.help.i18n` module.
Differential Revision: https://phab.mercurial-scm.org/D7376
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Wed, 13 Nov 2019 21:52:25 -0500 |
parents | 9f70512ae2cf |
children | 5be909dbe385 |
comparison
equal
deleted
inserted
replaced
43675:d3c4368099ed | 43676:2e017696181f |
---|---|
309 | 309 |
310 def loaddoc(topic, subdir=None): | 310 def loaddoc(topic, subdir=None): |
311 """Return a delayed loader for help/topic.txt.""" | 311 """Return a delayed loader for help/topic.txt.""" |
312 | 312 |
313 def loader(ui): | 313 def loader(ui): |
314 docdir = os.path.join(util.datapath, b'help') | 314 docdir = os.path.join(util.datapath, b'helptext') |
315 if subdir: | 315 if subdir: |
316 docdir = os.path.join(docdir, subdir) | 316 docdir = os.path.join(docdir, subdir) |
317 path = os.path.join(docdir, topic + b".txt") | 317 path = os.path.join(docdir, topic + b".txt") |
318 doc = gettext(util.readfile(path)) | 318 doc = gettext(util.readfile(path)) |
319 for rewriter in helphooks.get(topic, []): | 319 for rewriter in helphooks.get(topic, []): |