Mercurial > hg
comparison mercurial/help.py @ 22637:149141c3a25f
help: don't search randomly for help data - trust util.datapath
The search was introduced in c904e76e3834 without a convincing explanation why
it should be necessary ... except for consistency with templater handling.
Now, just keep it simple.
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Sun, 28 Sep 2014 16:57:47 +0200 |
parents | 92b54547ac5d |
children | 861ddedfb402 |
comparison
equal
deleted
inserted
replaced
22636:d844e220792a | 22637:149141c3a25f |
---|---|
127 | 127 |
128 def loaddoc(topic): | 128 def loaddoc(topic): |
129 """Return a delayed loader for help/topic.txt.""" | 129 """Return a delayed loader for help/topic.txt.""" |
130 | 130 |
131 def loader(): | 131 def loader(): |
132 for dir in ('.', '..'): | 132 docdir = os.path.join(util.datapath, 'help') |
133 docdir = os.path.join(util.datapath, dir, 'help') | |
134 if os.path.isdir(docdir): | |
135 break | |
136 | |
137 path = os.path.join(docdir, topic + ".txt") | 133 path = os.path.join(docdir, topic + ".txt") |
138 doc = gettext(util.readfile(path)) | 134 doc = gettext(util.readfile(path)) |
139 for rewriter in helphooks.get(topic, []): | 135 for rewriter in helphooks.get(topic, []): |
140 doc = rewriter(topic, doc) | 136 doc = rewriter(topic, doc) |
141 return doc | 137 return doc |