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

login
register
mail settings
Submitter Anton Shestakov
Date May 18, 2015, 12:47 p.m.
Message ID <97b34b05191815e2abb1.1431953220@neuro>
Download mbox | patch
Permalink /patch/9123/
State Accepted
Headers show

Comments

Anton Shestakov - May 18, 2015, 12:47 p.m.
# HG changeset patch
# User Anton Shestakov <engored@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.

Patch

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}