Patchwork [V3] paper: show current revision on file log page

login
register
mail settings
Submitter Anton Shestakov
Date Nov. 23, 2015, noon
Message ID <0efe233cd7fedb1044a6.1448280055@neuro>
Download mbox | patch
Permalink /patch/11600/
State Accepted
Delegated to: Yuya Nishihara
Headers show

Comments

Anton Shestakov - Nov. 23, 2015, noon
# HG changeset patch
# User Anton Shestakov <av6@dwimlabs.net>
# Date 1447410718 -28800
#      Fri Nov 13 18:31:58 2015 +0800
# Node ID 0efe233cd7fedb1044a64591fbbd1c442e59e24a
# Parent  df9b73d2d444ae82fe8d3fe6cf682a93b2c4a7ef
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.
Yuya Nishihara - Nov. 23, 2015, 2:18 p.m.
On Mon, 23 Nov 2015 20:00:55 +0800, Anton Shestakov wrote:
> # HG changeset patch
> # User Anton Shestakov <av6@dwimlabs.net>
> # Date 1447410718 -28800
> #      Fri Nov 13 18:31:58 2015 +0800
> # Node ID 0efe233cd7fedb1044a64591fbbd1c442e59e24a
> # Parent  df9b73d2d444ae82fe8d3fe6cf682a93b2c4a7ef
> 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.

Pushed to the clowncopter, thanks!

Patch

diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py
+++ b/mercurial/hgweb/webcommands.py
@@ -1045,7 +1045,11 @@  def filelog(web, req, tmpl):
     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)
diff --git a/mercurial/templates/paper/filelog.tmpl b/mercurial/templates/paper/filelog.tmpl
--- a/mercurial/templates/paper/filelog.tmpl
+++ b/mercurial/templates/paper/filelog.tmpl
@@ -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}
diff --git a/tests/test-hgweb-filelog.t b/tests/test-hgweb-filelog.t
--- a/tests/test-hgweb-filelog.t
+++ b/tests/test-hgweb-filelog.t
@@ -187,7 +187,10 @@  tip - two revisions
   
   <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 @@  second version - two revisions
   
   <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 @@  first deleted - one revision
   
   <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 @@  first version - one revision
   
   <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">
   
diff --git a/tests/test-hgweb-symrev.t b/tests/test-hgweb-symrev.t
--- a/tests/test-hgweb-symrev.t
+++ b/tests/test-hgweb-symrev.t
@@ -166,6 +166,7 @@  Set up the repo
   <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 @@  Set up the repo
   <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>