changeset 18258:bebb05a7e249

hgweb: add a "URL breadcrumb" to the index and repository pages The purpose of this change is to make it much easier to navigate up the repository tree when the hg web server is used to serve more than one repository. A "URL breadcrumb" is a path where each of the path items can be clicked to go to the corresponding path page. This lets you go up the folder hierarchy very quickly. For example, when showing the list of repositories in http://myserver/myteams/myprojects, the following "breadcrumb" will be shown: Mercurial > myteams > myprojects Clicking on "myprojects" reloads the page. Clicking on "myteams" goes up one folder. Clicking on the leftmost "Mercurial" goes to the server root. This "breadcrumb" also appears on all repository pages. For example on the summary page of the repository at http://myserver/myteams/myprojects/myrepo the following will be shown: Mercurial > myteams > myprojects > myrepo / summary This change has been applied to all templates that already had a link to the main repository page (i.e. gitweb, monoblue, paper and coal) plus to the index page of the spartan template. In order to make the breadcumb links stand out the some of the template styles have been customized.
author Angel Ezquerra <angel.ezquerra at gmail.com>
date Wed, 28 Nov 2012 20:21:26 +0100
parents a35d0128545e
children 7bf412b767fe
files mercurial/hgweb/hgweb_mod.py mercurial/hgweb/hgwebdir_mod.py mercurial/templates/coal/map mercurial/templates/gitweb/bookmarks.tmpl mercurial/templates/gitweb/branches.tmpl mercurial/templates/gitweb/changelog.tmpl mercurial/templates/gitweb/changeset.tmpl mercurial/templates/gitweb/error.tmpl mercurial/templates/gitweb/fileannotate.tmpl mercurial/templates/gitweb/filecomparison.tmpl mercurial/templates/gitweb/filediff.tmpl mercurial/templates/gitweb/filelog.tmpl mercurial/templates/gitweb/filerevision.tmpl mercurial/templates/gitweb/graph.tmpl mercurial/templates/gitweb/help.tmpl mercurial/templates/gitweb/helptopics.tmpl mercurial/templates/gitweb/index.tmpl mercurial/templates/gitweb/manifest.tmpl mercurial/templates/gitweb/map mercurial/templates/gitweb/search.tmpl mercurial/templates/gitweb/shortlog.tmpl mercurial/templates/gitweb/summary.tmpl mercurial/templates/gitweb/tags.tmpl mercurial/templates/monoblue/bookmarks.tmpl mercurial/templates/monoblue/branches.tmpl mercurial/templates/monoblue/changelog.tmpl mercurial/templates/monoblue/changeset.tmpl mercurial/templates/monoblue/error.tmpl mercurial/templates/monoblue/fileannotate.tmpl mercurial/templates/monoblue/filecomparison.tmpl mercurial/templates/monoblue/filediff.tmpl mercurial/templates/monoblue/filelog.tmpl mercurial/templates/monoblue/filerevision.tmpl mercurial/templates/monoblue/graph.tmpl mercurial/templates/monoblue/help.tmpl mercurial/templates/monoblue/helptopics.tmpl mercurial/templates/monoblue/index.tmpl mercurial/templates/monoblue/manifest.tmpl mercurial/templates/monoblue/map mercurial/templates/monoblue/notfound.tmpl mercurial/templates/monoblue/search.tmpl mercurial/templates/monoblue/shortlog.tmpl mercurial/templates/monoblue/summary.tmpl mercurial/templates/monoblue/tags.tmpl mercurial/templates/paper/bookmarks.tmpl mercurial/templates/paper/branches.tmpl mercurial/templates/paper/changeset.tmpl mercurial/templates/paper/error.tmpl mercurial/templates/paper/fileannotate.tmpl mercurial/templates/paper/filecomparison.tmpl mercurial/templates/paper/filediff.tmpl mercurial/templates/paper/filelog.tmpl mercurial/templates/paper/filerevision.tmpl mercurial/templates/paper/graph.tmpl mercurial/templates/paper/help.tmpl mercurial/templates/paper/helptopics.tmpl mercurial/templates/paper/index.tmpl mercurial/templates/paper/manifest.tmpl mercurial/templates/paper/map mercurial/templates/paper/search.tmpl mercurial/templates/paper/shortlog.tmpl mercurial/templates/paper/tags.tmpl mercurial/templates/spartan/index.tmpl mercurial/templates/spartan/map mercurial/templates/static/style-coal.css mercurial/templates/static/style-monoblue.css mercurial/templates/static/style-paper.css
diffstat 67 files changed, 128 insertions(+), 60 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb/hgweb_mod.py
+++ b/mercurial/hgweb/hgweb_mod.py
@@ -24,6 +24,30 @@
     'pushkey': 'push',
 }
 
