changeset 27081:37290f2f2c3b

paper: show current revision on file log page Most of the pages in paper (and coal) style show the current revision and its branch, tags and bookmarks. Let's also show all this on file log page.
author Anton Shestakov <av6@dwimlabs.net>
date Fri, 13 Nov 2015 18:31:58 +0800
parents ae2d3782d818
children 4898e442f392
files mercurial/hgweb/webcommands.py mercurial/templates/paper/filelog.tmpl tests/test-hgweb-filelog.t tests/test-hgweb-symrev.t
diffstat 4 files changed, 26 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb/webcommands.py	Fri Nov 20 11:26:31 2015 -0800
+++ b/mercurial/hgweb/webcommands.py	Fri Nov 13 18:31:58 2015 +0800
@@ -1045,7 +1045,11 @@
     revnav = webutil.filerevnav(web.repo, fctx.path())
     nav = revnav.gen(end - 1, revcount, count)
     return tmpl("filelog", file=f, node=fctx.hex(), nav=nav,
+                rev=fctx.rev(),
                 symrev=webutil.symrevorshortnode(req, fctx),
+                branch=webutil.nodebranchnodefault(fctx),
+                tags=webutil.nodetagsdict(web.repo, fctx.node()),
+                bookmarks=webutil.nodebookmarksdict(web.repo, fctx.node()),
                 entries=entries,
                 latestentry=latestentry,
                 revcount=revcount, morevars=morevars, lessvars=lessvars)
--- a/mercurial/templates/paper/filelog.tmpl	Fri Nov 20 11:26:31 2015 -0800
+++ b/mercurial/templates/paper/filelog.tmpl	Fri Nov 13 18:31:58 2015 +0800
@@ -44,7 +44,10 @@
 
 <div class="main">
 <h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
-<h3>log {file|escape}</h3>
+<h3>
+ log {file|escape} @ {rev}:<a href="{url|urlescape}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a>
+ {branch%changelogbranchname}{tags%changelogtag}{bookmarks%changelogtag}
+</h3>
 
 <form class="search" action="{url|urlescape}log">
 {sessionvars%hiddenformentry}
--- a/tests/test-hgweb-filelog.t	Fri Nov 20 11:26:31 2015 -0800
+++ b/tests/test-hgweb-filelog.t	Fri Nov 13 18:31:58 2015 +0800
@@ -187,7 +187,10 @@
   
   <div class="main">
   <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
-  <h3>log a</h3>
+  <h3>
+   log a @ 4:<a href="/rev/3f41bc784e7e">3f41bc784e7e</a>
+   <span class="branchname">a-branch</span> 
+  </h3>
   
   <form class="search" action="/log">
   
@@ -304,7 +307,10 @@
   
   <div class="main">
   <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
-  <h3>log a</h3>
+  <h3>
+   log a @ 4:<a href="/rev/3f41bc784e7e">3f41bc784e7e</a>
+   <span class="branchname">a-branch</span> 
+  </h3>
   
   <form class="search" action="/log">
   
@@ -421,7 +427,10 @@
   
   <div class="main">
   <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
-  <h3>log a</h3>
+  <h3>
+   log a @ 1:<a href="/rev/5ed941583260">5ed941583260</a>
+   <span class="tag">a-tag</span> <span class="tag">a-bookmark</span> 
+  </h3>
   
   <form class="search" action="/log">
   
@@ -530,7 +539,10 @@
   
   <div class="main">
   <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
-  <h3>log a</h3>
+  <h3>
+   log a @ 1:<a href="/rev/5ed941583260">5ed941583260</a>
+   <span class="tag">a-tag</span> <span class="tag">a-bookmark</span> 
+  </h3>
   
   <form class="search" action="/log">
   
--- a/tests/test-hgweb-symrev.t	Fri Nov 20 11:26:31 2015 -0800
+++ b/tests/test-hgweb-symrev.t	Fri Nov 13 18:31:58 2015 +0800
@@ -166,6 +166,7 @@
   <li><a href="/annotate/xyzzy/foo?style=paper">annotate</a></li>
   <li><a href="/raw-file/xyzzy/foo">raw</a></li>
   <a href="/atom-log/a7c1559b7bba/foo" title="subscribe to atom feed">
+   log foo @ 1:<a href="/rev/a7c1559b7bba?style=paper">a7c1559b7bba</a>
   <a href="/log/xyzzy/foo?revcount=30&style=paper">less</a>
   <a href="/log/xyzzy/foo?revcount=120&style=paper">more</a>
   | <a href="/log/43c799df6e75/foo?style=paper">(0)</a> <a href="/log/tip/foo?style=paper">tip</a> </div>
@@ -353,6 +354,7 @@
   <li><a href="/annotate/xyzzy/foo?style=coal">annotate</a></li>
   <li><a href="/raw-file/xyzzy/foo">raw</a></li>
   <a href="/atom-log/a7c1559b7bba/foo" title="subscribe to atom feed">
+   log foo @ 1:<a href="/rev/a7c1559b7bba?style=coal">a7c1559b7bba</a>
   <a href="/log/xyzzy/foo?revcount=30&style=coal">less</a>
   <a href="/log/xyzzy/foo?revcount=120&style=coal">more</a>
   | <a href="/log/43c799df6e75/foo?style=coal">(0)</a> <a href="/log/tip/foo?style=coal">tip</a> </div>