paper: show branch/tags/bookmarks when viewing (issue3559)
authorAnton Shestakov <engored@ya.ru>
Fri, 15 May 2015 20:00:47 +0800
changeset 25133 3d82c517b9c5
parent 25132 917b5a071888
child 25134 339e3cc073ac
paper: show branch/tags/bookmarks when viewing (issue3559)
mercurial/hgweb/webcommands.py
mercurial/templates/paper/filerevision.tmpl
tests/test-hgweb-commands.t
tests/test-highlight.t
--- a/mercurial/hgweb/webcommands.py	Fri May 15 18:17:36 2015 +0800
+++ b/mercurial/hgweb/webcommands.py	Fri May 15 20:00:47 2015 +0800
@@ -130,6 +130,8 @@
                 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')
--- a/mercurial/templates/paper/filerevision.tmpl	Fri May 15 18:17:36 2015 +0800
+++ b/mercurial/templates/paper/filerevision.tmpl	Fri May 15 20:00:47 2015 +0800
@@ -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}
--- a/tests/test-hgweb-commands.t	Fri May 15 18:17:36 2015 +0800
+++ b/tests/test-hgweb-commands.t	Fri May 15 20:00:47 2015 +0800
@@ -1295,7 +1295,7 @@
   
   <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 @@
   
   <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">
   
--- a/tests/test-highlight.t	Fri May 15 18:17:36 2015 +0800
+++ b/tests/test-highlight.t	Fri May 15 20:00:47 2015 +0800
@@ -105,7 +105,7 @@
   
   <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">