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 = '
   <tr><td>
     <a href="{url|urlescape}help/{topic|escape}{sessionvars%urlparameter}">
-      {topic|escape}
+      {if(basename, '{basename|escape}', '{topic|escape}')}
     </a>
   </td><td>
     {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 = '
   <tr><td>
     <a href="{url|urlescape}help/{topic|escape}{sessionvars%urlparameter}">
-      {topic|escape}
+      {if(basename, '{basename|escape}', '{topic|escape}')}
     </a>
   </td><td>
     {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 = '
   <tr><td>
     <a href="{url|urlescape}help/{topic|escape}{sessionvars%urlparameter}">
-      {topic|escape}
+      {if(basename, '{basename|escape}', '{topic|escape}')}
     </a>
   </td><td>
     {summary|escape}