+def makebreadcrumb(url):
+    '''Return a 'URL breadcrumb' list
+
+    A 'URL breadcrumb' is a list of URL-name pairs,
+    corresponding to each of the path items on a URL.
+    This can be used to create path navigation entries.
+    '''
+    if url.endswith('/'):
+        url = url[:-1]
+    relpath = url
+    if relpath.startswith('/'):
+        relpath = relpath[1:]
+
+    breadcrumb = []
+    urlel = url
+    pathitems = [''] + relpath.split('/')
+    for pathel in reversed(pathitems):
+        if not pathel or not urlel:
+            break
+        breadcrumb.append({'url': urlel, 'name': pathel})
+        urlel = os.path.dirname(urlel)
+    return reversed(breadcrumb)
+
+
 class hgweb(object):
     def __init__(self, repo, name=None, baseui=None):
         if isinstance(repo, str):
@@ -285,7 +309,8 @@
                                              "header": header,
                                              "footer": footer,
                                              "motd": motd,
-                                             "sessionvars": sessionvars
+                                             "sessionvars": sessionvars,
+                                             "pathdef": makebreadcrumb(req.url),
                                             })
         return tmpl
 
--- a/mercurial/hgweb/hgwebdir_mod.py
+++ b/mercurial/hgweb/hgwebdir_mod.py
@@ -12,7 +12,7 @@
 from mercurial import error, encoding
 from common import ErrorResponse, get_mtime, staticfile, paritygen, \
                    get_contact, HTTP_OK, HTTP_NOT_FOUND, HTTP_SERVER_ERROR
-from hgweb_mod import hgweb
+from hgweb_mod import hgweb, makebreadcrumb
 from request import wsgirequest
 import webutil
 
@@ -395,6 +395,7 @@
         self.updatereqenv(req.env)
 
         return tmpl("index", entries=entries, subdir=subdir,
+                    pathdef=makebreadcrumb('/' + subdir),
                     sortcolumn=sortcolumn, descending=descending,
                     **dict(sort))
 
--- a/mercurial/templates/coal/map
+++ b/mercurial/templates/coal/map
@@ -223,3 +223,4 @@
 error = ../paper/error.tmpl
 urlparameter = '{separator}{name}={value|urlescape}'
 hiddenformentry = '<input type="hidden" name="{name}" value="{value|escape}" />'
+breadcrumb = '&gt; <a href="{url}">{name}</a> '
--- a/mercurial/templates/gitweb/bookmarks.tmpl
+++ b/mercurial/templates/gitweb/bookmarks.tmpl
@@ -8,7 +8,8 @@
 <body>
 
 <div class="page_header">
-<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a><a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a> / bookmarks
+<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
+<a href="/">Mercurial</a> {pathdef%breadcrumb} / bookmarks
 </div>
 
 <div class="page_nav">
--- a/mercurial/templates/gitweb/branches.tmpl
+++ b/mercurial/templates/gitweb/branches.tmpl
@@ -8,7 +8,8 @@
 <body>
 
 <div class="page_header">
-<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a><a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a> / branches
+<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
+<a href="/">Mercurial</a> {pathdef%breadcrumb} / branches
 </div>
 
 <div class="page_nav">
--- a/mercurial/templates/gitweb/changelog.tmpl
+++ b/mercurial/templates/gitweb/changelog.tmpl
@@ -8,7 +8,8 @@
 <body>
 
 <div class="page_header">
