[PATCH] hgweb: remove unused second argument of nextPageVarGet()
Anton Shestakov
av6 at dwimlabs.net
Mon Jan 15 13:16:03 UTC 2018
# HG changeset patch
# User Anton Shestakov <av6 at dwimlabs.net>
# Date 1516016658 -28800
# Mon Jan 15 19:44:18 2018 +0800
# Node ID edffa2f39c620cb2a8e9c177b96b3aeedf28bae9
# Parent a177c6aa055a86799e9dd9cecc3bbb3531759bcc
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).
diff --git a/mercurial/templates/gitweb/graph.tmpl b/mercurial/templates/gitweb/graph.tmpl
--- a/mercurial/templates/gitweb/graph.tmpl
+++ b/mercurial/templates/gitweb/graph.tmpl
@@ -57,7 +57,7 @@ graph.render(data);
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;
},
diff --git a/mercurial/templates/gitweb/shortlog.tmpl b/mercurial/templates/gitweb/shortlog.tmpl
--- a/mercurial/templates/gitweb/shortlog.tmpl
+++ b/mercurial/templates/gitweb/shortlog.tmpl
@@ -41,7 +41,7 @@ shortlog |
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;
},
diff --git a/mercurial/templates/monoblue/graph.tmpl b/mercurial/templates/monoblue/graph.tmpl
--- a/mercurial/templates/monoblue/graph.tmpl
+++ b/mercurial/templates/monoblue/graph.tmpl
@@ -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;
},
diff --git a/mercurial/templates/monoblue/shortlog.tmpl b/mercurial/templates/monoblue/shortlog.tmpl
--- a/mercurial/templates/monoblue/shortlog.tmpl
+++ b/mercurial/templates/monoblue/shortlog.tmpl
@@ -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;
},
diff --git a/mercurial/templates/paper/graph.tmpl b/mercurial/templates/paper/graph.tmpl
--- a/mercurial/templates/paper/graph.tmpl
+++ b/mercurial/templates/paper/graph.tmpl
@@ -70,7 +70,7 @@ graph.render(data);
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;
},
diff --git a/mercurial/templates/paper/shortlog.tmpl b/mercurial/templates/paper/shortlog.tmpl
--- a/mercurial/templates/paper/shortlog.tmpl
+++ b/mercurial/templates/paper/shortlog.tmpl
@@ -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;
},
diff --git a/mercurial/templates/static/mercurial.js b/mercurial/templates/static/mercurial.js
--- a/mercurial/templates/static/mercurial.js
+++ b/mercurial/templates/static/mercurial.js
@@ -471,9 +471,6 @@ function ajaxScrollInit(urlFormat,
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 @@ function ajaxScrollInit(urlFormat,
adoptChildren(doc.querySelector(containerSelector), container);
}
- nextPageVar = nextPageVarGet(htmlText, nextPageVar);
+ nextPageVar = nextPageVarGet(htmlText);
},
function onerror(errorText) {
var message = {
diff --git a/tests/test-hgweb-commands.t b/tests/test-hgweb-commands.t
--- a/tests/test-hgweb-commands.t
+++ b/tests/test-hgweb-commands.t
@@ -816,7 +816,7 @@ Logs and changes
ajaxScrollInit(
'/shortlog/%next%',
'', <!-- NEXTHASH
- function (htmlText, previousVal) {
+ function (htmlText) {
var m = htmlText.match(/'(\w+)', <!-- NEXTHASH/);
return m ? m[1] : null;
},
@@ -1837,7 +1837,7 @@ Overviews
ajaxScrollInit(
'/graph/%next%?graphtop=cad8025a2e87f88c06259790adfa15acb4080123&style=gitweb',
'', <!-- NEXTHASH
- function (htmlText, previousVal) {
+ function (htmlText) {
var m = htmlText.match(/'(\w+)', <!-- NEXTHASH/);
return m ? m[1] : null;
},
diff --git a/tests/test-hgweb-empty.t b/tests/test-hgweb-empty.t
--- a/tests/test-hgweb-empty.t
+++ b/tests/test-hgweb-empty.t
@@ -96,7 +96,7 @@ Some tests for hgweb in an empty reposit
ajaxScrollInit(
'/shortlog/%next%',
'', <!-- NEXTHASH
- function (htmlText, previousVal) {
+ function (htmlText) {
var m = htmlText.match(/'(\w+)', <!-- NEXTHASH/);
return m ? m[1] : null;
},
@@ -207,7 +207,7 @@ Some tests for hgweb in an empty reposit
ajaxScrollInit(
'/shortlog/%next%',
'', <!-- NEXTHASH
- function (htmlText, previousVal) {
+ function (htmlText) {
var m = htmlText.match(/'(\w+)', <!-- NEXTHASH/);
return m ? m[1] : null;
},
@@ -314,7 +314,7 @@ Some tests for hgweb in an empty reposit
ajaxScrollInit(
'/graph/%next%?graphtop=0000000000000000000000000000000000000000',
'', <!-- NEXTHASH
- function (htmlText, previousVal) {
+ function (htmlText) {
var m = htmlText.match(/'(\w+)', <!-- NEXTHASH/);
return m ? m[1] : null;
},
More information about the Mercurial-devel
mailing list