comparison tests/test-hgweb-commands.t @ 35416:f84b01257e06

hgweb: render next pages on /graph incrementally Previously, when user scrolled down to see the next page on /graph, all hgweb did was re-render everything that would be visible (by simply incrementing revcount). It was not efficient at all, and this patch makes /graph page behave similarly to the regular /log: every new page only consists of new changesets, no duplication, and only jsdata is based on the full set of changesets required to build accurate graph. This is achieved by adding "?graphtop=<node>" to the next page URL template, effectively remembering where the graph started, and using that value to create the new `tree` that covers the whole visible graph. That variable is then used to produce jsdata for redrawing graph client-side. nextentry is used for the same purpose as on /log page (to format the next page URL), but it's not a part of the graph.
author Anton Shestakov <av6@dwimlabs.net>
date Mon, 11 Dec 2017 15:43:56 +0800
parents 27ab3150cd50
children 56854848e485
comparison
equal deleted inserted replaced
35415:a48af4993aa0 35416:f84b01257e06
1836 | <a href="/graph/2ef0ac749a14?style=gitweb">(0)</a> <a href="/graph/tip?style=gitweb">tip</a> 1836 | <a href="/graph/2ef0ac749a14?style=gitweb">(0)</a> <a href="/graph/tip?style=gitweb">tip</a>
1837 </div> 1837 </div>
1838 1838
1839 <script type="text/javascript"> 1839 <script type="text/javascript">
1840 ajaxScrollInit( 1840 ajaxScrollInit(
1841 '/graph/3?revcount=%next%&style=gitweb', 1841 '/graph/%next%?graphtop=cad8025a2e87f88c06259790adfa15acb4080123&style=gitweb',
1842 60+60, 1842 '', <!-- NEXTHASH
1843 function (htmlText, previousVal) { return previousVal + 60; }, 1843 function (htmlText, previousVal) {
1844 var m = htmlText.match(/'(\w+)', <!-- NEXTHASH/);
1845 return m ? m[1] : null;
1846 },
1844 '#wrapper', 1847 '#wrapper',
1845 '<div class="%class%" style="text-align: center;">%text%</div>', 1848 '<div class="%class%" style="text-align: center;">%text%</div>',
1846 'graph' 1849 'graph'
1847 ); 1850 );
1848 </script> 1851 </script>