[PATCH 1 of 5] hgweb: show branch/tags/bookmarks when browsing (style=paper) (issue3559)

Anton Shestakov engored at ya.ru
Mon May 18 12:47:00 UTC 2015


# HG changeset patch
# User Anton Shestakov <engored at ya.ru>
# Date 1431685056 -28800
#      Fri May 15 18:17:36 2015 +0800
# Node ID 97b34b05191815e2abb14f6345bf7dc7b49ee53c
# Parent  32e1953f55e2b7a094555ac5b452853b4543e9f0
hgweb: show branch/tags/bookmarks when browsing (style=paper) (issue3559)

Browse (or manifest) action allows browsing the directory structure at some
specified revision. In gitweb and monoblue styles, the revision header already
has branch/tag/bookmark information for the revision, but in paper style this
header was only showing tags. This patch adds branches and bookmarks.

Branch name needs to be obtained in this special way to be consistent with
regular changeset page, where in paper style default branch is never shown.

diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py
+++ b/mercurial/hgweb/webcommands.py
@@ -546,6 +546,7 @@ def manifest(web, req, tmpl):
                 archives=web.archivelist(hex(node)),
                 tags=webutil.nodetagsdict(web.repo, node),
                 bookmarks=webutil.nodebookmarksdict(web.repo, node),
+                branch=webutil.nodebranchnodefault(ctx),
                 inbranch=webutil.nodeinbranch(web.repo, ctx),
                 branches=webutil.nodebranchdict(web.repo, ctx))
 
diff --git a/mercurial/templates/paper/manifest.tmpl b/mercurial/templates/paper/manifest.tmpl
--- a/mercurial/templates/paper/manifest.tmpl
+++ b/mercurial/templates/paper/manifest.tmpl
@@ -30,7 +30,7 @@
 
 <div class="main">
 <h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
-<h3>directory {path|escape} @ {rev}:{node|short} {tags%changelogtag}</h3>
+<h3>directory {path|escape} @ {rev}:{node|short} {branch%changelogbranchname}{tags%changelogtag}{bookmarks%changelogtag}</h3>
 
 <form class="search" action="{url|urlescape}log">
 {sessionvars%hiddenformentry}


More information about the Mercurial-devel mailing list