Patch #6159 » svn_latest_changesets_improvement.diff
| app/models/repository/subversion.rb (working copy) | ||
|---|---|---|
|
end
|
||
|
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) : []
|
||
|
path_to_find = "#{relative_url}/#{path}/%".gsub(%r{//+}, '/')
|
||
|
revisions =
|
||
|
changesets.find(:all, :select => "distinct #{Changeset.table_name}.revision",
|
||
|
:joins => "join #{Change.table_name} on #{Changeset.table_name}.id = #{Change.table_name}.changeset_id",
|
||
|
:order => "#{Changeset.table_name}.revision desc",
|
||
|
:limit => limit,
|
||
|
:conditions => ["#{Change.table_name}.path like ?", path_to_find])
|
||
|
revisions.collect! {|item| item.revision}
|
||
|
changesets.find_all_by_revision(revisions, :order => "committed_on DESC", :include => :user)
|
||
|
end
|
||
|
|
||
|
# Returns a path relative to the url of the repository
|
||