-<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a><a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a> / changelog
+<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
+<a href="/">Mercurial</a> {pathdef%breadcrumb} / changelog
 </div>
 
 <form action="{url}log">
--- a/mercurial/templates/gitweb/changeset.tmpl
+++ b/mercurial/templates/gitweb/changeset.tmpl
@@ -8,7 +8,8 @@
 <body>
 
 <div class="page_header">
-<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a><a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a> / changeset
+<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
+<a href="/">Mercurial</a> {pathdef%breadcrumb} / changeset
 </div>
 
 <div class="page_nav">
--- a/mercurial/templates/gitweb/error.tmpl
+++ b/mercurial/templates/gitweb/error.tmpl
@@ -8,7 +8,8 @@
 <body>
 
 <div class="page_header">
-<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a><a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a> / error
+<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
+<a href="/">Mercurial</a> {pathdef%breadcrumb} / error
 </div>
 
 <div class="page_nav">
--- a/mercurial/templates/gitweb/fileannotate.tmpl
+++ b/mercurial/templates/gitweb/fileannotate.tmpl
@@ -8,7 +8,8 @@
 <body>
 
 <div class="page_header">
-<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a><a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a> / annotate
+<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
+<a href="/">Mercurial</a> {pathdef%breadcrumb} / annotate
 </div>
 
 <div class="page_nav">
--- a/mercurial/templates/gitweb/filecomparison.tmpl
+++ b/mercurial/templates/gitweb/filecomparison.tmpl
@@ -8,7 +8,8 @@
 <body>
 
 <div class="page_header">
-<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a><a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a> / comparison
+<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
+<a href="/">Mercurial</a> {pathdef%breadcrumb} / comparison
 </div>
 
 <div class="page_nav">
--- a/mercurial/templates/gitweb/filediff.tmpl
+++ b/mercurial/templates/gitweb/filediff.tmpl
@@ -8,7 +8,8 @@
 <body>
 
 <div class="page_header">
-<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a><a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a> / diff
+<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
+<a href="/">Mercurial</a> {pathdef%breadcrumb} / diff
 </div>
 
 <div class="page_nav">
--- a/mercurial/templates/gitweb/filelog.tmpl
+++ b/mercurial/templates/gitweb/filelog.tmpl
@@ -8,7 +8,8 @@
 <body>
 
 <div class="page_header">
-<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a><a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a> / file revisions
+<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
+<a href="/">Mercurial</a> {pathdef%breadcrumb} / file revisions
 </div>
 
 <div class="page_nav">
--- a/mercurial/templates/gitweb/filerevision.tmpl
+++ b/mercurial/templates/gitweb/filerevision.tmpl
@@ -8,7 +8,8 @@
 <body>
 
 <div class="page_header">
-<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a><a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a> / file revision
+<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
+<a href="/">Mercurial</a> {pathdef%breadcrumb} / file revision
 </div>
 
 <div class="page_nav">
--- a/mercurial/templates/gitweb/graph.tmpl
+++ b/mercurial/templates/gitweb/graph.tmpl
@@ -9,7 +9,8 @@
 <body>
 
 <div class="page_header">
-<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a><a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a> / graph
+<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
+<a href="/">Mercurial</a> {pathdef%breadcrumb} / graph
 </div>
 
 <form action="{url}log">
--- a/mercurial/templates/gitweb/help.tmpl
+++ b/mercurial/templates/gitweb/help.tmpl
@@ -8,7 +8,8 @@
 <body>
 
 <div class="page_header">
-<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a><a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a> / help
+<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
+<a href="/">Mercurial</a> {pathdef%breadcrumb} / help
 </div>
 
 <div class="page_nav">
--- a/mercurial/templates/gitweb/helptopics.tmpl
+++ b/mercurial/templates/gitweb/helptopics.tmpl
@@ -8,7 +8,8 @@
 <body>
 
 <div class="page_header">
