@entries = @repository.entries('')
# latest changesets
@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
show_error_command_failed(e.message)
end
if request.xhr?
@entries ? render(:partial => 'dir_list_content') : render(:nothing => true)
else
- show_error unless @entries
+ show_error_not_found unless @entries
end
rescue Redmine::Scm::Adapters::CommandFailed => e
show_error_command_failed(e.message)
def changes
@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)
rescue Redmine::Scm::Adapters::CommandFailed => e
show_error_command_failed(e.message)
def entry
@content = @repository.scm.cat(@path, @rev)
- show_error and return unless @content
+ show_error_not_found and return unless @content
if 'raw' == params[:format]
send_data @content, :filename => @path.split('/').last
else
def annotate
@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
show_error_command_failed(e.message)
end
format.js {render :layout => false}
end
rescue ChangesetNotFound
- show_error
+ show_error_not_found
rescue Redmine::Scm::Adapters::CommandFailed => e
show_error_command_failed(e.message)
end
@cache_key = "repositories/diff/#{@repository.id}/" + Digest::MD5.hexdigest("#{@path}-#{@rev}-#{@rev_to}-#{@diff_type}")
unless read_fragment(@cache_key)
@diff = @repository.diff(@path, @rev, @rev_to, @diff_type)
- show_error and return unless @diff
+ show_error_not_found unless @diff
end
rescue Redmine::Scm::Adapters::CommandFailed => e
show_error_command_failed(e.message)
assert_response :success
assert_template 'entry'
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
get :entry, :id => 1, :path => ['subversion_test', 'helloworld.c'], :format => 'raw'