hgtemplates: synchronize templates with Mercurial 4.1.2 (bug 1333616); r?glob draft
authorGregory Szorc <gps@mozilla.com>
Mon, 03 Apr 2017 16:13:05 -0700
changeset 10651 7d6a4df4a64373d0b648ee151c7b63c6edeeb719
parent 10650 0cac98b0de4d0dffaf8415f660ba0aae57a349b6
child 10652 fc3237220096ac25b45372dc4fcd163de4caaed4
push id1601
push userbmo:gps@mozilla.com
push dateMon, 03 Apr 2017 23:52:01 +0000
reviewersglob
bugs1333616
hgtemplates: synchronize templates with Mercurial 4.1.2 (bug 1333616); r?glob We synchronize Mercurial's built-in templates with 4.1.2. A subsequent commit will apply gitweb changes to the gitweb_mozilla style. MozReview-Commit-ID: HWXsDGWb9II
hgtemplates/gitweb/footer.tmpl
hgtemplates/gitweb/graph.tmpl
hgtemplates/gitweb/index.tmpl
hgtemplates/gitweb/shortlog.tmpl
hgtemplates/map-cmdline.default
hgtemplates/paper/footer.tmpl
hgtemplates/paper/graph.tmpl
hgtemplates/paper/shortlog.tmpl
hgtemplates/rss/filelogentry.tmpl
hgtemplates/static/mercurial.js
--- a/hgtemplates/gitweb/footer.tmpl
+++ b/hgtemplates/gitweb/footer.tmpl
@@ -1,9 +1,8 @@
-<script type="text/javascript">process_dates()</script>
 <div class="page_footer">
 <div class="page_footer_text">{repo|escape}</div>
 <div class="rss_logo">
 <a href="{url|urlescape}rss-log">RSS</a>
 <a href="{url|urlescape}atom-log">Atom</a>
 </div>
 <br />
 {motd}
--- a/hgtemplates/gitweb/graph.tmpl
+++ b/hgtemplates/gitweb/graph.tmpl
@@ -40,17 +40,17 @@ graph |
 <noscript>The revision graph only works with JavaScript-enabled browsers.</noscript>
 
 <div id="wrapper">
 <ul id="nodebgs"></ul>
 <canvas id="graph" width="{canvaswidth}" height="{canvasheight}"></canvas>
 <ul id="graphnodes"></ul>
 </div>
 
-<script>
+<script{if(nonce, ' nonce="{nonce}"')}>
 <!-- hide script content
 
 var data = {jsdata|json};
 var graph = new Graph();
 graph.scale({bg_height});
 
 graph.vertex = function(x, y, color, parity, cur) \{
 	
@@ -103,17 +103,17 @@ graph.render(data);
 </script>
 
 <div class="page_nav">
 <a href="{url|urlescape}graph/{symrev}{lessvars%urlparameter}">less</a>
 <a href="{url|urlescape}graph/{symrev}{morevars%urlparameter}">more</a>
 | {changenav%navgraph}
 </div>
 
-<script type="text/javascript">
+<script type="text/javascript"{if(nonce, ' nonce="{nonce}"')}>
     ajaxScrollInit(
             '{url|urlescape}graph/{rev}?revcount=%next%&style={style}',
             {revcount}+60,
             function (htmlText, previousVal) \{ return previousVal + 60; },
             '#wrapper',
             '<div class="%class%" style="text-align: center;">%text%</div>',
             'graph'
     );
--- a/hgtemplates/gitweb/index.tmpl
+++ b/hgtemplates/gitweb/index.tmpl
@@ -17,11 +17,10 @@
         <td>&nbsp;</td>
         <td>&nbsp;</td>
     </tr>
     {entries%indexentry}
 </table>
 <div class="page_footer">
 {motd}
 </div>
-<script type="text/javascript">process_dates()</script>
 </body>
 </html>
--- a/hgtemplates/gitweb/shortlog.tmpl
+++ b/hgtemplates/gitweb/shortlog.tmpl
@@ -35,17 +35,17 @@ shortlog |
 <table class="shortlogtable" cellspacing="0">
 {entries%shortlogentry}
 </table>
 
 <div class="page_nav">
 {changenav%navshort}
 </div>
 
-<script type="text/javascript">
+<script type="text/javascript"{if(nonce, ' nonce="{nonce}"')}>
     ajaxScrollInit(
             '{url|urlescape}shortlog/%next%{sessionvars%urlparameter}',
             '{nextentry%"{node}"}', <!-- NEXTHASH
             function (htmlText, previousVal) \{
                 var m = htmlText.match(/'(\w+)', <!-- NEXTHASH/);
                 return m ? m[1] : null;
             },
             '.shortlogtable > tbody:nth-of-type(1)',
--- a/hgtemplates/map-cmdline.default
+++ b/hgtemplates/map-cmdline.default
@@ -1,14 +1,14 @@
 # Base templates. Due to name clashes with existing keywords, we have
 # to replace some keywords with 'lkeyword', for 'labelled keyword'
-changeset = '{cset}{branches}{bookmarks}{tags}{parents}{user}{ldate}{summary}\n'
+changeset = '{cset}{branches}{bookmarks}{tags}{parents}{user}{ldate}{ltroubles}{summary}\n'
 changeset_quiet = '{lnode}'
-changeset_verbose = '{cset}{branches}{bookmarks}{tags}{parents}{user}{ldate}{lfiles}{lfile_copies_switch}{description}\n'
-changeset_debug = '{fullcset}{branches}{bookmarks}{tags}{lphase}{parents}{manifest}{user}{ldate}{lfile_mods}{lfile_adds}{lfile_dels}{lfile_copies_switch}{extras}{description}\n'
+changeset_verbose = '{cset}{branches}{bookmarks}{tags}{parents}{user}{ldate}{ltroubles}{lfiles}{lfile_copies_switch}{description}\n'
+changeset_debug = '{fullcset}{branches}{bookmarks}{tags}{lphase}{parents}{manifest}{user}{ldate}{ltroubles}{lfile_mods}{lfile_adds}{lfile_dels}{lfile_copies_switch}{extras}{description}\n'
 
 # File templates
 lfiles = '{if(files,
                label("ui.note log.files",
                      "files:       {files}\n"))}'
 
 lfile_mods = '{if(file_mods,
                   label("ui.debug log.files",
@@ -23,23 +23,25 @@ lfile_dels = '{if(file_dels,
                         "files-:      {file_dels}\n"))}'
 
 lfile_copies_switch = '{if(file_copies_switch,
                            label("ui.note log.copies",
                                  "copies:     {file_copies_switch
                                                % ' {name} ({source})'}\n"))}'
 
 # General templates
-cset = '{label("log.changeset changeset.{phase}",
+_trouble_label = 'trouble.{trouble}'
+_cset_labels = 'log.changeset changeset.{phase}{if(troubles, " changeset.troubled {troubles%_trouble_label}")}'
+cset = '{label("{_cset_labels}",
                "changeset:   {rev}:{node|short}")}\n'
 
 lphase = '{label("log.phase",
                  "phase:       {phase}")}\n'
 
-fullcset = '{label("log.changeset changeset.{phase}",
+fullcset = '{label("{_cset_labels}",
                    "changeset:   {rev}:{node}")}\n'
 
 parent = '{label("log.parent changeset.{phase}",
                   "parent:      {rev}:{node|formatnode}")}\n'
 
 lnode = '{label("log.node",
                 "{rev}:{node|short}")}\n'
 
@@ -59,16 +61,19 @@ user = '{label("log.user",
                "user:        {author}")}\n'
 
 summary = '{if(desc|strip, "{label('log.summary',
                                    'summary:     {desc|firstline}')}\n")}'
 
 ldate = '{label("log.date",
                 "date:        {date|date}")}\n'
 
+ltroubles = '{if(troubles, "{label('log.trouble',
+                                   'trouble:     {join(troubles, ", ")}')}\n")}'
+
 extra = '{label("ui.debug log.extra",
                 "extra:       {key}={value|stringescape}")}\n'
 
 description = '{if(desc|strip, "{label('ui.note log.description',
                                        'description:')}
                                 {label('ui.note log.description',
                                        '{desc|strip}')}\n\n")}'
 
--- a/hgtemplates/paper/footer.tmpl
+++ b/hgtemplates/paper/footer.tmpl
@@ -1,5 +1,4 @@
-<script type="text/javascript">process_dates()</script>
 {motd}
 
 </body>
 </html>
--- a/hgtemplates/paper/graph.tmpl
+++ b/hgtemplates/paper/graph.tmpl
@@ -54,17 +54,17 @@
 <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="{canvaswidth}" height="{canvasheight}"></canvas>
 <ul id="graphnodes"></ul>
 </div>
 
-<script type="text/javascript">
+<script type="text/javascript"{if(nonce, ' nonce="{nonce}"')}>
 <!-- hide script content
 
 var data = {jsdata|json};
 var graph = new Graph();
 graph.scale({bg_height});
 
 graph.vertex = function(x, y, color, parity, cur) \{
 	
@@ -116,17 +116,17 @@ graph.render(data);
 </script>
 
 <div class="navigate">
 <a href="{url|urlescape}graph/{symrev}{lessvars%urlparameter}">less</a>
 <a href="{url|urlescape}graph/{symrev}{morevars%urlparameter}">more</a>
 | rev {rev}: {changenav%navgraph}
 </div>
 
-<script type="text/javascript">
+<script type="text/javascript"{if(nonce, ' nonce="{nonce}"')}>
     ajaxScrollInit(
             '{url|urlescape}graph/{rev}?revcount=%next%&style={style}',
             {revcount}+60,
             function (htmlText, previousVal) \{ return previousVal + 60; },
             '#wrapper',
             '<div class="%class%" style="text-align: center;">%text%</div>',
             'graph'
     );
--- a/hgtemplates/paper/shortlog.tmpl
+++ b/hgtemplates/paper/shortlog.tmpl
@@ -67,17 +67,17 @@
 </table>
 
 <div class="navigate">
 <a href="{url|urlescape}shortlog/{symrev}{lessvars%urlparameter}">less</a>
 <a href="{url|urlescape}shortlog/{symrev}{morevars%urlparameter}">more</a>
 | rev {rev}: {changenav%navshort}
 </div>
 
-<script type="text/javascript">
+<script type="text/javascript"{if(nonce, ' nonce="{nonce}"')}>
     ajaxScrollInit(
             '{url|urlescape}shortlog/%next%{sessionvars%urlparameter}',
             '{nextentry%"{node}"}', <!-- NEXTHASH
             function (htmlText, previousVal) \{
                 var m = htmlText.match(/'(\w+)', <!-- NEXTHASH/);
                 return m ? m[1] : null;
             },
             '.bigtable > tbody',
--- a/hgtemplates/rss/filelogentry.tmpl
+++ b/hgtemplates/rss/filelogentry.tmpl
@@ -1,7 +1,7 @@
 <item>
     <title>{desc|strip|firstline|strip|escape}</title>
-    <link>{urlbase}{url|urlescape}log{node|short}/{file|urlescape}</link>
+    <link>{urlbase}{url|urlescape}log/{node|short}/{file|urlescape}</link>
     <description><![CDATA[{desc|strip|escape|websub|addbreaks|nonempty}]]></description>
     <author>{author|obfuscate}</author>
     <pubDate>{date|rfc822date}</pubDate>
 </item>
--- a/hgtemplates/static/mercurial.js
+++ b/hgtemplates/static/mercurial.js
@@ -428,8 +428,12 @@ function ajaxScrollInit(urlFormat,
             );
         }
     }
 
     window.addEventListener('scroll', scrollHandler);
     window.addEventListener('resize', scrollHandler);
     scrollHandler();
 }
+
+document.addEventListener('DOMContentLoaded', function() {
+   process_dates();
+}, false);