[PATCH 4 of 5] hgweb: show branch/tags/bookmarks when comparing (style=paper) (issue3559)

Anton Shestakov engored at ya.ru
Mon May 18 07:47:03 CDT 2015


# HG changeset patch
# User Anton Shestakov <engored at ya.ru>
# Date 1431691422 -28800
#      Fri May 15 20:03:42 2015 +0800
# Node ID e1357b5c59937ed069c4ceb8480049866ef635c5
# Parent  f2e41d83600d9cc9b6a076e79c5e8dd5dff8a6dc
hgweb: show branch/tags/bookmarks when comparing (style=paper) (issue3559)

diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py
+++ b/mercurial/hgweb/webcommands.py
@@ -885,6 +885,8 @@ def comparison(web, req, tmpl):
                 branch=webutil.nodebranchnodefault(ctx),
                 parent=webutil.parents(fctx),
                 child=webutil.children(fctx),
+                tags=webutil.nodetagsdict(web.repo, ctx.node()),
+                bookmarks=webutil.nodebookmarksdict(web.repo, ctx.node()),
                 leftrev=leftrev,
                 leftnode=hex(leftnode),
                 rightrev=rightrev,
diff --git a/mercurial/templates/paper/filecomparison.tmpl b/mercurial/templates/paper/filecomparison.tmpl
--- a/mercurial/templates/paper/filecomparison.tmpl
+++ b/mercurial/templates/paper/filecomparison.tmpl
@@ -36,7 +36,7 @@
 
 <div class="main">
 <h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
-<h3>comparison {file|escape} @ {rev}:{node|short}</h3>
+<h3>comparison {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
@@ -628,7 +628,7 @@ comparison new file
   
   <div class="main">
   <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
-  <h3>comparison a @ 0:0cd96de13884</h3>
+  <h3>comparison a @ 0:0cd96de13884 </h3>
   
   <form class="search" action="/log">
   <p></p>
@@ -755,7 +755,7 @@ comparison existing file
   
   <div class="main">
   <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
-  <h3>comparison a @ 2:d73db4d812ff</h3>
+  <h3>comparison a @ 2:d73db4d812ff <span class="tag">tip</span> </h3>
   
   <form class="search" action="/log">
   <p></p>
@@ -884,7 +884,7 @@ comparison removed file
   
   <div class="main">
   <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
-  <h3>comparison a @ 3:20e80271eb7a</h3>
+  <h3>comparison a @ 3:20e80271eb7a <span class="tag">tip</span> </h3>
   
   <form class="search" action="/log">
   <p></p>
@@ -1019,7 +1019,7 @@ comparison not-modified file
   
   <div class="main">
   <h2 class="breadcrumb"><a href="/">Mercurial</a> </h2>
-  <h3>comparison e @ 5:41d9fc4a6ae1</h3>
+  <h3>comparison e @ 5:41d9fc4a6ae1 <span class="tag">tip</span> </h3>
   
   <form class="search" action="/log">
   <p></p>


More information about the Mercurial-devel mailing list