scm: space and tab cleanup of app/controllers/repositories_controller.rb.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4817 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
4957f91639
commit
3493bb1d37
|
@ -67,13 +67,13 @@ class RepositoriesController < ApplicationController
|
||||||
redirect_to :action => 'committers', :id => @project
|
redirect_to :action => 'committers', :id => @project
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
@repository.destroy
|
@repository.destroy
|
||||||
redirect_to :controller => 'projects', :action => 'settings', :id => @project, :tab => 'repository'
|
redirect_to :controller => 'projects', :action => 'settings', :id => @project, :tab => 'repository'
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@repository.fetch_changesets if Setting.autofetch_changesets? && @path.empty?
|
@repository.fetch_changesets if Setting.autofetch_changesets? && @path.empty?
|
||||||
|
|
||||||
@entries = @repository.entries(@path, @rev)
|
@entries = @repository.entries(@path, @rev)
|
||||||
|
@ -88,7 +88,7 @@ class RepositoriesController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
alias_method :browse, :show
|
alias_method :browse, :show
|
||||||
|
|
||||||
def changes
|
def changes
|
||||||
@entry = @repository.entry(@path, @rev)
|
@entry = @repository.entry(@path, @rev)
|
||||||
(show_error_not_found; return) unless @entry
|
(show_error_not_found; return) unless @entry
|
||||||
|
@ -96,23 +96,23 @@ class RepositoriesController < ApplicationController
|
||||||
@properties = @repository.properties(@path, @rev)
|
@properties = @repository.properties(@path, @rev)
|
||||||
@changeset = @repository.find_changeset_by_name(@rev)
|
@changeset = @repository.find_changeset_by_name(@rev)
|
||||||
end
|
end
|
||||||
|
|
||||||
def revisions
|
def revisions
|
||||||
@changeset_count = @repository.changesets.count
|
@changeset_count = @repository.changesets.count
|
||||||
@changeset_pages = Paginator.new self, @changeset_count,
|
@changeset_pages = Paginator.new self, @changeset_count,
|
||||||
per_page_option,
|
per_page_option,
|
||||||
params['page']
|
params['page']
|
||||||
@changesets = @repository.changesets.find(:all,
|
@changesets = @repository.changesets.find(:all,
|
||||||
:limit => @changeset_pages.items_per_page,
|
:limit => @changeset_pages.items_per_page,
|
||||||
:offset => @changeset_pages.current.offset,
|
:offset => @changeset_pages.current.offset,
|
||||||
:include => [:user, :repository])
|
:include => [:user, :repository])
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { render :layout => false if request.xhr? }
|
format.html { render :layout => false if request.xhr? }
|
||||||
format.atom { render_feed(@changesets, :title => "#{@project.name}: #{l(:label_revision_plural)}") }
|
format.atom { render_feed(@changesets, :title => "#{@project.name}: #{l(:label_revision_plural)}") }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def entry
|
def entry
|
||||||
@entry = @repository.entry(@path, @rev)
|
@entry = @repository.entry(@path, @rev)
|
||||||
(show_error_not_found; return) unless @entry
|
(show_error_not_found; return) unless @entry
|
||||||
|
@ -122,7 +122,8 @@ class RepositoriesController < ApplicationController
|
||||||
|
|
||||||
@content = @repository.cat(@path, @rev)
|
@content = @repository.cat(@path, @rev)
|
||||||
(show_error_not_found; return) unless @content
|
(show_error_not_found; return) unless @content
|
||||||
if 'raw' == params[:format] || @content.is_binary_data? || (@entry.size && @entry.size > Setting.file_max_size_displayed.to_i.kilobyte)
|
if 'raw' == params[:format] || @content.is_binary_data? ||
|
||||||
|
(@entry.size && @entry.size > Setting.file_max_size_displayed.to_i.kilobyte)
|
||||||
# Force the download
|
# Force the download
|
||||||
send_data @content, :filename => filename_for_content_disposition(@path.split('/').last)
|
send_data @content, :filename => filename_for_content_disposition(@path.split('/').last)
|
||||||
else
|
else
|
||||||
|
@ -135,7 +136,7 @@ class RepositoriesController < ApplicationController
|
||||||
def annotate
|
def annotate
|
||||||
@entry = @repository.entry(@path, @rev)
|
@entry = @repository.entry(@path, @rev)
|
||||||
(show_error_not_found; return) unless @entry
|
(show_error_not_found; return) unless @entry
|
||||||
|
|
||||||
@annotate = @repository.scm.annotate(@path, @rev)
|
@annotate = @repository.scm.annotate(@path, @rev)
|
||||||
(render_error l(:error_scm_annotate); return) if @annotate.nil? || @annotate.empty?
|
(render_error l(:error_scm_annotate); return) if @annotate.nil? || @annotate.empty?
|
||||||
@changeset = @repository.find_changeset_by_name(@rev)
|
@changeset = @repository.find_changeset_by_name(@rev)
|
||||||
|
@ -153,7 +154,7 @@ class RepositoriesController < ApplicationController
|
||||||
rescue ChangesetNotFound
|
rescue ChangesetNotFound
|
||||||
show_error_not_found
|
show_error_not_found
|
||||||
end
|
end
|
||||||
|
|
||||||
def diff
|
def diff
|
||||||
if params[:format] == 'diff'
|
if params[:format] == 'diff'
|
||||||
@diff = @repository.diff(@path, @rev, @rev_to)
|
@diff = @repository.diff(@path, @rev, @rev_to)
|
||||||
|
@ -185,11 +186,11 @@ class RepositoriesController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def stats
|
def stats
|
||||||
end
|
end
|
||||||
|
|
||||||
def graph
|
def graph
|
||||||
data = nil
|
data = nil
|
||||||
case params[:graph]
|
case params[:graph]
|
||||||
when "commits_per_month"
|
when "commits_per_month"
|
||||||
data = graph_commits_per_month(@repository)
|
data = graph_commits_per_month(@repository)
|
||||||
|
|
Loading…
Reference in New Issue