-<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a><a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a> / help
+<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
+<a href="/">Mercurial</a> {pathdef%breadcrumb} / help
 </div>
 
 <div class="page_nav">
--- a/mercurial/templates/gitweb/index.tmpl
+++ b/mercurial/templates/gitweb/index.tmpl
@@ -5,7 +5,7 @@
 
 <div class="page_header">
     <a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
-    Repositories list
+    <a href="/">Mercurial</a> {pathdef%breadcrumb}
 </div>
 
 <table cellspacing="0">
--- a/mercurial/templates/gitweb/manifest.tmpl
+++ b/mercurial/templates/gitweb/manifest.tmpl
@@ -8,7 +8,8 @@
 <body>
 
 <div class="page_header">
-<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a><a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a> / files
+<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
+<a href="/">Mercurial</a> {pathdef%breadcrumb} / files
 </div>
 
 <div class="page_nav">
--- a/mercurial/templates/gitweb/map
+++ b/mercurial/templates/gitweb/map
@@ -305,3 +305,4 @@
 index = index.tmpl
 urlparameter = '{separator}{name}={value|urlescape}'
 hiddenformentry = '<input type="hidden" name="{name}" value="{value|escape}" />'
+breadcrumb = '&gt; <a href="{url}">{name}</a> '
--- a/mercurial/templates/gitweb/search.tmpl
+++ b/mercurial/templates/gitweb/search.tmpl
@@ -8,7 +8,8 @@
 <body>
 
 <div class="page_header">
-<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a><a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a> / search
+<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
+<a href="/">Mercurial</a> {pathdef%breadcrumb} / search
 
 <form action="{url}log">
 {sessionvars%hiddenformentry}
--- a/mercurial/templates/gitweb/shortlog.tmpl
+++ b/mercurial/templates/gitweb/shortlog.tmpl
@@ -8,7 +8,8 @@
 <body>
 
 <div class="page_header">
-<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a><a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a> / shortlog
+<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
+<a href="/">Mercurial</a> {pathdef%breadcrumb} / shortlog
 </div>
 
 <form action="{url}log">
--- a/mercurial/templates/gitweb/summary.tmpl
+++ b/mercurial/templates/gitweb/summary.tmpl
@@ -8,8 +8,8 @@
 <body>
 
 <div class="page_header">
-<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a><a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a> / summary
-
+<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
+<a href="/">Mercurial</a> {pathdef%breadcrumb} / summary
 <form action="{url}log">
 {sessionvars%hiddenformentry}
 <div class="search">
--- a/mercurial/templates/gitweb/tags.tmpl
+++ b/mercurial/templates/gitweb/tags.tmpl
@@ -8,7 +8,8 @@
 <body>
 
 <div class="page_header">
-<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a><a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a> / tags
+<a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
+<a href="/">Mercurial</a> {pathdef%breadcrumb} / tags
 </div>
 
 <div class="page_nav">
--- a/mercurial/templates/monoblue/bookmarks.tmpl
+++ b/mercurial/templates/monoblue/bookmarks.tmpl
@@ -7,7 +7,7 @@
 <body>
 <div id="container">
     <div class="page-header">
-        <h1><a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a> / bookmarks</h1>
+        <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / bookmarks</h1>
 
         <form action="{url}log">
             {sessionvars%hiddenformentry}
--- a/mercurial/templates/monoblue/branches.tmpl
+++ b/mercurial/templates/monoblue/branches.tmpl
@@ -7,7 +7,7 @@
 <body>
 <div id="container">
     <div class="page-header">
-        <h1><a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a> / branches</h1>
+        <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / branches</h1>
 
         <form action="{url}log">
             {sessionvars%hiddenformentry}
--- a/mercurial/templates/monoblue/changelog.tmpl
+++ b/mercurial/templates/monoblue/changelog.tmpl
@@ -7,7 +7,7 @@
 <body>
 <div id="container">
     <div class="page-header">
-        <h1><a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a> / changelog</h1>
+        <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / changelog</h1>
 
         <form action="{url}log">
             {sessionvars%hiddenformentry}
