[PATCH] hgweb: remove duplicate branch data passed to changeset template

Anton Shestakov engored at ya.ru
Mon May 25 06:46:46 CDT 2015


# HG changeset patch
# User Anton Shestakov <engored at ya.ru>
# Date 1431845004 -28800
#      Sun May 17 14:43:24 2015 +0800
# Node ID 65ffd07ea1421ec83e23b74794c6d123a5623079
# Parent  605b1d32c1c011d56233f28923ee5354fce7e426
hgweb: remove duplicate branch data passed to changeset template

The changesetbranch was added in f1111704061e, but there was no need to do
that, since the data passed to changeset template already includes branch, that
is obtained in the same exact way (nodebranchnodefault(ctx)). I.e.
changesetbranch is completely redundant.

diff --git a/mercurial/hgweb/webutil.py b/mercurial/hgweb/webutil.py
--- a/mercurial/hgweb/webutil.py
+++ b/mercurial/hgweb/webutil.py
@@ -285,7 +285,6 @@ def changesetentry(web, req, tmpl, ctx):
     showtags = showtag(web.repo, tmpl, 'changesettag', ctx.node())
     showbookmarks = showbookmark(web.repo, tmpl, 'changesetbookmark',
                                  ctx.node())
-    showbranch = nodebranchnodefault(ctx)
 
     files = []
     parity = paritygen(web.stripecount)
@@ -319,7 +318,6 @@ def changesetentry(web, req, tmpl, ctx):
         basenode=basectx.hex(),
         changesettag=showtags,
         changesetbookmark=showbookmarks,
-        changesetbranch=showbranch,
         author=ctx.user(),
         desc=ctx.description(),
         extra=ctx.extra(),
diff --git a/mercurial/templates/paper/changeset.tmpl b/mercurial/templates/paper/changeset.tmpl
--- a/mercurial/templates/paper/changeset.tmpl
+++ b/mercurial/templates/paper/changeset.tmpl
@@ -31,7 +31,7 @@
 <div class="main">
 
 <h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
-<h3>changeset {rev}:{node|short} {changesetbranch%changelogbranchname} {changesettag} {changesetbookmark}</h3>
+<h3>changeset {rev}:{node|short} {branch%changelogbranchname} {changesettag} {changesetbookmark}</h3>
 
 <form class="search" action="{url|urlescape}log">
 {sessionvars%hiddenformentry}


More information about the Mercurial-devel mailing list