# HG changeset patch # User Gregory Szorc # Date 2015-12-13 18:45:27 # Node ID c4a062d090ee1e9c3c0c8a8d2098510a7699ded0 # Parent 7a70ae647e54def108079c1e9c9e19703fe6bccb help: teach loaddoc to load from a different directory The help system currently only supports showing help topics from a single directory. We'll need to teach it to show results from different directories in order to show the internals topics. The first step is to teach loaddoc() to load documentation from a sub-directory. diff --git a/mercurial/help.py b/mercurial/help.py --- a/mercurial/help.py +++ b/mercurial/help.py @@ -146,11 +146,13 @@ def topicmatch(ui, kw): results['extensioncommands'].append((cmdname, cmddoc)) return results -def loaddoc(topic): +def loaddoc(topic, subdir=None): """Return a delayed loader for help/topic.txt.""" def loader(ui): docdir = os.path.join(util.datapath, 'help') + if subdir: + docdir = os.path.join(docdir, subdir) path = os.path.join(docdir, topic + ".txt") doc = gettext(util.readfile(path)) for rewriter in helphooks.get(topic, []):