hgweb: remove unused second argument of nextPageVarGet()
authorAnton Shestakov <av6@dwimlabs.net>
Mon, 15 Jan 2018 19:44:18 +0800
changeset 35654 59c842a3d1e1
parent 35653 48fe4f56a3b4
child 35655 2f54a3e228ff
hgweb: remove unused second argument of nextPageVarGet() nextPageVarGet is a function that's used in ajaxScrollInit() to produce URL of the next page. Before f84b01257e06, its second argument previousVal was a number on /graph pages, and the code was simply adding 60 to it and returning the resulting value. Now previousVal can only be a string containing changeset hash, which can't be used the same way (and in fact isn't used in any way).
mercurial/templates/gitweb/graph.tmpl
mercurial/templates/gitweb/shortlog.tmpl
mercurial/templates/monoblue/graph.tmpl
mercurial/templates/monoblue/shortlog.tmpl
mercurial/templates/paper/graph.tmpl
mercurial/templates/paper/shortlog.tmpl
mercurial/templates/static/mercurial.js
tests/test-hgweb-commands.t
tests/test-hgweb-empty.t
--- a/mercurial/templates/gitweb/graph.tmpl	Sun Jan 14 20:06:56 2018 -0800
+++ b/mercurial/templates/gitweb/graph.tmpl	Mon Jan 15 19:44:18 2018 +0800
@@ -57,7 +57,7 @@
     ajaxScrollInit(
             '{url|urlescape}graph/%next%{graphvars%urlparameter}',
             '{nextentry%"{node}"}', <!-- NEXTHASH
-            function (htmlText, previousVal) \{
+            function (htmlText) \{
                 var m = htmlText.match(/'(\w+)', <!-- NEXTHASH/);
                 return m ? m[1] : null;
             },
--- a/mercurial/templates/gitweb/shortlog.tmpl	Sun Jan 14 20:06:56 2018 -0800
+++ b/mercurial/templates/gitweb/shortlog.tmpl	Mon Jan 15 19:44:18 2018 +0800
@@ -41,7 +41,7 @@
     ajaxScrollInit(
             '{url|urlescape}shortlog/%next%{sessionvars%urlparameter}',
             '{nextentry%"{node}"}', <!-- NEXTHASH
-            function (htmlText, previousVal) \{
+            function (htmlText) \{
                 var m = htmlText.match(/'(\w+)', <!-- NEXTHASH/);
                 return m ? m[1] : null;
             },
--- a/mercurial/templates/monoblue/graph.tmpl	Sun Jan 14 20:06:56 2018 -0800
+++ b/mercurial/templates/monoblue/graph.tmpl	Mon Jan 15 19:44:18 2018 +0800
@@ -51,7 +51,7 @@
     ajaxScrollInit(
             '{url|urlescape}graph/%next%{graphvars%urlparameter}',
             '{nextentry%"{node}"}', <!-- NEXTHASH
-            function (htmlText, previousVal) \{
+            function (htmlText) \{
                 var m = htmlText.match(/'(\w+)', <!-- NEXTHASH/);
                 return m ? m[1] : null;
             },
--- a/mercurial/templates/monoblue/shortlog.tmpl	Sun Jan 14 20:06:56 2018 -0800
+++ b/mercurial/templates/monoblue/shortlog.tmpl	Mon Jan 15 19:44:18 2018 +0800
@@ -39,7 +39,7 @@
     ajaxScrollInit(
             '{url|urlescape}shortlog/%next%{sessionvars%urlparameter}',
             '{nextentry%"{node}"}', <!-- NEXTHASH
-            function (htmlText, previousVal) \{
+            function (htmlText) \{
                 var m = htmlText.match(/'(\w+)', <!-- NEXTHASH/);
                 return m ? m[1] : null;
             },
--- a/mercurial/templates/paper/graph.tmpl	Sun Jan 14 20:06:56 2018 -0800
+++ b/mercurial/templates/paper/graph.tmpl	Mon Jan 15 19:44:18 2018 +0800
@@ -70,7 +70,7 @@
     ajaxScrollInit(
             '{url|urlescape}graph/%next%{graphvars%urlparameter}',
             '{nextentry%"{node}"}', <!-- NEXTHASH
-            function (htmlText, previousVal) \{
+            function (htmlText) \{
                 var m = htmlText.match(/'(\w+)', <!-- NEXTHASH/);
                 return m ? m[1] : null;
             },
--- a/mercurial/templates/paper/shortlog.tmpl	Sun Jan 14 20:06:56 2018 -0800
+++ b/mercurial/templates/paper/shortlog.tmpl	Mon Jan 15 19:44:18 2018 +0800
@@ -72,7 +72,7 @@
     ajaxScrollInit(
             '{url|urlescape}shortlog/%next%{sessionvars%urlparameter}',
             '{nextentry%"{node}"}', <!-- NEXTHASH
-            function (htmlText, previousVal) \{
+            function (htmlText) \{
                 var m = htmlText.match(/'(\w+)', <!-- NEXTHASH/);
                 return m ? m[1] : null;
             },
--- a/mercurial/templates/static/mercurial.js	Sun Jan 14 20:06:56 2018 -0800
+++ b/mercurial/templates/static/mercurial.js	Mon Jan 15 19:44:18 2018 +0800
@@ -471,9 +471,6 @@
                         var graph = window.graph;
                         var dataStr = htmlText.match(/^\s*var data = (.*);$/m)[1];
                         var data = JSON.parse(dataStr);
-                        if (data.length < nextPageVar) {
-                            nextPageVar = undefined;
-                        }
                         graph.reset();
                         adoptChildren(doc.querySelector('#graphnodes'), container.querySelector('#graphnodes'));
                         graph.render(data);
@@ -481,7 +478,7 @@
                         adoptChildren(doc.querySelector(containerSelector), container);
                     }
 
-                    nextPageVar = nextPageVarGet(htmlText, nextPageVar);
+                    nextPageVar = nextPageVarGet(htmlText);
                 },
                 function onerror(errorText) {
                     var message = {
--- a/tests/test-hgweb-commands.t	Sun Jan 14 20:06:56 2018 -0800
+++ b/tests/test-hgweb-commands.t	Mon Jan 15 19:44:18 2018 +0800
@@ -816,7 +816,7 @@
       ajaxScrollInit(
               '/shortlog/%next%',
               '', <!-- NEXTHASH
-              function (htmlText, previousVal) {
+              function (htmlText) {
                   var m = htmlText.match(/'(\w+)', <!-- NEXTHASH/);
                   return m ? m[1] : null;
               },
@@ -1837,7 +1837,7 @@
       ajaxScrollInit(
               '/graph/%next%?graphtop=cad8025a2e87f88c06259790adfa15acb4080123&style=gitweb',
               '', <!-- NEXTHASH
-              function (htmlText, previousVal) {
+              function (htmlText) {
                   var m = htmlText.match(/'(\w+)', <!-- NEXTHASH/);
                   return m ? m[1] : null;
               },
--- a/tests/test-hgweb-empty.t	Sun Jan 14 20:06:56 2018 -0800
+++ b/tests/test-hgweb-empty.t	Mon Jan 15 19:44:18 2018 +0800
@@ -96,7 +96,7 @@
       ajaxScrollInit(
               '/shortlog/%next%',
               '', <!-- NEXTHASH
-              function (htmlText, previousVal) {
+              function (htmlText) {
                   var m = htmlText.match(/'(\w+)', <!-- NEXTHASH/);
                   return m ? m[1] : null;
               },
@@ -207,7 +207,7 @@
       ajaxScrollInit(
               '/shortlog/%next%',
               '', <!-- NEXTHASH
-              function (htmlText, previousVal) {
+              function (htmlText) {
                   var m = htmlText.match(/'(\w+)', <!-- NEXTHASH/);
                   return m ? m[1] : null;
               },
@@ -314,7 +314,7 @@
       ajaxScrollInit(
               '/graph/%next%?graphtop=0000000000000000000000000000000000000000',
               '', <!-- NEXTHASH
-              function (htmlText, previousVal) {
+              function (htmlText) {
                   var m = htmlText.match(/'(\w+)', <!-- NEXTHASH/);
                   return m ? m[1] : null;
               },