mirror of
https://github.com/redmine/redmine.git
synced 2026-04-14 00:18:07 +02:00
Adds an action to SysController to fetch changesets of one or all projects (#2925).
Exemples: * /sys/fetch_changesets (=> fetches changesets for all active projects) * /sys/fetch_changeseys?id=foo (=> fetches changesets for project foo only) git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3107 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -37,6 +37,23 @@ class SysController < ActionController::Base
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def fetch_changesets
|
||||
projects = []
|
||||
if params[:id]
|
||||
projects << Project.active.has_module(:repository).find(params[:id])
|
||||
else
|
||||
projects = Project.active.has_module(:repository).find(:all, :include => :repository)
|
||||
end
|
||||
projects.each do |project|
|
||||
if project.repository
|
||||
project.repository.fetch_changesets
|
||||
end
|
||||
end
|
||||
render :nothing => true, :status => 200
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
render :nothing => true, :status => 404
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
|
||||
Reference in New Issue
Block a user