# HG changeset patch # User Takumi IINO # Date 2013-07-03 12:49:39 # Node ID 762e51ce3411bb0c770100e042566be86b5dbc6d # Parent 5046fede7684419e773d222b3da7226605f4377e gendoc: add showtopic This function prints any topic. diff --git a/doc/gendoc.py b/doc/gendoc.py --- a/doc/gendoc.py +++ b/doc/gendoc.py @@ -7,7 +7,7 @@ from mercurial import demandimport; dema 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 @@ -96,6 +96,17 @@ def showdoc(ui): ui.write(minirst.subsubsection(_('Commands'))) commandprinter(ui, cmdtable, minirst.subsubsubsection) +def showtopic(ui, topic): + extrahelptable = [ + (["common"], '', loaddoc('common')), + (["hg.1"], '', loaddoc('hg.1')), + (["hgignore.5"], '', loaddoc('hgignore.5')), + (["hgrc.5"], '', loaddoc('hgrc.5')), + (["hgignore.5.gendoc"], '', loaddoc('hgignore')), + (["hgrc.5.gendoc"], '', loaddoc('config')), + ] + helpprinter(ui, helptable + extrahelptable, None, include=[topic]) + def helpprinter(ui, helptable, sectionfunc, include=[], exclude=[]): for names, sec, doc in helptable: if exclude and names[0] in exclude: