hgtemplates: synchronize templates from Mercurial 3.7.2 (bug 1228088); r?dminor draft
authorGregory Szorc <gps@mozilla.com>
Tue, 01 Mar 2016 17:35:45 -0800
changeset 7422 aa7cedaa7f2f7dd0767a9c968f730fbf19ecf40d
parent 7421 816a9b50ed50ff807de4ea372ffec1c516961196
child 7423 38ffb4e62408253b339d42c9170504ae9aaa24ee
push id675
push usergszorc@mozilla.com
push dateWed, 02 Mar 2016 22:08:21 +0000
reviewersdminor
bugs1228088
hgtemplates: synchronize templates from Mercurial 3.7.2 (bug 1228088); r?dminor Templates from the Mercurial 3.7.2 release have been applied. This should be a rubber stamp review, since we don't modify any of these files. MozReview-Commit-ID: Kthy0vFLLPp
hgtemplates/gitweb/bookmarks.tmpl
hgtemplates/gitweb/branches.tmpl
hgtemplates/gitweb/graph.tmpl
hgtemplates/gitweb/help.tmpl
hgtemplates/gitweb/helptopics.tmpl
hgtemplates/gitweb/map
hgtemplates/gitweb/tags.tmpl
hgtemplates/paper/filelog.tmpl
hgtemplates/paper/graph.tmpl
hgtemplates/paper/helptopics.tmpl
hgtemplates/paper/map
hgtemplates/static/mercurial.js
--- a/hgtemplates/gitweb/bookmarks.tmpl
+++ b/hgtemplates/gitweb/bookmarks.tmpl
@@ -1,14 +1,14 @@
 {header}
 <title>{repo|escape}: Bookmarks</title>
 <link rel="alternate" type="application/atom+xml"
-   href="{url|urlescape}atom-bookmarks" title="Atom feed for {repo|escape}"/>
+   href="{url|urlescape}atom-bookmarks" title="Atom feed for {repo|escape}: bookmarks"/>
 <link rel="alternate" type="application/rss+xml"
-   href="{url|urlescape}rss-bookmarks" title="RSS feed for {repo|escape}"/>
+   href="{url|urlescape}rss-bookmarks" title="RSS feed for {repo|escape}: bookmarks"/>
 </head>
 <body>
 
 <div class="page_header">
 <a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
 <a href="/">Mercurial</a> {pathdef%breadcrumb} / bookmarks
 </div>
 
--- a/hgtemplates/gitweb/branches.tmpl
+++ b/hgtemplates/gitweb/branches.tmpl
@@ -1,14 +1,14 @@
 {header}
 <title>{repo|escape}: Branches</title>
 <link rel="alternate" type="application/atom+xml"
-   href="{url|urlescape}atom-branches" title="Atom feed for {repo|escape}"/>
+   href="{url|urlescape}atom-branches" title="Atom feed for {repo|escape}: branches"/>
 <link rel="alternate" type="application/rss+xml"
-   href="{url|urlescape}rss-branches" title="RSS feed for {repo|escape}"/>
+   href="{url|urlescape}rss-branches" title="RSS feed for {repo|escape}: branches"/>
 </head>
 <body>
 
 <div class="page_header">
 <a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
 <a href="/">Mercurial</a> {pathdef%breadcrumb} / branches
 </div>
 
--- a/hgtemplates/gitweb/graph.tmpl
+++ b/hgtemplates/gitweb/graph.tmpl
@@ -36,17 +36,17 @@ graph |
 </div>
 
 <div class="title">&nbsp;</div>
 
 <noscript>The revision graph only works with JavaScript-enabled browsers.</noscript>
 
 <div id="wrapper">
 <ul id="nodebgs"></ul>
-<canvas id="graph" width="480" height="{canvasheight}"></canvas>
+<canvas id="graph" width="{canvaswidth}" height="{canvasheight}"></canvas>
 <ul id="graphnodes"></ul>
 </div>
 
 <script>
 <!-- hide script content
 
 var data = {jsdata|json};
 var graph = new Graph();
--- a/hgtemplates/gitweb/help.tmpl
+++ b/hgtemplates/gitweb/help.tmpl
@@ -1,14 +1,14 @@
 {header}
 <title>Help: {topic}</title>
 <link rel="alternate" type="application/atom+xml"
-   href="{url|urlescape}atom-tags" title="Atom feed for {repo|escape}"/>
+   href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}"/>
 <link rel="alternate" type="application/rss+xml"
-   href="{url|urlescape}rss-tags" title="RSS feed for {repo|escape}"/>
+   href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}"/>
 </head>
 <body>
 
 <div class="page_header">
 <a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
 <a href="/">Mercurial</a> {pathdef%breadcrumb} / help
 </div>
 
--- a/hgtemplates/gitweb/helptopics.tmpl
+++ b/hgtemplates/gitweb/helptopics.tmpl
@@ -1,14 +1,14 @@
 {header}
 <title>Help: {title}</title>
 <link rel="alternate" type="application/atom+xml"