--- a/mercurial/templates/monoblue/changeset.tmpl
+++ b/mercurial/templates/monoblue/changeset.tmpl
@@ -7,7 +7,7 @@
 <body>
 <div id="container">
     <div class="page-header">
-        <h1><a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a> / changeset</h1>
+        <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / changeset</h1>
 
         <form action="{url}log">
             {sessionvars%hiddenformentry}
--- a/mercurial/templates/monoblue/error.tmpl
+++ b/mercurial/templates/monoblue/error.tmpl
@@ -7,7 +7,7 @@
 <body>
 <div id="container">
     <div class="page-header">
-        <h1><a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a> / not found: {repo|escape}</h1>
+        <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / not found: {repo|escape}</h1>
 
         <form action="{url}log">
             {sessionvars%hiddenformentry}
--- a/mercurial/templates/monoblue/fileannotate.tmpl
+++ b/mercurial/templates/monoblue/fileannotate.tmpl
@@ -7,7 +7,7 @@
 <body>
 <div id="container">
     <div class="page-header">
-        <h1><a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a> / annotate</h1>
+        <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / annotate</h1>
 
         <form action="{url}log">
             {sessionvars%hiddenformentry}
--- a/mercurial/templates/monoblue/filecomparison.tmpl
+++ b/mercurial/templates/monoblue/filecomparison.tmpl
@@ -7,7 +7,7 @@
 <body>
 <div id="container">
     <div class="page-header">
-        <h1><a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a> / file comparison</h1>
+        <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / file comparison</h1>
 
         <form action="{url}log">
             {sessionvars%hiddenformentry}
--- a/mercurial/templates/monoblue/filediff.tmpl
+++ b/mercurial/templates/monoblue/filediff.tmpl
@@ -7,7 +7,7 @@
 <body>
 <div id="container">
     <div class="page-header">
-        <h1><a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a> / file diff</h1>
+        <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / file diff</h1>
 
         <form action="{url}log">
             {sessionvars%hiddenformentry}
--- a/mercurial/templates/monoblue/filelog.tmpl
+++ b/mercurial/templates/monoblue/filelog.tmpl
@@ -7,7 +7,7 @@
 <body>
 <div id="container">
     <div class="page-header">
-        <h1><a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a> / file revisions</h1>
+        <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / file revisions</h1>
 
         <form action="{url}log">
             {sessionvars%hiddenformentry}
--- a/mercurial/templates/monoblue/filerevision.tmpl
+++ b/mercurial/templates/monoblue/filerevision.tmpl
@@ -7,7 +7,7 @@
 <body>
 <div id="container">
     <div class="page-header">
-        <h1><a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a> / file revision</h1>
+        <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / file revision</h1>
 
         <form action="{url}log">
             {sessionvars%hiddenformentry}
--- a/mercurial/templates/monoblue/graph.tmpl
+++ b/mercurial/templates/monoblue/graph.tmpl
@@ -8,7 +8,7 @@
 <body>
 <div id="container">
     <div class="page-header">
-        <h1><a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a> / graph</h1>
+        <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / graph</h1>
 
         <form action="{url}log">
             {sessionvars%hiddenformentry}
--- a/mercurial/templates/monoblue/help.tmpl
+++ b/mercurial/templates/monoblue/help.tmpl
@@ -7,7 +7,7 @@
 <body>
 <div id="container">
     <div class="page-header">
-        <h1><a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a> / help</h1>
+        <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / help</h1>
 
         <form action="{url}log">
             {sessionvars%hiddenformentry}
--- a/mercurial/templates/monoblue/helptopics.tmpl
+++ b/mercurial/templates/monoblue/helptopics.tmpl
@@ -7,7 +7,7 @@
 <body>
 <div id="container">
     <div class="page-header">
-        <h1><a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a> / help</h1>
+        <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / help</h1>
 
         <form action="{url}log">
             {sessionvars%hiddenformentry}
