@@ -55,7 +55,7 class RepositoriesController < ApplicationController | |||
|
55 | 55 | @entries = @repository.entries('') |
|
56 | 56 | # latest changesets |
|
57 | 57 | @changesets = @repository.changesets.find(:all, :limit => 10, :order => "committed_on DESC") |
|
58 |
show_error |
|
|
58 | show_error_not_found unless @entries || @changesets.any? | |
|
59 | 59 | rescue Redmine::Scm::Adapters::CommandFailed => e |
|
60 | 60 | show_error_command_failed(e.message) |
|
61 | 61 | end |
@@ -65,7 +65,7 class RepositoriesController < ApplicationController | |||
|
65 | 65 | if request.xhr? |
|
66 | 66 | @entries ? render(:partial => 'dir_list_content') : render(:nothing => true) |
|
67 | 67 | else |
|
68 | show_error unless @entries | |
|
68 | show_error_not_found unless @entries | |
|
69 | 69 | end |
|
70 | 70 | rescue Redmine::Scm::Adapters::CommandFailed => e |
|
71 | 71 | show_error_command_failed(e.message) |
@@ -73,7 +73,7 class RepositoriesController < ApplicationController | |||
|
73 | 73 | |
|
74 | 74 | def changes |
|
75 | 75 | @entry = @repository.scm.entry(@path, @rev) |
|
76 | show_error and return unless @entry | |
|
76 | show_error_not_found and return unless @entry | |
|
77 | 77 | @changesets = @repository.changesets_for_path(@path) |
|
78 | 78 | rescue Redmine::Scm::Adapters::CommandFailed => e |
|
79 | 79 | show_error_command_failed(e.message) |
@@ -96,7 +96,7 class RepositoriesController < ApplicationController | |||
|
96 | 96 | |
|
97 | 97 | def entry |
|
98 | 98 | @content = @repository.scm.cat(@path, @rev) |
|
99 | show_error and return unless @content | |
|
99 | show_error_not_found and return unless @content | |
|
100 | 100 | if 'raw' == params[:format] |
|
101 | 101 | send_data @content, :filename => @path.split('/').last |
|
102 | 102 | else |
@@ -109,7 +109,7 class RepositoriesController < ApplicationController | |||
|
109 | 109 | |
|
110 | 110 | def annotate |
|
111 | 111 | @annotate = @repository.scm.annotate(@path, @rev) |
|
112 | show_error and return if @annotate.nil? || @annotate.empty? | |
|
112 | show_error_not_found and return if @annotate.nil? || @annotate.empty? | |
|
113 | 113 | rescue Redmine::Scm::Adapters::CommandFailed => e |
|
114 | 114 | show_error_command_failed(e.message) |
|
115 | 115 | end |
@@ -128,7 +128,7 class RepositoriesController < ApplicationController | |||
|
128 | 128 | format.js {render :layout => false} |
|
129 | 129 | end |
|
130 | 130 | rescue ChangesetNotFound |
|
131 | show_error | |
|
131 | show_error_not_found | |
|
132 | 132 | rescue Redmine::Scm::Adapters::CommandFailed => e |
|
133 | 133 | show_error_command_failed(e.message) |
|
134 | 134 | end |
@@ -147,7 +147,7 class RepositoriesController < ApplicationController | |||
|
147 | 147 | @cache_key = "repositories/diff/#{@repository.id}/" + Digest::MD5.hexdigest("#{@path}-#{@rev}-#{@rev_to}-#{@diff_type}") |
|
148 | 148 | unless read_fragment(@cache_key) |
|
149 | 149 | @diff = @repository.diff(@path, @rev, @rev_to, @diff_type) |
|
150 |
show_error |
|
|
150 | show_error_not_found unless @diff | |
|
151 | 151 | end |
|
152 | 152 | rescue Redmine::Scm::Adapters::CommandFailed => e |
|
153 | 153 | show_error_command_failed(e.message) |
@@ -67,6 +67,12 class RepositoriesSubversionControllerTest < Test::Unit::TestCase | |||
|
67 | 67 | assert_response :success |
|
68 | 68 | assert_template 'entry' |
|
69 | 69 | end |
|
70 | ||
|
71 | def test_entry_not_found | |
|
72 | get :entry, :id => 1, :path => ['subversion_test', 'zzz.c'] | |
|
73 | assert_tag :tag => 'div', :attributes => { :class => /error/ }, | |
|
74 | :content => /Entry and\/or revision doesn't exist/ | |
|
75 | end | |
|
70 | 76 | |
|
71 | 77 | def test_entry_download |
|
72 | 78 | get :entry, :id => 1, :path => ['subversion_test', 'helloworld.c'], :format => 'raw' |
General Comments 0
You need to be logged in to leave comments.
Login now