-   href="{url|urlescape}atom-tags" title="Atom feed for {repo|escape}"/>
+   href="{url|urlescape}atom-log" title="Atom feed for {repo|escape}"/>
 <link rel="alternate" type="application/rss+xml"
-   href="{url|urlescape}rss-tags" title="RSS feed for {repo|escape}"/>
+   href="{url|urlescape}rss-log" title="RSS feed for {repo|escape}"/>
 </head>
 <body>
 
 <div class="page_header">
 <a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
 <a href="/">Mercurial</a> {pathdef%breadcrumb} / help
 </div>
 
@@ -16,25 +16,33 @@
 <a href="{url|urlescape}summary{sessionvars%urlparameter}">summary</a> |
 <a href="{url|urlescape}shortlog{sessionvars%urlparameter}">shortlog</a> |
 <a href="{url|urlescape}log{sessionvars%urlparameter}">changelog</a> |
 <a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a> |
 <a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a> |
 <a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a> |
 <a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a> |
 <a href="{url|urlescape}file{sessionvars%urlparameter}">files</a> |
-help
+{if(subindex,
+  '<a href="{url|urlescape}help{sessionvars%urlparameter}">help</a>',
+  'help'
+)}
 <br/>
 </div>
 
 <div class="title">&nbsp;</div>
 <table cellspacing="0">
 <tr><td colspan="2"><h2><a name="main" href="#topics">Topics</a></h2></td></tr>
 {topics % helpentry}
 
