Fixed RepositoriesController: undefined local variable or method `show_error' (broken by r1094).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1104 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
79f92a675a
commit
4abb82fd7b
|
@ -55,7 +55,7 @@ class RepositoriesController < ApplicationController
|
||||||
@entries = @repository.entries('')
|
@entries = @repository.entries('')
|
||||||
# latest changesets
|
# latest changesets
|
||||||
@changesets = @repository.changesets.find(:all, :limit => 10, :order => "committed_on DESC")
|
@changesets = @repository.changesets.find(:all, :limit => 10, :order => "committed_on DESC")
|
||||||
show_error and return unless @entries || @changesets.any?
|
show_error_not_found unless @entries || @changesets.any?
|
||||||
rescue Redmine::Scm::Adapters::CommandFailed => e
|
rescue Redmine::Scm::Adapters::CommandFailed => e
|
||||||
show_error_command_failed(e.message)
|
show_error_command_failed(e.message)
|
||||||
end
|
end
|
||||||
|
@ -65,7 +65,7 @@ class RepositoriesController < ApplicationController
|
||||||
if request.xhr?
|
if request.xhr?
|
||||||
@entries ? render(:partial => 'dir_list_content') : render(:nothing => true)
|
@entries ? render(:partial => 'dir_list_content') : render(:nothing => true)
|
||||||
else
|
else
|
||||||
show_error unless @entries
|
show_error_not_found unless @entries
|
||||||
end
|
end
|
||||||
rescue Redmine::Scm::Adapters::CommandFailed => e
|
rescue Redmine::Scm::Adapters::CommandFailed => e
|
||||||
show_error_command_failed(e.message)
|
show_error_command_failed(e.message)
|
||||||
|
@ -73,7 +73,7 @@ class RepositoriesController < ApplicationController
|
||||||
|
|
||||||
def changes
|
def changes
|
||||||
@entry = @repository.scm.entry(@path, @rev)
|
@entry = @repository.scm.entry(@path, @rev)
|
||||||
show_error and return unless @entry
|
show_error_not_found and return unless @entry
|
||||||
@changesets = @repository.changesets_for_path(@path)
|
@changesets = @repository.changesets_for_path(@path)
|
||||||
rescue Redmine::Scm::Adapters::CommandFailed => e
|
rescue Redmine::Scm::Adapters::CommandFailed => e
|
||||||
show_error_command_failed(e.message)
|
show_error_command_failed(e.message)
|
||||||
|
@ -96,7 +96,7 @@ class RepositoriesController < ApplicationController
|
||||||
|
|
||||||
def entry
|
def entry
|
||||||
@content = @repository.scm.cat(@path, @rev)
|
@content = @repository.scm.cat(@path, @rev)
|
||||||
show_error and return unless @content
|
show_error_not_found and return unless @content
|
||||||
if 'raw' == params[:format]
|
if 'raw' == params[:format]
|
||||||
send_data @content, :filename => @path.split('/').last
|
send_data @content, :filename => @path.split('/').last
|
||||||
else
|
else
|
||||||
|
@ -109,7 +109,7 @@ class RepositoriesController < ApplicationController
|
||||||
|
|
||||||
def annotate
|
def annotate
|
||||||
@annotate = @repository.scm.annotate(@path, @rev)
|
@annotate = @repository.scm.annotate(@path, @rev)
|
||||||
show_error and return if @annotate.nil? || @annotate.empty?
|
show_error_not_found and return if @annotate.nil? || @annotate.empty?
|
||||||
rescue Redmine::Scm::Adapters::CommandFailed => e
|
rescue Redmine::Scm::Adapters::CommandFailed => e
|
||||||
show_error_command_failed(e.message)
|
show_error_command_failed(e.message)
|
||||||
end
|
end
|
||||||
|
@ -128,7 +128,7 @@ class RepositoriesController < ApplicationController
|
||||||
format.js {render :layout => false}
|
format.js {render :layout => false}
|
||||||
end
|
end
|
||||||
rescue ChangesetNotFound
|
rescue ChangesetNotFound
|
||||||
show_error
|
show_error_not_found
|
||||||
rescue Redmine::Scm::Adapters::CommandFailed => e
|
rescue Redmine::Scm::Adapters::CommandFailed => e
|
||||||
show_error_command_failed(e.message)
|
show_error_command_failed(e.message)
|
||||||
end
|
end
|
||||||
|
@ -147,7 +147,7 @@ class RepositoriesController < ApplicationController
|
||||||
@cache_key = "repositories/diff/#{@repository.id}/" + Digest::MD5.hexdigest("#{@path}-#{@rev}-#{@rev_to}-#{@diff_type}")
|
@cache_key = "repositories/diff/#{@repository.id}/" + Digest::MD5.hexdigest("#{@path}-#{@rev}-#{@rev_to}-#{@diff_type}")
|
||||||
unless read_fragment(@cache_key)
|
unless read_fragment(@cache_key)
|
||||||
@diff = @repository.diff(@path, @rev, @rev_to, @diff_type)
|
@diff = @repository.diff(@path, @rev, @rev_to, @diff_type)
|
||||||
show_error and return unless @diff
|
show_error_not_found unless @diff
|
||||||
end
|
end
|
||||||
rescue Redmine::Scm::Adapters::CommandFailed => e
|
rescue Redmine::Scm::Adapters::CommandFailed => e
|
||||||
show_error_command_failed(e.message)
|
show_error_command_failed(e.message)
|
||||||
|
|
|
@ -67,6 +67,12 @@ class RepositoriesSubversionControllerTest < Test::Unit::TestCase
|
||||||
assert_response :success
|
assert_response :success
|
||||||
assert_template 'entry'
|
assert_template 'entry'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_entry_not_found
|
||||||
|
get :entry, :id => 1, :path => ['subversion_test', 'zzz.c']
|
||||||
|
assert_tag :tag => 'div', :attributes => { :class => /error/ },
|
||||||
|
:content => /Entry and\/or revision doesn't exist/
|
||||||
|
end
|
||||||
|
|
||||||
def test_entry_download
|
def test_entry_download
|
||||||
get :entry, :id => 1, :path => ['subversion_test', 'helloworld.c'], :format => 'raw'
|
get :entry, :id => 1, :path => ['subversion_test', 'helloworld.c'], :format => 'raw'
|
||||||
|
|
Loading…
Reference in New Issue