comparison mercurial/help.py @ 43715:5be909dbe385

util: remove datapath and swith users over to resourceutil The util module no longer needs the datapath for injecting it into the i18n module, so we can remove it from there and update other users. Differential Revision: https://phab.mercurial-scm.org/D7436
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 14 Nov 2019 13:18:22 -0800
parents 2e017696181f
children 1390bb81163e
comparison
equal deleted inserted replaced
43714:f0bee3b1b847 43715:5be909dbe385
34 templatekw, 34 templatekw,
35 ui as uimod, 35 ui as uimod,
36 util, 36 util,
37 ) 37 )
38 from .hgweb import webcommands 38 from .hgweb import webcommands
39 from .utils import compression 39 from .utils import (
40 compression,
41 resourceutil,
42 )
40 43
41 _exclkeywords = { 44 _exclkeywords = {
42 b"(ADVANCED)", 45 b"(ADVANCED)",
43 b"(DEPRECATED)", 46 b"(DEPRECATED)",
44 b"(EXPERIMENTAL)", 47 b"(EXPERIMENTAL)",
309 312
310 def loaddoc(topic, subdir=None): 313 def loaddoc(topic, subdir=None):
311 """Return a delayed loader for help/topic.txt.""" 314 """Return a delayed loader for help/topic.txt."""
312 315
313 def loader(ui): 316 def loader(ui):
314 docdir = os.path.join(util.datapath, b'helptext') 317 docdir = os.path.join(resourceutil.datapath, b'helptext')
315 if subdir: 318 if subdir:
316 docdir = os.path.join(docdir, subdir) 319 docdir = os.path.join(docdir, subdir)
317 path = os.path.join(docdir, topic + b".txt") 320 path = os.path.join(docdir, topic + b".txt")
318 doc = gettext(util.readfile(path)) 321 doc = gettext(util.readfile(path))
319 for rewriter in helphooks.get(topic, []): 322 for rewriter in helphooks.get(topic, []):