summaryrefslogtreecommitdiffstats
path: root/app/models/repository/subversion.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-06-10 18:56:42 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-06-10 18:56:42 +0000
commit888d2841367a32b924670f94bca024ebf4b28bee (patch)
treebcb6f8f8e2a92d3ecfdd440ca8ad35eca970d564 /app/models/repository/subversion.rb
parentf673027bc17ea74444b99be3e5b74a12d9b8edb7 (diff)
downloadredmine-888d2841367a32b924670f94bca024ebf4b28bee.tar.gz
redmine-888d2841367a32b924670f94bca024ebf4b28bee.zip
Code cleanup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9808 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/repository/subversion.rb')
-rw-r--r--app/models/repository/subversion.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/models/repository/subversion.rb b/app/models/repository/subversion.rb
index 98c5bc108..7c12f3f3e 100644
--- a/app/models/repository/subversion.rb
+++ b/app/models/repository/subversion.rb
@@ -40,7 +40,12 @@ class Repository::Subversion < Repository
def latest_changesets(path, rev, limit=10)
revisions = scm.revisions(path, rev, nil, :limit => limit)
- revisions ? changesets.find_all_by_revision(revisions.collect(&:identifier), :order => "committed_on DESC", :include => :user) : []
+ if revisions
+ identifiers = revisions.collect(&:identifier).compact
+ changesets.where(:revision => identifiers).reorder("committed_on DESC").includes(:repository, :user).all
+ else
+ []
+ end
end
# Returns a path relative to the url of the repository