+{if(earlycommands, '
 <tr><td colspan="2"><h2><a name="main" href="#main">Main Commands</a></h2></td></tr>
 {earlycommands % helpentry}
+')}
 
+{if(othercommands, '
 <tr><td colspan="2"><h2><a name="other" href="#other">Other Commands</a></h2></td></tr>
 {othercommands % helpentry}
+')}
+
 </table>
 
 {footer}
--- a/hgtemplates/gitweb/map
+++ b/hgtemplates/gitweb/map
@@ -9,17 +9,17 @@ error = error.tmpl
 notfound = notfound.tmpl
 
 help = help.tmpl
 helptopics = helptopics.tmpl
 
 helpentry = '
   <tr><td>
     <a href="{url|urlescape}help/{topic|escape}{sessionvars%urlparameter}">
-      {topic|escape}
+      {if(basename, '{basename|escape}', '{topic|escape}')}
     </a>
   </td><td>
     {summary|escape}
   </td></tr>'
 
 naventry = '<a href="{url|urlescape}log/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
 navshortentry = '<a href="{url|urlescape}shortlog/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
 navgraphentry = '<a href="{url|urlescape}graph/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
--- a/hgtemplates/gitweb/tags.tmpl
+++ b/hgtemplates/gitweb/tags.tmpl
@@ -1,14 +1,14 @@
 {header}
 <title>{repo|escape}: Tags</title>
 <link rel="alternate" type="application/atom+xml"
-   href="{url|urlescape}atom-tags" title="Atom feed for {repo|escape}"/>
+   href="{url|urlescape}atom-tags" title="Atom feed for {repo|escape}: tags"/>
 <link rel="alternate" type="application/rss+xml"
-   href="{url|urlescape}rss-tags" title="RSS feed for {repo|escape}"/>
+   href="{url|urlescape}rss-tags" title="RSS feed for {repo|escape}: tags"/>
 </head>
 <body>
 
 <div class="page_header">
 <a href="{logourl}" title="Mercurial" style="float: right;">Mercurial</a>
 <a href="/">Mercurial</a> {pathdef%breadcrumb} / tags
 </div>
 
--- a/hgtemplates/paper/filelog.tmpl
+++ b/hgtemplates/paper/filelog.tmpl
@@ -31,25 +31,28 @@
 <li><a href="{url|urlescape}annotate/{symrev}/{file|urlescape}{sessionvars%urlparameter}">annotate</a></li>
 <li class="active">file log</li>
 <li><a href="{url|urlescape}raw-file/{symrev}/{file|urlescape}">raw</a></li>
 </ul>
 <ul>
 <li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>
 </ul>
 <div class="atom-logo">
-<a href="{url|urlescape}atom-log/{node|short}/{file|urlescape}" title="subscribe to atom feed">
+<a href="{url|urlescape}atom-log/tip/{file|urlescape}" title="subscribe to atom feed">
 <img class="atom-logo" src="{staticurl|urlescape}feed-icon-14x14.png" alt="atom feed" />
 </a>
 </div>
 </div>
 
 <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}
 <p><input name="rev" id="search1" type="text" size="30" /></p>
 <div id="hint">{searchhint}</div>
 </form>
 
 <div class="navigate">
--- a/hgtemplates/paper/graph.tmpl
+++ b/hgtemplates/paper/graph.tmpl
@@ -50,17 +50,17 @@
 <a href="{url|urlescape}graph/{symrev}{morevars%urlparameter}">more</a>
 | rev {rev}: {changenav%navgraph}
 </div>
 
 <noscript><p>The revision graph only works with JavaScript-enabled browsers.</p></noscript>
 
 <div id="wrapper">
 <ul id="nodebgs" class="stripes2"></ul>
-<canvas id="graph" width="480" height="{canvasheight}"></canvas>
+<canvas id="graph" width="{canvaswidth}" height="{canvasheight}"></canvas>
 <ul id="graphnodes"></ul>
 </div>
 
 <script type="text/javascript">
 <!-- hide script content
 
 var data = {jsdata|json};
 var graph = new Graph();
--- a/hgtemplates/paper/helptopics.tmpl
+++ b/hgtemplates/paper/helptopics.tmpl
@@ -12,33 +12,41 @@
 <ul>
 <li><a href="{url|urlescape}shortlog{sessionvars%urlparameter}">log</a></li>
 <li><a href="{url|urlescape}graph{sessionvars%urlparameter}">graph</a></li>
 <li><a href="{url|urlescape}tags{sessionvars%urlparameter}">tags</a></li>
 <li><a href="{url|urlescape}bookmarks{sessionvars%urlparameter}">bookmarks</a></li>
 <li><a href="{url|urlescape}branches{sessionvars%urlparameter}">branches</a></li>
 </ul>
 <ul>
-<li class="active">help</li>
+{if(subindex,
+  '<li><a href="{url|urlescape}help{sessionvars%urlparameter}">help</a></li>',
+  '<li class="active">help</li>'
+)}
 </ul>
 </div>
 
 <div class="main">
 <h2 class="breadcrumb"><a href="/">Mercurial</a> {pathdef%breadcrumb}</h2>
 <form class="search" action="{url|urlescape}log">
 {sessionvars%hiddenformentry}
 <p><input name="rev" id="search1" type="text" size="30" /></p>
 <div id="hint">{searchhint}</div>
 </form>
 <table class="bigtable">
 <tr><td colspan="2"><h2><a name="main" href="#topics">Topics</a></h2></td></tr>
 {topics % helpentry}
 
+{if(earlycommands, '
 <tr><td colspan="2"><h2><a name="main" href="#main">Main Commands</a></h2></td></tr>
 {earlycommands % helpentry}
+')}
 
+{if(othercommands, '
 <tr><td colspan="2"><h2><a name="other" href="#other">Other Commands</a></h2></td></tr>
 {othercommands % helpentry}
+')}
+
 </table>
 </div>
 </div>
 
 {footer}
--- a/hgtemplates/paper/map
+++ b/hgtemplates/paper/map
@@ -10,17 +10,17 @@ shortlog = shortlog.tmpl
 shortlogentry = shortlogentry.tmpl
 graph = graph.tmpl
 help = help.tmpl
 helptopics = helptopics.tmpl
 
 helpentry = '
   <tr><td>
     <a href="{url|urlescape}help/{topic|escape}{sessionvars%urlparameter}">
-      {topic|escape}
+      {if(basename, '{basename|escape}', '{topic|escape}')}
     </a>
   </td><td>
     {summary|escape}
   </td></tr>'
 
 naventry = '<a href="{url|urlescape}log/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
 navshortentry = '<a href="{url|urlescape}shortlog/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
 navgraphentry = '<a href="{url|urlescape}graph/{node|short}{sessionvars%urlparameter}">{label|escape}</a> '
--- a/hgtemplates/static/mercurial.js
+++ b/hgtemplates/static/mercurial.js
@@ -45,28 +45,16 @@ function Graph() {
 	}
 
 	this.scale = function(height) {
 		this.bg_height = height;
 		this.box_size = Math.floor(this.bg_height / 1.2);
 		this.cell_height = this.box_size;
 	}
 
-	function colorPart(num) {
-		num *= 255
-		num = num < 0 ? 0 : num;
-		num = num > 255 ? 255 : num;
-		var digits = Math.round(num).toString(16);
-		if (num < 16) {
-			return '0' + digits;
-		} else {
-			return digits;
-		}
-	}
-
 	this.setColor = function(color, bg, fg) {
 
 		// Set the colour.
 		//
 		// If color is a string, expect an hexadecimal RGB
 		// value and apply it unchanged. If color is a number,
 		// pick a distinct colour based on an internal wheel;
 		// the bg parameter provides the value that should be
@@ -390,18 +378,22 @@ function ajaxScrollInit(urlFormat,
                     var message = {
                         'class': 'scroll-loading',
                         text: 'Loading...'
                     };
                     appendFormatHTML(container, messageFormat, message);
                 },
                 function onsuccess(htmlText) {
                     if (mode == 'graph') {
-                        var addHeight = htmlText.match(/^\s*<canvas id="graph".*height="(\d+)"><\/canvas>$/m)[1];
+                        var sizes = htmlText.match(/^\s*<canvas id="graph" width="(\d+)" height="(\d+)"><\/canvas>$/m);
+                        var addWidth = sizes[1];
+                        var addHeight = sizes[2];
+                        addWidth = parseInt(addWidth);
                         addHeight = parseInt(addHeight);
+                        graph.canvas.width = addWidth;
                         graph.canvas.height = addHeight;
 
                         var dataStr = htmlText.match(/^\s*var data = (.*);$/m)[1];
                         var data = JSON.parse(dataStr);
                         if (data.length < nextPageVar) {
                             nextPageVar = undefined;
                         }
                         graph.reset();