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

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

Comments

Anton Shestakov - May 18, 2015, 12:47 p.m.
# HG changeset patch
# User Anton Shestakov <engored@ya.ru>
# Date 1431691247 -28800
#      Fri May 15 20:00:47 2015 +0800
# Node ID d1f5e3d60dc5b9e53d78d381b7fb35bfa9a8114b
# Parent  97b34b05191815e2abb14f6345bf7dc7b49ee53c
hgweb: show branch/tags/bookmarks when viewing (style=paper) (issue3559)

Patch

diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py
+++ b/mercurial/hgweb/webcommands.py
@@ -130,6 +130,8 @@  def _filerevision(web, tmpl, fctx):
                 parent=webutil.parents(fctx),
                 child=webutil.children(fctx),
                 rename=webutil.renamelink(fctx),
+                tags=webutil.nodetagsdict(web.repo, fctx.node()),
+                bookmarks=webutil.nodebookmarksdict(web.repo, fctx.node()),
                 permissions=fctx.manifest().flags(f))
 
 @webcommand('file')
diff --git a/mercurial/templates/paper/filerevision.tmpl b/mercurial/templates/paper/filerevision.tmpl
--- a/mercurial/templates/paper/filerevision.tmpl
+++ b/mercurial/templates/paper/filerevision.tmpl
@@ -36,7 +36,7 @@ 
 
 <div class="main">
 <h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
-<h3>view {file|escape} @ {rev}:{node|short}</h3>
+<h3>view {file|escape} @ {rev}:{node|short} {branch%changelogbranchname}{tags%changelogtag}{bookmarks%changelogtag}</h3>
 
 <form class="search" action="{url|urlescape}log">
 {sessionvars%hiddenformentry}
diff --git a/tests/test-hgweb-commands.t b/tests/test-hgweb-commands.t
--- a/tests/test-hgweb-commands.t
+++ b/tests/test-hgweb-commands.t
@@ -1295,7 +1295,7 @@  File-related
   
   <div class="main">
   <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
-  <h3>view foo @ 1:a4f92ed23982</h3>
+  <h3>view foo @ 1:a4f92ed23982 </h3>
   
   <form class="search" action="/log">
   
@@ -1419,7 +1419,7 @@  File-related
   
   <div class="main">
   <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
-  <h3>view foo @ 2:1d22e65f027e</h3>
+  <h3>view foo @ 2:1d22e65f027e <span class="branchname">stable</span> </h3>
   
   <form class="search" action="/log">
   
diff --git a/tests/test-highlight.t b/tests/test-highlight.t
--- a/tests/test-highlight.t
+++ b/tests/test-highlight.t
@@ -105,7 +105,7 @@  hgweb filerevision, html
   
   <div class="main">
   <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
-  <h3>view primes.py @ 0:853dcd4de2a6</h3>
+  <h3>view primes.py @ 0:853dcd4de2a6 <span class="tag">tip</span> </h3>
   
   <form class="search" action="/log">