--- a/mercurial/templates/monoblue/index.tmpl
+++ b/mercurial/templates/monoblue/index.tmpl
@@ -5,7 +5,7 @@
 <body>
 <div id="container">
     <div class="page-header">
-        <h1>Mercurial Repositories</h1>
+        <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h1>
         <ul class="page-nav">
         </ul>
     </div>
--- a/mercurial/templates/monoblue/manifest.tmpl
+++ b/mercurial/templates/monoblue/manifest.tmpl
@@ -7,7 +7,7 @@
 <body>
 <div id="container">
     <div class="page-header">
-        <h1><a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a> / files</h1>
+        <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / files</h1>
 
         <form action="{url}log">
             {sessionvars%hiddenformentry}
--- a/mercurial/templates/monoblue/map
+++ b/mercurial/templates/monoblue/map
@@ -259,3 +259,4 @@
 urlparameter = '{separator}{name}={value|urlescape}'
 hiddenformentry = '<input type="hidden" name="{name}" value="{value|escape}" />'
 graph = graph.tmpl
+breadcrumb = '&gt; <a href="{url}">{name}</a> '
--- a/mercurial/templates/monoblue/notfound.tmpl
+++ b/mercurial/templates/monoblue/notfound.tmpl
@@ -7,7 +7,7 @@
 <body>
 <div id="container">
     <div class="page-header">
-        <h1><a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a> / not found: {repo|escape}</h1>
+        <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / not found: {repo|escape}</h1>
 
         <form action="{url}log">
             {sessionvars%hiddenformentry}
--- a/mercurial/templates/monoblue/search.tmpl
+++ b/mercurial/templates/monoblue/search.tmpl
@@ -7,7 +7,7 @@
 <body>
 <div id="container">
     <div class="page-header">
-        <h1><a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a> / search</h1>
+        <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / search</h1>
 
         <form action="{url}log">
             {sessionvars%hiddenformentry}
--- a/mercurial/templates/monoblue/shortlog.tmpl
+++ b/mercurial/templates/monoblue/shortlog.tmpl
@@ -7,7 +7,7 @@
 <body>
 <div id="container">
     <div class="page-header">
-        <h1><a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a> / shortlog</h1>
+        <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / shortlog</h1>
 
         <form action="{url}log">
             {sessionvars%hiddenformentry}
--- a/mercurial/templates/monoblue/summary.tmpl
+++ b/mercurial/templates/monoblue/summary.tmpl
@@ -7,7 +7,7 @@
 <body>
 <div id="container">
     <div class="page-header">
-        <h1><a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a> / summary</h1>
+        <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / summary</h1>
 
         <form action="{url}log">
             {sessionvars%hiddenformentry}
--- a/mercurial/templates/monoblue/tags.tmpl
+++ b/mercurial/templates/monoblue/tags.tmpl
@@ -7,7 +7,7 @@
 <body>
 <div id="container">
     <div class="page-header">
-        <h1><a href="{url}summary{sessionvars%urlparameter}">{repo|escape}</a> / tags</h1>
+        <h1 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb} / tags</h1>
 
         <form action="{url}log">
             {sessionvars%hiddenformentry}
--- a/mercurial/templates/paper/bookmarks.tmpl
+++ b/mercurial/templates/paper/bookmarks.tmpl
@@ -32,7 +32,7 @@
 </div>
 
 <div class="main">
-<h2><a href="{url}{sessionvars%urlparameter}">{repo|escape}</a></h2>
+<h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
 <h3>bookmarks</h3>
 
 <form class="search" action="{url}log">
--- a/mercurial/templates/paper/branches.tmpl
+++ b/mercurial/templates/paper/branches.tmpl
@@ -32,7 +32,7 @@
 </div>
 
 <div class="main">
-<h2><a href="{url}{sessionvars%urlparameter}">{repo|escape}</a></h2>
+<h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
 <h3>branches</h3>
 
 <form class="search" action="{url}log">
--- a/mercurial/templates/paper/changeset.tmpl
+++ b/mercurial/templates/paper/changeset.tmpl
@@ -30,7 +30,7 @@
 
 <div class="main">
 
