From patchwork Wed May 15 07:14:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [6,of,9,STABLE?,V2] gendoc: add show_doc_topic From: Takumi IINO X-Patchwork-Id: 1647 Message-Id: <8973dcdfb5b0501af51d.1368602063@iino-no-MacBook-Air.local> To: mercurial-devel@selenic.com Date: Wed, 15 May 2013 16:14:23 +0900 # HG changeset patch # User Takumi IINO # Date 1368600353 -32400 # Wed May 15 15:45:53 2013 +0900 # Branch stable # Node ID 8973dcdfb5b0501af51d72933e08fd4e80fbf20f # Parent fe6f4a4f4d39947f19f1238177df6cc9bc71ad82 gendoc: add show_doc_topic This function prints any topic. diff --git a/doc/gendoc.py b/doc/gendoc.py --- a/doc/gendoc.py +++ b/doc/gendoc.py @@ -8,7 +8,7 @@ from mercurial import minirst from mercurial.commands import table, globalopts from mercurial.i18n import gettext, _ -from mercurial.help import helptable +from mercurial.help import helptable, loaddoc from mercurial import extensions from mercurial import util @@ -103,6 +103,15 @@ def show_doc_hgrc(ui): helpprinter(ui, helptable, None, include=['config']) +def show_doc_topic(ui, topic): + extra_helptable = [ + (["common"], '', loaddoc('common')), + (["hg.1"], '', loaddoc('hg.1')), + (["hgignore.5"], '', loaddoc('hgignore.5')), + (["hgrc.5"], '', loaddoc('hgrc.5')), + ] + helpprinter(ui, helptable + extra_helptable, None, include=[topic]) + def helpprinter(ui, helptable, sectionfunc, include=[], exclude=[]): for names, sec, doc in helptable: if exclude and names[0] in exclude: