hgweb: make graph page size equal to shortlog
authorDirkjan Ochtman <dirkjan@ochtman.nl>
Thu, 14 Jan 2010 16:07:34 +0100
changeset 10245 207b94f6b65d
parent 10244 c4c0502be198
child 10246 b9d02695bde4
hgweb: make graph page size equal to shortlog
mercurial/hgweb/webcommands.py
tests/test-hgweb-commands.out
tests/test-hgweb-empty.out
--- a/mercurial/hgweb/webcommands.py	Wed Jan 13 12:00:06 2010 +0100
+++ b/mercurial/hgweb/webcommands.py	Thu Jan 14 16:07:34 2010 +0100
@@ -654,10 +654,10 @@
     return [staticfile(static, fname, req)]
 
 def graph(web, req, tmpl):
+
     rev = webutil.changectx(web.repo, req).rev()
     bg_height = 39
-
-    revcount = 25
+    revcount = web.maxshortchanges
     if 'revcount' in req.form:
         revcount = int(req.form.get('revcount', [revcount])[0])
         tmpl.defaults['sessionvars']['revcount'] = revcount
--- a/tests/test-hgweb-commands.out	Wed Jan 13 12:00:06 2010 +0100
+++ b/tests/test-hgweb-commands.out	Thu Jan 14 16:07:34 2010 +0100
@@ -660,8 +660,8 @@
 <a href="/branches?style=gitweb">branches</a> |
 <a href="/file/1d22e65f027e?style=gitweb">files</a>
 <br/>
-<a href="/graph/2?style=gitweb&revcount=12">less</a>
-<a href="/graph/2?style=gitweb&revcount=50">more</a>
+<a href="/graph/2?style=gitweb&revcount=30">less</a>
+<a href="/graph/2?style=gitweb&revcount=120">more</a>
 | <a href="/graph/2ef0ac749a14?style=gitweb">(0)</a> <a href="/graph/2ef0ac749a14?style=gitweb">-2</a> <a href="/graph/tip?style=gitweb">tip</a> <br/>
 </div>
 
@@ -746,8 +746,8 @@
 </script>
 
 <div class="page_nav">
-<a href="/graph/2?style=gitweb&revcount=12">less</a>
-<a href="/graph/2?style=gitweb&revcount=50">more</a>
+<a href="/graph/2?style=gitweb&revcount=30">less</a>
+<a href="/graph/2?style=gitweb&revcount=120">more</a>
 | <a href="/graph/2ef0ac749a14?style=gitweb">(0)</a> <a href="/graph/2ef0ac749a14?style=gitweb">-2</a> <a href="/graph/tip?style=gitweb">tip</a> 
 </div>
 
--- a/tests/test-hgweb-empty.out	Wed Jan 13 12:00:06 2010 +0100
+++ b/tests/test-hgweb-empty.out	Thu Jan 14 16:07:34 2010 +0100
@@ -184,8 +184,8 @@
 </form>
 
 <div class="navigate">
-<a href="/graph/-1?revcount=12">less</a>
-<a href="/graph/-1?revcount=50">more</a>
+<a href="/graph/-1?revcount=30">less</a>
+<a href="/graph/-1?revcount=120">more</a>
 | rev -1: <a href="/graph/000000000000">(0)</a> <a href="/graph/tip">tip</a> 
 </div>
 
@@ -267,8 +267,8 @@
 </script>
 
 <div class="navigate">
-<a href="/graph/-1?revcount=12">less</a>
-<a href="/graph/-1?revcount=50">more</a>
+<a href="/graph/-1?revcount=30">less</a>
+<a href="/graph/-1?revcount=120">more</a>
 | rev -1: <a href="/graph/000000000000">(0)</a> <a href="/graph/tip">tip</a> 
 </div>