@@ -72,9 +72,7 class RepositoriesController < ApplicationController | |||
|
72 | 72 | @entries ? render(:partial => 'dir_list_content') : render(:nothing => true) |
|
73 | 73 | else |
|
74 | 74 | show_error_not_found and return unless @entries |
|
75 | if @path.blank? | |
|
76 | @changesets = @repository.latest_changesets(@path, @rev) | |
|
77 | end | |
|
75 | @changesets = @repository.latest_changesets(@path, @rev) | |
|
78 | 76 | @properties = @repository.properties(@path, @rev) |
|
79 | 77 | render :action => 'show' |
|
80 | 78 | end |
@@ -1,3 +1,5 | |||
|
1 | <% if @entry && @entry.kind == 'file' %> | |
|
2 | ||
|
1 | 3 | <p> |
|
2 | 4 | <%= link_to_if action_name != 'changes', l(:label_history), {:action => 'changes', :id => @project, :path => to_path_param(@path), :rev => @rev } %> | |
|
3 | 5 | <% if @repository.supports_cat? %> |
@@ -9,3 +11,5 | |||
|
9 | 11 | <%= link_to(l(:button_download), {:action => 'entry', :id => @project, :path => to_path_param(@path), :rev => @rev, :format => 'raw' }) if @repository.supports_cat? %> |
|
10 | 12 | <%= "(#{number_to_human_size(@entry.size)})" if @entry.size %> |
|
11 | 13 | </p> |
|
14 | ||
|
15 | <% end %> |
@@ -9,7 +9,7 | |||
|
9 | 9 | <th><%= l(:field_comments) %></th> |
|
10 | 10 | </tr></thead> |
|
11 | 11 | <tbody> |
|
12 |
<% show_diff = |
|
|
12 | <% show_diff = revisions.size > 1 %> | |
|
13 | 13 | <% line_num = 1 %> |
|
14 | 14 | <% revisions.each do |changeset| %> |
|
15 | 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 | 3 | <!-- Choose view type --> |
|
4 | 4 | <% form_tag({}, :method => 'get') do %> |
@@ -14,8 +14,14 | |||
|
14 | 14 | |
|
15 | 15 | <% if @changesets && !@changesets.empty? && authorize_for('repositories', 'revisions') %> |
|
16 | 16 | <h3><%= l(:label_latest_revision_plural) %></h3> |
|
17 |
<%= render :partial => 'revisions', :locals => {:project => @project, :path => |
|
|
18 | <p><%= link_to l(:label_view_all_revisions), :action => 'revisions', :id => @project %></p> | |
|
17 | <%= render :partial => 'revisions', :locals => {:project => @project, :path => @path, :revisions => @changesets, :entry => nil }%> | |
|
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 | 25 | <% content_for :header_tags do %> |
|
20 | 26 | <%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :action => 'revisions', :id => @project, :page => nil, :key => User.current.rss_key})) %> |
|
21 | 27 | <% end %> |
@@ -833,7 +833,7 fr: | |||
|
833 | 833 | enumeration_activities: ActivitΓ©s (suivi du temps) |
|
834 | 834 | label_greater_or_equal: ">=" |
|
835 | 835 | label_less_or_equal: "<=" |
|
836 |
label_view_all_revisions: V |
|
|
836 | label_view_all_revisions: Voir toutes les rΓ©visions | |
|
837 | 837 | label_tag: Tag |
|
838 | 838 | label_branch: Branch |
|
839 | 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 | 75 | assert_equal ['folder', '.project', 'helloworld.c', 'helloworld.rb', 'textfile.txt'], assigns(:entries).collect(&:name) |
|
76 | 76 | end |
|
77 | 77 | |
|
78 | def test_changes | |
|
78 | def test_file_changes | |
|
79 | 79 | get :changes, :id => 1, :path => ['subversion_test', 'folder', 'helloworld.rb' ] |
|
80 | 80 | assert_response :success |
|
81 | 81 | assert_template 'changes' |
@@ -94,6 +94,16 class RepositoriesSubversionControllerTest < Test::Unit::TestCase | |||
|
94 | 94 | :child => { :tag => 'span', :content => 'native' } } |
|
95 | 95 | end |
|
96 | 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 | 108 | def test_entry |
|
99 | 109 | get :entry, :id => 1, :path => ['subversion_test', 'helloworld.c'] |
@@ -181,11 +191,22 class RepositoriesSubversionControllerTest < Test::Unit::TestCase | |||
|
181 | 191 | } |
|
182 | 192 | end |
|
183 | 193 | |
|
184 | def test_diff | |
|
194 | def test_revision_diff | |
|
185 | 195 | get :diff, :id => 1, :rev => 3 |
|
186 | 196 | assert_response :success |
|
187 | 197 | assert_template 'diff' |
|
188 | 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 | 211 | def test_annotate |
|
191 | 212 | get :annotate, :id => 1, :path => ['subversion_test', 'helloworld.c'] |
General Comments 0
You need to be logged in to leave comments.
Login now