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

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

Comments

Anton Shestakov - May 18, 2015, 12:47 p.m.
# HG changeset patch
# User Anton Shestakov <engored@ya.ru>
# Date 1431691361 -28800
#      Fri May 15 20:02:41 2015 +0800
# Node ID f2e41d83600d9cc9b6a076e79c5e8dd5dff8a6dc
# Parent  d1f5e3d60dc5b9e53d78d381b7fb35bfa9a8114b
hgweb: show branch/tags/bookmarks when diffing (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
@@ -811,6 +811,8 @@  def filediff(web, req, tmpl):
                 branch=webutil.nodebranchnodefault(ctx),
                 parent=webutil.parents(ctx),
                 child=webutil.children(ctx),
+                tags=webutil.nodetagsdict(web.repo, n),
+                bookmarks=webutil.nodebookmarksdict(web.repo, n),
                 diff=diffs)
 
 diff = webcommand('diff')(filediff)
diff --git a/mercurial/templates/paper/filediff.tmpl b/mercurial/templates/paper/filediff.tmpl
--- a/mercurial/templates/paper/filediff.tmpl
+++ b/mercurial/templates/paper/filediff.tmpl
@@ -36,7 +36,7 @@ 
 
 <div class="main">
 <h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
-<h3>diff {file|escape} @ {rev}:{node|short}</h3>
+<h3>diff {file|escape} @ {rev}:{node|short} {branch%changelogbranchname}{tags%changelogtag}{bookmarks%changelogtag}</h3>
 
 <form class="search" action="{url|urlescape}log">
 <p>{sessionvars%hiddenformentry}</p>
diff --git a/tests/test-hgweb-diffs.t b/tests/test-hgweb-diffs.t
--- a/tests/test-hgweb-diffs.t
+++ b/tests/test-hgweb-diffs.t
@@ -249,7 +249,7 @@  diff removed file
   
   <div class="main">
   <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
-  <h3>diff b @ 1:559edbd9ed20</h3>
+  <h3>diff b @ 1:559edbd9ed20 <span class="tag">tip</span> </h3>
   
   <form class="search" action="/log">
   <p></p>
@@ -525,7 +525,7 @@  diff modified file
   
   <div class="main">
   <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
-  <h3>diff a @ 1:559edbd9ed20</h3>
+  <h3>diff a @ 1:559edbd9ed20 <span class="tag">tip</span> </h3>
   
   <form class="search" action="/log">
   <p></p>
diff --git a/tests/test-hgweb-removed.t b/tests/test-hgweb-removed.t
--- a/tests/test-hgweb-removed.t
+++ b/tests/test-hgweb-removed.t
@@ -185,7 +185,7 @@  diff removed file
   
   <div class="main">
   <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
-  <h3>diff a @ 1:c78f6c5cbea9</h3>
+  <h3>diff a @ 1:c78f6c5cbea9 <span class="tag">tip</span> </h3>
   
   <form class="search" action="/log">
   <p></p>