[PATCH 2 of 2] gitweb: show branches in most of the templates

Florent Guillaume fg at nuxeo.com
Thu Mar 13 17:48:50 CDT 2008


# HG changeset patch
# User Florent Guillaume <fg at nuxeo.com>
# Date 1205448336 -3600
# Node ID 72449c4ee9f527ae88690b95601aaedacdb404bf
# Parent  8cd62bcad647fa2a78e73669fd22556c2a0ff652
gitweb: show branches in most of the templates

diff --git a/templates/gitweb/changelogentry.tmpl b/templates/gitweb/changelogentry.tmpl
--- a/templates/gitweb/changelogentry.tmpl
+++ b/templates/gitweb/changelogentry.tmpl
@@ -1,5 +1,5 @@
 <div>
-<a class="title" href="{url}rev/#node|short#{sessionvars%urlparameter}"><span class="age">#date|age# ago</span>#desc|strip|firstline|escape#<span class="logtags"> {branches%branchtag}{tags%tagtag}</span></a>
+<a class="title" href="{url}rev/#node|short#{sessionvars%urlparameter}"><span class="age">#date|age# ago</span>#desc|strip|firstline|escape#<span class="logtags"> {inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}</span></a>
 </div>
 <div class="title_text">
 <div class="log_link">
diff --git a/templates/gitweb/changeset.tmpl b/templates/gitweb/changeset.tmpl
--- a/templates/gitweb/changeset.tmpl
+++ b/templates/gitweb/changeset.tmpl
@@ -16,12 +16,13 @@
 </div>
 
 <div>
-<a class="title" href="{url}raw-rev/#node|short#">#desc|strip|escape|firstline# <span class="logtags">{branches%branchtag}{tags%tagtag}</span></a>
+<a class="title" href="{url}raw-rev/#node|short#">#desc|strip|escape|firstline# <span class="logtags">{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}</span></a>
 </div>
 <div class="title_text">
 <table cellspacing="0">
 <tr><td>author</td><td>#author|obfuscate#</td></tr>
 <tr><td></td><td>#date|date# (#date|age# ago)</td></tr>
+#branch%changesetbranch#
 <tr><td>changeset {rev}</td><td style="font-family:monospace">{node|short}</td></tr>
 #parent%changesetparent#
 #child%changesetchild#
diff --git a/templates/gitweb/fileannotate.tmpl b/templates/gitweb/fileannotate.tmpl
--- a/templates/gitweb/fileannotate.tmpl
+++ b/templates/gitweb/fileannotate.tmpl
@@ -35,6 +35,7 @@
 <tr>
  <td></td>
  <td>#date|date# (#date|age# ago)</td></tr>
+#branch%filerevbranch#
 <tr>
  <td>changeset {rev}</td>
  <td style="font-family:monospace"><a class="list" href="{url}rev/#node|short#{sessionvars%urlparameter}">#node|short#</a></td></tr>
diff --git a/templates/gitweb/filediff.tmpl b/templates/gitweb/filediff.tmpl
--- a/templates/gitweb/filediff.tmpl
+++ b/templates/gitweb/filediff.tmpl
@@ -28,6 +28,7 @@
 <div class="title">{file|escape}</div>
 
 <table>
+{branch%filerevbranch}
 <tr>
  <td>changeset {rev}</td>
  <td style="font-family:monospace"><a class="list" href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td></tr>
diff --git a/templates/gitweb/filerevision.tmpl b/templates/gitweb/filerevision.tmpl
--- a/templates/gitweb/filerevision.tmpl
+++ b/templates/gitweb/filerevision.tmpl
@@ -35,6 +35,7 @@
 <tr>
  <td></td>
  <td>#date|date# (#date|age# ago)</td></tr>
+#branch%filerevbranch#
 <tr>
  <td>changeset {rev}</td>
  <td style="font-family:monospace"><a class="list" href="{url}rev/#node|short#{sessionvars%urlparameter}">#node|short#</a></td></tr>
diff --git a/templates/gitweb/manifest.tmpl b/templates/gitweb/manifest.tmpl
--- a/templates/gitweb/manifest.tmpl
+++ b/templates/gitweb/manifest.tmpl
@@ -20,7 +20,7 @@
 <a href="{url}rev/#node|short#{sessionvars%urlparameter}">changeset</a> #archives%archiveentry#<br/>
 </div>
 
-<div class="title">#path|escape# <span class="logtags">{branches%branchtag}{tags%tagtag}</span></div>
+<div class="title">#path|escape# <span class="logtags">{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}</span></div>
 <table cellspacing="0">
 <tr class="parity#upparity#">
 <td style="font-family:monospace">drwxr-xr-x</td>
