# HG changeset patch # User Gregory Szorc # Date 2015-12-13 18:35:03 # Node ID fc810d9502789aa7b856ca6e01e71b2070473f7d # Parent c4a062d090ee1e9c3c0c8a8d2098510a7699ded0 help: add "internals" topic We introduce the "internals" help topic, which renders an index of available sub-topics. The sub-topics themselves are still not reachable via the help system. diff --git a/mercurial/help.py b/mercurial/help.py --- a/mercurial/help.py +++ b/mercurial/help.py @@ -161,6 +161,21 @@ def loaddoc(topic, subdir=None): return loader +internalstable = sorted([ + (['bundles'], _('container for exchange of repository data'), + loaddoc('bundles', subdir='internals')), + (['changegroups'], _('representation of revlog data'), + loaddoc('changegroups', subdir='internals')), +]) + +def internalshelp(ui): + """Generate the index for the "internals" topic.""" + lines = [] + for names, header, doc in internalstable: + lines.append(' :%s: %s' % (names[0], header)) + + return '\n'.join(lines) + helptable = sorted([ (["config", "hgrc"], _("Configuration Files"), loaddoc('config')), (["dates"], _("Date Formats"), loaddoc('dates')), @@ -187,6 +202,8 @@ helptable = sorted([ (["phases"], _("Working with Phases"), loaddoc('phases')), (['scripting'], _('Using Mercurial from scripts and automation'), loaddoc('scripting')), + (['internals'], _("Technical implementation topics"), + internalshelp), ]) # Map topics to lists of callable taking the current topic help and diff --git a/tests/test-globalopts.t b/tests/test-globalopts.t --- a/tests/test-globalopts.t +++ b/tests/test-globalopts.t @@ -349,6 +349,7 @@ Testing -h/--help: glossary Glossary hgignore Syntax for Mercurial Ignore Files hgweb Configuring hgweb + internals Technical implementation topics merge-tools Merge Tools multirevs Specifying Multiple Revisions patterns File Name Patterns @@ -431,6 +432,7 @@ Testing -h/--help: glossary Glossary hgignore Syntax for Mercurial Ignore Files hgweb Configuring hgweb + internals Technical implementation topics merge-tools Merge Tools multirevs Specifying Multiple Revisions patterns File Name Patterns diff --git a/tests/test-help.t b/tests/test-help.t --- a/tests/test-help.t +++ b/tests/test-help.t @@ -111,6 +111,7 @@ Short help: glossary Glossary hgignore Syntax for Mercurial Ignore Files hgweb Configuring hgweb + internals Technical implementation topics merge-tools Merge Tools multirevs Specifying Multiple Revisions patterns File Name Patterns @@ -187,6 +188,7 @@ Short help: glossary Glossary hgignore Syntax for Mercurial Ignore Files hgweb Configuring hgweb + internals Technical implementation topics merge-tools Merge Tools multirevs Specifying Multiple Revisions patterns File Name Patterns @@ -773,6 +775,7 @@ Test that default list of commands omits glossary Glossary hgignore Syntax for Mercurial Ignore Files hgweb Configuring hgweb + internals Technical implementation topics merge-tools Merge Tools multirevs Specifying Multiple Revisions patterns File Name Patterns @@ -862,6 +865,14 @@ Test list of internal help commands (use "hg help -v debug" to show built-in aliases and global options) +internals topic renders index of available sub-topics + + $ hg help internals + Technical implementation topics + """"""""""""""""""""""""""""""" + + bundles container for exchange of repository data + changegroups representation of revlog data Test list of commands with command with no help text @@ -1530,6 +1541,13 @@ Dish up an empty repo; serve it cold. Configuring hgweb + + internals + + + Technical implementation topics + + merge-tools diff --git a/tests/test-hgweb-json.t b/tests/test-hgweb-json.t --- a/tests/test-hgweb-json.t +++ b/tests/test-hgweb-json.t @@ -1062,6 +1062,10 @@ help/ shows help topics "topic": "hgweb" }, { + "summary": "Technical implementation topics", + "topic": "internals" + }, + { "summary": "Merge Tools", "topic": "merge-tools" },