allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kentontay...@apache.org
Subject allura git commit: [#8188] add config options for scm log and commit browse pages
Date Wed, 21 Feb 2018 22:29:21 GMT
Repository: allura
Updated Branches:
  refs/heads/master 8e9eb0e51 -> 7160b3427


[#8188] add config options for scm log and commit browse pages


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

Branch: refs/heads/master
Commit: 7160b34279f4b634a9b3f01c581e1566940c031c
Parents: 8e9eb0e
Author: Dave Brondsema <dave@brondsema.net>
Authored: Wed Feb 21 17:08:15 2018 -0500
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Wed Feb 21 17:08:48 2018 -0500

----------------------------------------------------------------------
 Allura/allura/controllers/repository.py                  | 11 ++++++++---
 Allura/allura/lib/widgets/resources/js/commit_browser.js |  2 +-
 Allura/development.ini                                   |  9 +++++++++
 3 files changed, 18 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/7160b342/Allura/allura/controllers/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/repository.py b/Allura/allura/controllers/repository.py
index f7a5066..8dcfd46 100644
--- a/Allura/allura/controllers/repository.py
+++ b/Allura/allura/controllers/repository.py
@@ -226,8 +226,10 @@ class RepoRootController(BaseController, FeedController):
 
     @without_trailing_slash
     @expose('json:')
-    def commit_browser_data(self, start=None, limit=50, **kw):
+    def commit_browser_data(self, start=None, limit=None, **kw):
         log.debug('Start commit_browser_data')
+        if limit is None:
+            limit = int(tg.config.get('scm.view.commit_browser.limit', 500))
 
         if start:
             head_ids = start.split(',')
@@ -584,6 +586,9 @@ class BranchBrowser(BaseController):
         redirect(ci.url() + 'log/')
 
 
+log_default_limit = int(tg.config.get('scm.view.log.limit', 25))
+
+
 class CommitBrowser(BaseController):
     TreeBrowserClass = None
     revision_widget = SCMRevisionWidget()
@@ -665,8 +670,8 @@ class CommitBrowser(BaseController):
     @expose('jinja:allura:templates/repo/log.html')
     @with_trailing_slash
     @validate(dict(page=validators.Int(if_empty=0, if_invalid=0),
-                   limit=validators.Int(if_empty=25, if_invalid=25)))
-    def log(self, limit=25, path=None, **kw):
+                   limit=validators.Int(if_empty=log_default_limit, if_invalid=log_default_limit)))
+    def log(self, limit=log_default_limit, path=None, **kw):
         is_file = False
         if path:
             is_file = c.app.repo.is_file(path, self._commit._id)

http://git-wip-us.apache.org/repos/asf/allura/blob/7160b342/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 01359ff..5099ae8 100644
--- a/Allura/allura/lib/widgets/resources/js/commit_browser.js
+++ b/Allura/allura/lib/widgets/resources/js/commit_browser.js
@@ -164,7 +164,7 @@ if($('#commit_graph')){
         }
         pending = true;
         drawGraph(offset);
-        var params = {'limit': 500};
+        var params = {};
         if (data['next_commit']) {
             params['start'] = data['next_commit'];
         }

http://git-wip-us.apache.org/repos/asf/allura/blob/7160b342/Allura/development.ini
----------------------------------------------------------------------
diff --git a/Allura/development.ini b/Allura/development.ini
index cd5404e..4a7b9d9 100644
--- a/Allura/development.ini
+++ b/Allura/development.ini
@@ -397,6 +397,15 @@ scm.merge.hg.disabled = false
 ; can be used.
 ;scm.merge_list.git.use_tmp_dir = true
 
+
+; Default limit for number of commits to show in a repo log page
+scm.view.log.limit = 25
+
+; Default limit for number of commits to show in Commit Browser page
+;   If you set this low, you will have more breaks in the graph and more likelihood for incorrect
line visualizations
+;   Details at https://forge-allura.apache.org/p/allura/tickets/5496/#1b4a
+scm.view.commit_browser.limit = 500
+
 ; bulk_export_enabled = true
 ; If you keep bulk_export_enabled, you should set up your server to securely share bulk_export_path
with users somehow
 bulk_export_path = /tmp/bulk_export/{nbhd}/{project}


Mime
View raw message