-<h2><a href="{url}{sessionvars%urlparameter}">{repo|escape}</a></h2>
+<h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
 <h3>changeset {rev}:{node|short} {changesetbranch%changelogbranchname} {changesettag} {changesetbookmark}</h3>
 
 <form class="search" action="{url}log">
--- a/mercurial/templates/paper/error.tmpl
+++ b/mercurial/templates/paper/error.tmpl
@@ -23,7 +23,7 @@
 
 <div class="main">
 
-<h2><a href="{url}{sessionvars%urlparameter}">{repo|escape}</a></h2>
+<h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
 <h3>error</h3>
 
 <form class="search" action="{url}log">
--- a/mercurial/templates/paper/fileannotate.tmpl
+++ b/mercurial/templates/paper/fileannotate.tmpl
@@ -36,7 +36,7 @@
 </div>
 
 <div class="main">
-<h2><a href="{url}{sessionvars%urlparameter}">{repo|escape}</a></h2>
+<h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
 <h3>annotate {file|escape} @ {rev}:{node|short}</h3>
 
 <form class="search" action="{url}log">
--- a/mercurial/templates/paper/filecomparison.tmpl
+++ b/mercurial/templates/paper/filecomparison.tmpl
@@ -35,7 +35,7 @@
 </div>
 
 <div class="main">
-<h2><a href="{url}{sessionvars%urlparameter}">{repo|escape}</a></h2>
+<h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
 <h3>comparison {file|escape} @ {rev}:{node|short}</h3>
 
 <form class="search" action="{url}log">
--- a/mercurial/templates/paper/filediff.tmpl
+++ b/mercurial/templates/paper/filediff.tmpl
@@ -35,7 +35,7 @@
 </div>
 
 <div class="main">
-<h2><a href="{url}{sessionvars%urlparameter}">{repo|escape}</a></h2>
+<h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
 <h3>diff {file|escape} @ {rev}:{node|short}</h3>
 
 <form class="search" action="{url}log">
--- a/mercurial/templates/paper/filelog.tmpl
+++ b/mercurial/templates/paper/filelog.tmpl
@@ -43,7 +43,7 @@
 </div>
 
 <div class="main">
-<h2><a href="{url}{sessionvars%urlparameter}">{repo|escape}</a></h2>
+<h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
 <h3>log {file|escape}</h3>
 
 <form class="search" action="{url}log">
--- a/mercurial/templates/paper/filerevision.tmpl
+++ b/mercurial/templates/paper/filerevision.tmpl
@@ -34,7 +34,7 @@
 </div>
 
 <div class="main">
-<h2><a href="{url}{sessionvars%urlparameter}">{repo|escape}</a></h2>
+<h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
 <h3>view {file|escape} @ {rev}:{node|short}</h3>
 
 <form class="search" action="{url}log">
--- a/mercurial/templates/paper/graph.tmpl
+++ b/mercurial/templates/paper/graph.tmpl
@@ -37,7 +37,7 @@
 </div>
 
 <div class="main">
-<h2><a href="{url}{sessionvars%urlparameter}">{repo|escape}</a></h2>
+<h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
 <h3>graph</h3>
 
 <form class="search" action="{url}log">
--- a/mercurial/templates/paper/help.tmpl
+++ b/mercurial/templates/paper/help.tmpl
@@ -22,7 +22,7 @@
 </div>
 
 <div class="main">
-<h2><a href="{url}{sessionvars%urlparameter}">{repo|escape}</a></h2>
+<h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
 <h3>Help: {topic}</h3>
 
 <form class="search" action="{url}log">
--- a/mercurial/templates/paper/helptopics.tmpl
+++ b/mercurial/templates/paper/helptopics.tmpl
@@ -22,7 +22,7 @@
 </div>
 
 <div class="main">
-<h2><a href="{url}{sessionvars%urlparameter}">{repo|escape}</a></h2>
+<h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
 <form class="search" action="{url}log">
 {sessionvars%hiddenformentry}
 <p><input name="rev" id="search1" type="text" size="30" /></p>
