Project

General

Profile

Patch #37657 ยป change_the_name_of_supports_all_revisions.rb

Go MAEDA, 2022-09-09 08:48

 
1
diff --git a/app/models/repository.rb b/app/models/repository.rb
2
index dfed2b611..b6c8f0988 100644
3
--- a/app/models/repository.rb
4
+++ b/app/models/repository.rb
5
@@ -185,6 +185,11 @@ class Repository < ActiveRecord::Base
6
   end
7
 
8
   def supports_all_revisions?
9
+    ActiveSupport::Deprecation.warn 'Repository#supports_all_revisions? is deprecated and will be removed in Redmine 6.0. Please use #supports_history instead.'
10
+    supports_history?
11
+  end
12
+
13
+  def supports_history?
14
     true
15
   end
16
 
17
diff --git a/app/models/repository/filesystem.rb b/app/models/repository/filesystem.rb
18
index 3ce7c5d73..52e888122 100644
19
--- a/app/models/repository/filesystem.rb
20
+++ b/app/models/repository/filesystem.rb
21
@@ -41,7 +41,7 @@ class Repository::Filesystem < Repository
22
     'Filesystem'
23
   end
24
 
25
-  def supports_all_revisions?
26
+  def supports_history?
27
     false
28
   end
29
 
30
diff --git a/app/views/repositories/_link_to_functions.html.erb b/app/views/repositories/_link_to_functions.html.erb
31
index bfdc99cc4..ef7bb7c22 100644
32
--- a/app/views/repositories/_link_to_functions.html.erb
33
+++ b/app/views/repositories/_link_to_functions.html.erb
34
@@ -8,7 +8,7 @@ tabs << { name: 'entry', label: :button_view,
35
 
36
 tabs << { name: 'changes', label: :label_history,
37
           url: {:action => 'changes', :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(@path), :rev => @rev }
38
-        } if @repository.supports_all_revisions?
39
+        } if @repository.supports_history?
40
 tabs << { name: 'annotate', label: :button_annotate,
41
           url: {:action => 'annotate', :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(@path), :rev => @rev }
42
         } if @repository.supports_annotate?
43
diff --git a/app/views/repositories/_navigation.html.erb b/app/views/repositories/_navigation.html.erb
44
index b37631a81..6653909d1 100644
45
--- a/app/views/repositories/_navigation.html.erb
46
+++ b/app/views/repositories/_navigation.html.erb
47
@@ -13,7 +13,7 @@
48
 
49
 <%= link_to l(:label_statistics),
50
             {:action => 'stats', :id => @project, :repository_id => @repository.identifier_param},
51
-            :class => 'icon icon-stats' if @repository.supports_all_revisions? %>
52
+            :class => 'icon icon-stats' if @repository.supports_history? %>
53
 
54
 <%= actions_dropdown do %>
55
   <%= link_to_if_authorized l(:label_settings),
56
@@ -45,7 +45,7 @@
57
                    :id => 'tag' %>
58
   <% end -%>
59
 
60
-  <% if @repository.supports_all_revisions? %>
61
+  <% if @repository.supports_history? %>
62
     | <%= l(:label_revision) %>: 
63
     <%= text_field_tag 'rev', @rev, :size => 8 %>
64
   <% end %>
65
diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb
66
index 5533ff09d..ec2ae6fbc 100644
67
--- a/app/views/repositories/show.html.erb
68
+++ b/app/views/repositories/show.html.erb
69
@@ -23,7 +23,7 @@
70
   <p>
71
   <% has_branches = (!@repository.branches.nil? && @repository.branches.length > 0)
72
      sep = '' %>
73
-  <% if @repository.supports_all_revisions? && @path.blank? %>
74
+  <% if @repository.supports_history? && @path.blank? %>
75
     <%= link_to l(:label_view_all_revisions), :action => 'revisions', :id => @project,
76
                 :repository_id => @repository.identifier_param %>
77
     <% sep = '|' %>
78
@@ -39,7 +39,7 @@
79
                    :rev    => @rev %>
80
   <% end %>
81
   </p>
82
-  <% if @repository.supports_all_revisions? %>
83
+  <% if @repository.supports_history? %>
84
     <% content_for :header_tags do %>
85
       <%= auto_discovery_link_tag(
86
                    :atom,
87
diff --git a/test/functional/repositories_filesystem_controller_test.rb b/test/functional/repositories_filesystem_controller_test.rb
88
index 92f0edf8f..a2a92a9c5 100644
89
--- a/test/functional/repositories_filesystem_controller_test.rb
90
+++ b/test/functional/repositories_filesystem_controller_test.rb
91
@@ -215,7 +215,7 @@ class RepositoriesFilesystemControllerTest < Redmine::RepositoryControllerTest
92
       assert_response :success
93
       assert @repository.supports_cat?
94
       assert_select 'a#tab-entry', :text => /View/
95
-      assert_not @repository.supports_all_revisions?
96
+      assert_not @repository.supports_history?
97
       assert_select 'a#tab-changes', 0
98
       assert_not @repository.supports_annotate?
99
       assert_select 'a#tab-annotate', 0
    (1-1/1)