diff --git a/mercurial/templates/gitweb/map b/mercurial/templates/gitweb/map
--- a/mercurial/templates/gitweb/map
+++ b/mercurial/templates/gitweb/map
@@ -14,7 +14,7 @@ helptopics = helptopics.tmpl
helpentry = '
- {topic|escape}
+ {if(basename, '{basename|escape}', '{topic|escape}')}
|
{summary|escape}
diff --git a/mercurial/templates/monoblue/map b/mercurial/templates/monoblue/map
--- a/mercurial/templates/monoblue/map
+++ b/mercurial/templates/monoblue/map
@@ -14,7 +14,7 @@ helptopics = helptopics.tmpl
helpentry = '
|
- {topic|escape}
+ {if(basename, '{basename|escape}', '{topic|escape}')}
|
{summary|escape}
diff --git a/mercurial/templates/paper/map b/mercurial/templates/paper/map
--- a/mercurial/templates/paper/map
+++ b/mercurial/templates/paper/map
@@ -15,7 +15,7 @@ helptopics = helptopics.tmpl
helpentry = '
|
- {topic|escape}
+ {if(basename, '{basename|escape}', '{topic|escape}')}
|
{summary|escape}
|