Fixed: performance issue on RepositoriesController#revisions when a changeset has a great number of changes (eg. 100,000).

Also added pagination for changes on changeset details view.

git-svn-id: http://redmine.rubyforge.org/svn/trunk@535 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2007-05-15 21:32:36 +00:00
parent 777c9acae8
commit bb1fccb7b7
5 changed files with 47 additions and 10 deletions
+8 -1
View File
@@ -49,7 +49,7 @@ class RepositoriesController < ApplicationController
show_error and return unless @entry
end
@repository.changesets_with_path @path do
@changeset_count = @repository.changesets.count
@changeset_count = @repository.changesets.count(:select => "DISTINCT #{Changeset.table_name}.id")
@changeset_pages = Paginator.new self, @changeset_count,
25,
params['page']
@@ -71,6 +71,13 @@ class RepositoriesController < ApplicationController
def revision
@changeset = @repository.changesets.find_by_revision(@rev)
show_error and return unless @changeset
@changes_count = @changeset.changes.size
@changes_pages = Paginator.new self, @changes_count, 150, params['page']
@changes = @changeset.changes.find(:all,
:limit => @changes_pages.items_per_page,
:offset => @changes_pages.current.offset)
render :action => "revision", :layout => false if request.xhr?
end
def diff