diff --git a/templates/gitweb/map b/templates/gitweb/map
--- a/templates/gitweb/map
+++ b/templates/gitweb/map
@@ -30,7 +30,9 @@
 difflineat = '<span style="color:#990099;"><a class="linenr" href="##lineid#" id="#lineid#">#linenumber#</a> #line|escape#</span>'
 diffline = '<span><a class="linenr" href="##lineid#" id="#lineid#">#linenumber#</a> #line|escape#</span>'
 changelogparent = '<tr><th class="parent">parent #rev#:</th><td class="parent"><a href="#url#rev/#node|short#{sessionvars%urlparameter}">#node|short#</a></td></tr>'
+changesetbranch = '<tr><td>branch</td><td>{name}</td></tr>'
 changesetparent = '<tr><td>parent {rev}</td><td style="font-family:monospace"><a class="list" href="{url}rev/{node|short}{sessionvars%urlparameter}">{node|short}</a></td></tr>'
+filerevbranch = '<tr><td>branch</td><td>{name}</td></tr>'
 filerevparent = '<tr><td>parent {rev}</td><td style="font-family:monospace"><a class="list" href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">{rename%filerename}{node|short}</a></td></tr>'
 filerename = '{file|escape}@'
 filelogrename = '| <a href="{url}file/#node|short#/#file|urlescape#{sessionvars%urlparameter}">base</a>'
@@ -50,7 +52,8 @@
 shortlog = shortlog.tmpl
 tagtag = '<span class="tagtag" title="{name}">{name}</span> '
 branchtag = '<span class="branchtag" title="{name}">{name}</span> '
-shortlogentry = '<tr class="parity#parity#"><td class="age"><i>#date|age# ago</i></td><td><i>#author|person#</i></td><td><a class="list" href="{url}rev/#node|short#{sessionvars%urlparameter}"><b>#desc|strip|firstline|escape#</b> <span class="logtags">{branches%branchtag}{tags%tagtag}</span></a></td><td class="link" nowrap><a href="{url}rev/#node|short#{sessionvars%urlparameter}">changeset</a> | <a href="{url}file/#node|short#{sessionvars%urlparameter}">files</a></td></tr>'
+inbranchtag = '<span class="inbranchtag" title="{name}">{name}</span> '
+shortlogentry = '<tr class="parity#parity#"><td class="age"><i>#date|age# ago</i></td><td><i>#author|person#</i></td><td><a class="list" href="{url}rev/#node|short#{sessionvars%urlparameter}"><b>#desc|strip|firstline|escape#</b> <span class="logtags">{inbranch%inbranchtag}{branches%branchtag}{tags%tagtag}</span></a></td><td class="link" nowrap><a href="{url}rev/#node|short#{sessionvars%urlparameter}">changeset</a> | <a href="{url}file/#node|short#{sessionvars%urlparameter}">files</a></td></tr>'
 filelogentry = '<tr class="parity#parity#"><td class="age"><i>#date|age# ago</i></td><td><a class="list" href="{url}rev/#node|short#{sessionvars%urlparameter}"><b>#desc|strip|firstline|escape#</b></a></td><td class="link"><a href="{url}file/#node|short#/#file|urlescape#{sessionvars%urlparameter}">file</a>&nbsp;|&nbsp;<a href="{url}diff/#node|short#/#file|urlescape#{sessionvars%urlparameter}">diff</a>&nbsp;|&nbsp;<a href="{url}annotate/#node|short#/#file|urlescape#{sessionvars%urlparameter}">annotate</a> #rename%filelogrename#</td></tr>'
 archiveentry = ' | <a href="{url}archive/{node|short}{extension}">#type|escape#</a> '
 indexentry = '<tr class="parity{parity}"><td><a class="list" href="{url}{sessionvars%urlparameter}"><b>{name|escape}</b></a></td><td>{description}</td><td>{contact|obfuscate}</td><td class="age">{lastchange|age} ago</td><td class="indexlinks">{archives%indexarchiveentry}</td><td><div class="rss_logo"><a href="{url}rss-log">RSS</a> <a href="{url}atom-log">Atom</a></div></td></tr>\n'
diff --git a/templates/static/style-gitweb.css b/templates/static/style-gitweb.css
--- a/templates/static/style-gitweb.css
+++ b/templates/static/style-gitweb.css
@@ -75,3 +75,7 @@
 	background-color: #aaffaa;
 	border-color: #ccffcc #00cc33 #00cc33 #ccffcc;
 }
+span.logtags span.inbranchtag {
+	background-color: #d5dde6;
+	border-color: #e3ecf4 #9398f4 #9398f4 #e3ecf4;
+}


More information about the Mercurial-devel mailing list