Faster changesets loading for subversion.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9806 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2012-06-10 18:32:48 +00:00
parent 7c105ec9e9
commit 8a491dbae9
1 changed files with 16 additions and 0 deletions

View File

@ -81,6 +81,22 @@ class Repository::Subversion < Repository
end end
end end
protected
def load_entries_changesets(entries)
entries_with_identifier = entries.select {|entry| entry.lastrev && entry.lastrev.identifier.present?}
identifiers = entries_with_identifier.map {|entry| entry.lastrev.identifier}.compact.uniq
if identifiers.any?
changesets_by_identifier = changesets.where(:revision => identifiers).includes(:user, :repository).all.group_by(&:revision)
entries_with_identifier.each do |entry|
if m = changesets_by_identifier[entry.lastrev.identifier]
entry.changeset = m.first
end
end
end
end
private private
# Returns the relative url of the repository # Returns the relative url of the repository