incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject git commit: [#7128] Fix overlap when paging on Commit Browser and other tweaks from review
Date Wed, 19 Feb 2014 17:37:18 GMT
Repository: incubator-allura
Updated Branches:
  refs/heads/cj/7128 bc3e86e4a -> 1827a630c


[#7128] Fix overlap when paging on Commit Browser and other tweaks from review

Signed-off-by: Cory Johns <cjohns@slashdotmedia.com>


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/1827a630
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/1827a630
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/1827a630

Branch: refs/heads/cj/7128
Commit: 1827a630ce6473b5af76bfb21bf6f1451a590ac1
Parents: bc3e86e
Author: Cory Johns <cjohns@slashdotmedia.com>
Authored: Wed Feb 19 17:28:56 2014 +0000
Committer: Cory Johns <cjohns@slashdotmedia.com>
Committed: Wed Feb 19 17:37:04 2014 +0000

----------------------------------------------------------------------
 .../lib/widgets/resources/js/commit_browser.js  | 24 +++++++++-----------
 ForgeSVN/forgesvn/svn_main.py                   |  9 ++++++--
 2 files changed, 18 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/1827a630/Allura/allura/lib/widgets/resources/js/commit_browser.js
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/resources/js/commit_browser.js b/Allura/allura/lib/widgets/resources/js/commit_browser.js
index f09d656..5cb1c00 100644
--- a/Allura/allura/lib/widgets/resources/js/commit_browser.js
+++ b/Allura/allura/lib/widgets/resources/js/commit_browser.js
@@ -69,7 +69,7 @@ if($('#commit_graph')){
     var offset = 1;
     var selected_commit = -1;
     var y_offset = offset * y_space;
-    var tree, next_column, max_x_pos, max_row = 0, last_row = 0, max_visible_row;
+    var tree, next_column, max_x_pos, max_row = 0, next_row = 0, max_visible_row;
 
     var $graph_holder = $('#graph_holder');
     var $scroll_placeholder = $('#graph_scroll_placeholder');
@@ -101,7 +101,7 @@ if($('#commit_graph')){
     }
 
     function get_data(select_first) {
-        var params = {'limit': 25};
+        var params = {'limit': 100};
         if (data['next_commit']) {
             params['start'] = data['next_commit'];
         }
@@ -110,12 +110,12 @@ if($('#commit_graph')){
             tree = data['built_tree'];
             next_column = data['next_column'];
             max_x_pos = x_space*next_column;
-            max_row += data['max_row']
-            max_visible_row = max_row + (data['next_commit'] ? 1 : 0);
+            max_row = next_row + data['max_row']
+            max_visible_row = max_row + (data['next_commit'] ? 1 : 0);  // accounts for Show
More link
             for (var c in new_data['built_tree']) {
-                tree[c].row += last_row;
+                tree[c].row += next_row;
             }
-            last_row = max_row;
+            next_row = max_row + 1;
             setHeight(max_visible_row);
 
             // Calculate the (x,y) positions of all the commits
@@ -144,10 +144,8 @@ if($('#commit_graph')){
 
     function selectCommit(index) {
       if (index < 0 || index > max_visible_row) return;
-      if (index == max_visible_row) {
-          if (data['next_commit']) {
-              get_data();
-          }
+      if (data['next_commit'] && index == max_visible_row) {
+          get_data();
           return;
       }
       var commit = commit_rows[index];
@@ -233,12 +231,12 @@ if($('#commit_graph')){
             canvas_ctx.fill();
             canvas_ctx.stroke();
             canvas_ctx.fillStyle = "#000";
-            canvas_ctx.fillText(commit.short_id + " " + commit.message, (1+next_column) *
x_space, y_pos);
+            canvas_ctx.fillText(commit.short_id + " " + commit.message, (2+next_column) *
x_space, y_pos);
         }
         if (data['next_commit']) {
-            var y_pos = y_space+((max_visible_row-offset)*y_space);
+            var y_pos = y_space+((next_row-offset)*y_space);
             canvas_ctx.fillStyle = 'rgb(0,0,256)';
-            canvas_ctx.fillText('Show more', (1+next_column) * x_space, y_pos);
+            canvas_ctx.fillText('Show more', (2+next_column) * x_space, y_pos);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/1827a630/ForgeSVN/forgesvn/svn_main.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/svn_main.py b/ForgeSVN/forgesvn/svn_main.py
index 4f848f0..0bce7f6 100644
--- a/ForgeSVN/forgesvn/svn_main.py
+++ b/ForgeSVN/forgesvn/svn_main.py
@@ -191,8 +191,13 @@ class SVNCommitBrowserController(BaseController):
             'built_tree': {},
             'next_commit': None,
         }
-        for i, commit in enumerate(c.app.repo.log(revs=start, id_only=False)):
-            if limit and i >= asint(limit):
+        try:
+            limit = asint(limit)
+        except ValueError as e:
+            pass
+        limit = limit or 100
+        for i, commit in enumerate(c.app.repo.log(revs=start, id_only=False, page_size=limit+1)):
+            if i >= limit:
                 data['next_commit'] = str(commit['id'])
                 break
             data['commits'].append(str(commit['id']))


Mime
View raw message