--- a/mercurial/templates/paper/index.tmpl
+++ b/mercurial/templates/paper/index.tmpl
@@ -9,7 +9,7 @@
 <img src="{staticurl}{logoimg}" width=75 height=90 border=0 alt="mercurial" /></a>
 </div>
 <div class="main">
-<h2>Mercurial Repositories</h2>
+<h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
 
 <table class="bigtable">
     <tr>
--- a/mercurial/templates/paper/manifest.tmpl
+++ b/mercurial/templates/paper/manifest.tmpl
@@ -29,7 +29,7 @@
 </div>
 
 <div class="main">
-<h2><a href="{url}{sessionvars%urlparameter}">{repo|escape}</a></h2>
+<h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
 <h3>directory {path|escape} @ {rev}:{node|short} {tags%changelogtag}</h3>
 
 <form class="search" action="{url}log">
--- a/mercurial/templates/paper/map
+++ b/mercurial/templates/paper/map
@@ -231,3 +231,4 @@
 error = error.tmpl
 urlparameter = '{separator}{name}={value|urlescape}'
 hiddenformentry = '<input type="hidden" name="{name}" value="{value|escape}" />'
+breadcrumb = '&gt; <a href="{url}">{name}</a> '
--- a/mercurial/templates/paper/search.tmpl
+++ b/mercurial/templates/paper/search.tmpl
@@ -20,7 +20,7 @@
 </div>
 
 <div class="main">
-<h2><a href="{url}{sessionvars%urlparameter}">{repo|escape}</a></h2>
+<h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
 <h3>searching for '{query|escape}'</h3>
 
 <form class="search" action="{url}log">
--- a/mercurial/templates/paper/shortlog.tmpl
+++ b/mercurial/templates/paper/shortlog.tmpl
@@ -39,7 +39,7 @@
 </div>
 
 <div class="main">
-<h2><a href="{url}{sessionvars%urlparameter}">{repo|escape}</a></h2>
+<h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
 <h3>log</h3>
 
 <form class="search" action="{url}log">
--- a/mercurial/templates/paper/tags.tmpl
+++ b/mercurial/templates/paper/tags.tmpl
@@ -31,7 +31,7 @@
 </div>
 
 <div class="main">
-<h2><a href="{url}{sessionvars%urlparameter}">{repo|escape}</a></h2>
+<h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
 <h3>tags</h3>
 
 <form class="search" action="{url}log">
--- a/mercurial/templates/spartan/index.tmpl
+++ b/mercurial/templates/spartan/index.tmpl
@@ -3,7 +3,7 @@
 </head>
 <body>
 
-<h2>Mercurial Repositories</h2>
+<h2><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
 
 <table>
     <tr>
--- a/mercurial/templates/spartan/map
+++ b/mercurial/templates/spartan/map
@@ -181,3 +181,4 @@
 error = error.tmpl
 urlparameter = '{separator}{name}={value|urlescape}'
 hiddenformentry = '<input type="hidden" name="{name}" value="{value|escape}" />'
+breadcrumb = '&gt; <a href="{url}">{name}</a> '
--- a/mercurial/templates/static/style-coal.css
+++ b/mercurial/templates/static/style-coal.css
@@ -323,3 +323,11 @@
 .block {
     border-top: 1px solid #999;
 }
+
+.breadcrumb {
+    color: gray;
+}
+
+.breadcrumb a {
+    color: blue;
+}
--- a/mercurial/templates/static/style-monoblue.css
+++ b/mercurial/templates/static/style-monoblue.css
@@ -524,3 +524,7 @@
     border-top: 1px solid #999;
 }
 /** end of comparison **/
+
+.breadcrumb a:hover {
+    text-decoration:underline;
+}
--- a/mercurial/templates/static/style-paper.css
+++ b/mercurial/templates/static/style-paper.css
@@ -318,3 +318,11 @@
 .block {
     border-top: 1px solid #999;
 }
+
+.breadcrumb {
+    color: gray;
+}
+
+.breadcrumb a {
+    color: blue;
+}