From 627d3b55affdaeb0d6b0429d2a760956dfc1f66a Mon Sep 17 00:00:00 2001 From: Gregory Szorc Date: Wed, 30 Dec 2015 17:12:59 -0700 Subject: [PATCH] templates: make earlycommands and othercommands optional We now have sub-topics in the help system. The "helptopics" template serves as a mechanism for displaying an index of help topics. Previously, it was only used to show the top-level list of help topics, which includes special groupings of topics. In the near future, we'll adapt "helptopics" for showing the index of sub-topics. In this patch, we optionally render {earlycommands} and {othercommands} since they aren't present on sub-topics. --- mercurial/templates/gitweb/helptopics.tmpl | 5 +++++ mercurial/templates/monoblue/helptopics.tmpl | 4 ++++ mercurial/templates/paper/helptopics.tmpl | 5 +++++ tests/test-help.t | 5 +++++ 4 files changed, 19 insertions(+) diff --git a/mercurial/templates/gitweb/helptopics.tmpl b/mercurial/templates/gitweb/helptopics.tmpl index 728889a30a..953358bdab 100644 --- a/mercurial/templates/gitweb/helptopics.tmpl +++ b/mercurial/templates/gitweb/helptopics.tmpl @@ -30,11 +30,16 @@ help

Topics

{topics % helpentry} +{if(earlycommands, '

Main Commands

{earlycommands % helpentry} +')} +{if(othercommands, '

Other Commands

{othercommands % helpentry} +')} + {footer} diff --git a/mercurial/templates/monoblue/helptopics.tmpl b/mercurial/templates/monoblue/helptopics.tmpl index 365604a918..eb919ebde5 100644 --- a/mercurial/templates/monoblue/helptopics.tmpl +++ b/mercurial/templates/monoblue/helptopics.tmpl @@ -35,11 +35,15 @@

Topics

{topics % helpentry} + {if(earlycommands, '

Main Commands

{earlycommands % helpentry} + ')} + {if(othercommands, '

Other Commands

{othercommands % helpentry} + ')} {footer} diff --git a/mercurial/templates/paper/helptopics.tmpl b/mercurial/templates/paper/helptopics.tmpl index 37dc70883d..9a56ea2104 100644 --- a/mercurial/templates/paper/helptopics.tmpl +++ b/mercurial/templates/paper/helptopics.tmpl @@ -32,11 +32,16 @@

Topics

{topics % helpentry} +{if(earlycommands, '

Main Commands

{earlycommands % helpentry} +')} +{if(othercommands, '

Other Commands

{othercommands % helpentry} +')} + diff --git a/tests/test-help.t b/tests/test-help.t index 4eb36bd6d2..3e8f995687 100644 --- a/tests/test-help.t +++ b/tests/test-help.t @@ -1787,6 +1787,7 @@ Dish up an empty repo; serve it cold. This is the topic to test omit indicating. +

Main Commands

@@ -1909,6 +1910,8 @@ Dish up an empty repo; serve it cold. update working directory (or switch revisions) + +

Other Commands

@@ -2149,6 +2152,8 @@ Dish up an empty repo; serve it cold. output version and copyright information + +