@@ -72,9 +72,7 class RepositoriesController < ApplicationController | |||||
72 | @entries ? render(:partial => 'dir_list_content') : render(:nothing => true) |
|
72 | @entries ? render(:partial => 'dir_list_content') : render(:nothing => true) | |
73 | else |
|
73 | else | |
74 | show_error_not_found and return unless @entries |
|
74 | show_error_not_found and return unless @entries | |
75 | if @path.blank? |
|
75 | @changesets = @repository.latest_changesets(@path, @rev) | |
76 | @changesets = @repository.latest_changesets(@path, @rev) |
|
|||
77 | end |
|
|||
78 | @properties = @repository.properties(@path, @rev) |
|
76 | @properties = @repository.properties(@path, @rev) | |
79 | render :action => 'show' |
|
77 | render :action => 'show' | |
80 | end |
|
78 | end |
@@ -1,3 +1,5 | |||||
|
1 | <% if @entry && @entry.kind == 'file' %> | |||
|
2 | ||||
1 | <p> |
|
3 | <p> | |
2 | <%= link_to_if action_name != 'changes', l(:label_history), {:action => 'changes', :id => @project, :path => to_path_param(@path), :rev => @rev } %> | |
|
4 | <%= link_to_if action_name != 'changes', l(:label_history), {:action => 'changes', :id => @project, :path => to_path_param(@path), :rev => @rev } %> | | |
3 | <% if @repository.supports_cat? %> |
|
5 | <% if @repository.supports_cat? %> | |
@@ -9,3 +11,5 | |||||
9 | <%= link_to(l(:button_download), {:action => 'entry', :id => @project, :path => to_path_param(@path), :rev => @rev, :format => 'raw' }) if @repository.supports_cat? %> |
|
11 | <%= link_to(l(:button_download), {:action => 'entry', :id => @project, :path => to_path_param(@path), :rev => @rev, :format => 'raw' }) if @repository.supports_cat? %> | |
10 | <%= "(#{number_to_human_size(@entry.size)})" if @entry.size %> |
|
12 | <%= "(#{number_to_human_size(@entry.size)})" if @entry.size %> | |
11 | </p> |
|
13 | </p> | |
|
14 | ||||
|
15 | <% end %> |
@@ -9,7 +9,7 | |||||
9 | <th><%= l(:field_comments) %></th> |
|
9 | <th><%= l(:field_comments) %></th> | |
10 | </tr></thead> |
|
10 | </tr></thead> | |
11 | <tbody> |
|
11 | <tbody> | |
12 |
<% show_diff = |
|
12 | <% show_diff = revisions.size > 1 %> | |
13 | <% line_num = 1 %> |
|
13 | <% line_num = 1 %> | |
14 | <% revisions.each do |changeset| %> |
|
14 | <% revisions.each do |changeset| %> | |
15 | <tr class="changeset <%= cycle 'odd', 'even' %>"> |
|
15 | <tr class="changeset <%= cycle 'odd', 'even' %>"> |
@@ -1,4 +1,4 | |||||
1 |
<h2><%= l(:label_revision) %> <%= format_revision(@rev) %> <%= @path |
|
1 | <h2><%= l(:label_revision) %> <%= format_revision(@rev_to) + ':' if @rev_to %><%= format_revision(@rev) %> <%=h @path %></h2> | |
2 |
|
2 | |||
3 | <!-- Choose view type --> |
|
3 | <!-- Choose view type --> | |
4 | <% form_tag({}, :method => 'get') do %> |
|
4 | <% form_tag({}, :method => 'get') do %> |
@@ -14,8 +14,14 | |||||
14 |
|
14 | |||
15 | <% if @changesets && !@changesets.empty? && authorize_for('repositories', 'revisions') %> |
|
15 | <% if @changesets && !@changesets.empty? && authorize_for('repositories', 'revisions') %> | |
16 | <h3><%= l(:label_latest_revision_plural) %></h3> |
|
16 | <h3><%= l(:label_latest_revision_plural) %></h3> | |
17 |
<%= render :partial => 'revisions', :locals => {:project => @project, :path => |
|
17 | <%= render :partial => 'revisions', :locals => {:project => @project, :path => @path, :revisions => @changesets, :entry => nil }%> | |
18 | <p><%= link_to l(:label_view_all_revisions), :action => 'revisions', :id => @project %></p> |
|
18 | ||
|
19 | <% if @path.blank? %> | |||
|
20 | <p><%= link_to l(:label_view_all_revisions), :action => 'revisions', :id => @project %></p> | |||
|
21 | <% else %> | |||
|
22 | <p><%= link_to l(:label_view_revisions), :action => 'changes', :path => to_path_param(@path), :id => @project %></p> | |||
|
23 | <% end %> | |||
|
24 | ||||
19 | <% content_for :header_tags do %> |
|
25 | <% content_for :header_tags do %> | |
20 | <%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :action => 'revisions', :id => @project, :page => nil, :key => User.current.rss_key})) %> |
|
26 | <%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :action => 'revisions', :id => @project, :page => nil, :key => User.current.rss_key})) %> | |
21 | <% end %> |
|
27 | <% end %> |
@@ -833,7 +833,7 fr: | |||||
833 | enumeration_activities: ActivitΓ©s (suivi du temps) |
|
833 | enumeration_activities: ActivitΓ©s (suivi du temps) | |
834 | label_greater_or_equal: ">=" |
|
834 | label_greater_or_equal: ">=" | |
835 | label_less_or_equal: "<=" |
|
835 | label_less_or_equal: "<=" | |
836 |
label_view_all_revisions: V |
|
836 | label_view_all_revisions: Voir toutes les rΓ©visions | |
837 | label_tag: Tag |
|
837 | label_tag: Tag | |
838 | label_branch: Branch |
|
838 | label_branch: Branch | |
839 | error_no_tracker_in_project: No tracker is associated to this project. Please check the Project settings. |
|
839 | error_no_tracker_in_project: No tracker is associated to this project. Please check the Project settings. |
@@ -75,7 +75,7 class RepositoriesSubversionControllerTest < Test::Unit::TestCase | |||||
75 | assert_equal ['folder', '.project', 'helloworld.c', 'helloworld.rb', 'textfile.txt'], assigns(:entries).collect(&:name) |
|
75 | assert_equal ['folder', '.project', 'helloworld.c', 'helloworld.rb', 'textfile.txt'], assigns(:entries).collect(&:name) | |
76 | end |
|
76 | end | |
77 |
|
77 | |||
78 | def test_changes |
|
78 | def test_file_changes | |
79 | get :changes, :id => 1, :path => ['subversion_test', 'folder', 'helloworld.rb' ] |
|
79 | get :changes, :id => 1, :path => ['subversion_test', 'folder', 'helloworld.rb' ] | |
80 | assert_response :success |
|
80 | assert_response :success | |
81 | assert_template 'changes' |
|
81 | assert_template 'changes' | |
@@ -94,6 +94,16 class RepositoriesSubversionControllerTest < Test::Unit::TestCase | |||||
94 | :child => { :tag => 'span', :content => 'native' } } |
|
94 | :child => { :tag => 'span', :content => 'native' } } | |
95 | end |
|
95 | end | |
96 | end |
|
96 | end | |
|
97 | ||||
|
98 | def test_directory_changes | |||
|
99 | get :changes, :id => 1, :path => ['subversion_test', 'folder' ] | |||
|
100 | assert_response :success | |||
|
101 | assert_template 'changes' | |||
|
102 | ||||
|
103 | changesets = assigns(:changesets) | |||
|
104 | assert_not_nil changesets | |||
|
105 | assert_equal %w(7 6 5 2), changesets.collect(&:revision) | |||
|
106 | end | |||
97 |
|
107 | |||
98 | def test_entry |
|
108 | def test_entry | |
99 | get :entry, :id => 1, :path => ['subversion_test', 'helloworld.c'] |
|
109 | get :entry, :id => 1, :path => ['subversion_test', 'helloworld.c'] | |
@@ -181,11 +191,22 class RepositoriesSubversionControllerTest < Test::Unit::TestCase | |||||
181 | } |
|
191 | } | |
182 | end |
|
192 | end | |
183 |
|
193 | |||
184 | def test_diff |
|
194 | def test_revision_diff | |
185 | get :diff, :id => 1, :rev => 3 |
|
195 | get :diff, :id => 1, :rev => 3 | |
186 | assert_response :success |
|
196 | assert_response :success | |
187 | assert_template 'diff' |
|
197 | assert_template 'diff' | |
188 | end |
|
198 | end | |
|
199 | ||||
|
200 | def test_directory_diff | |||
|
201 | get :diff, :id => 1, :rev => 6, :rev_to => 2, :path => ['subversion_test', 'folder'] | |||
|
202 | assert_response :success | |||
|
203 | assert_template 'diff' | |||
|
204 | ||||
|
205 | diff = assigns(:diff) | |||
|
206 | assert_not_nil diff | |||
|
207 | # 2 files modified | |||
|
208 | assert_equal 2, Redmine::UnifiedDiff.new(diff).size | |||
|
209 | end | |||
189 |
|
210 | |||
190 | def test_annotate |
|
211 | def test_annotate | |
191 | get :annotate, :id => 1, :path => ['subversion_test', 'helloworld.c'] |
|
212 | get :annotate, :id => 1, :path => ['subversion_test', 'helloworld.c'] |
General Comments 0
You need to be logged in to leave comments.
Login now