]> source.dussan.org Git - redmine.git/commitdiff
Rename Repository#supports_all_revisions? to Repository#supports_history? (#37657).
authorGo MAEDA <maeda@farend.jp>
Thu, 15 Sep 2022 13:14:05 +0000 (13:14 +0000)
committerGo MAEDA <maeda@farend.jp>
Thu, 15 Sep 2022 13:14:05 +0000 (13:14 +0000)
Patch by Go MAEDA.

git-svn-id: https://svn.redmine.org/redmine/trunk@21816 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/repository.rb
app/models/repository/filesystem.rb
app/views/repositories/_link_to_functions.html.erb
app/views/repositories/_navigation.html.erb
app/views/repositories/show.html.erb
test/functional/repositories_filesystem_controller_test.rb

index dfed2b611c96026a1e28ebb06fcbdd6a263ea3ac..b6c8f0988f0e556bf5382039ba647173136c21ed 100644 (file)
@@ -185,6 +185,11 @@ class Repository < ActiveRecord::Base
   end
 
   def supports_all_revisions?
+    ActiveSupport::Deprecation.warn 'Repository#supports_all_revisions? is deprecated and will be removed in Redmine 6.0. Please use #supports_history instead.'
+    supports_history?
+  end
+
+  def supports_history?
     true
   end
 
index 3ce7c5d7383395a7eeaefad62efca3ce8a0a1656..52e8881226fcdff64f1978bb196a01842385edbe 100644 (file)
@@ -41,7 +41,7 @@ class Repository::Filesystem < Repository
     'Filesystem'
   end
 
-  def supports_all_revisions?
+  def supports_history?
     false
   end
 
index bfdc99cc44160992bdbc1674a787eb87f4b4fcf2..ef7bb7c22cd4131793aabdde81389c83dcf95ef0 100644 (file)
@@ -8,7 +8,7 @@ tabs << { name: 'entry', label: :button_view,
 
 tabs << { name: 'changes', label: :label_history,
           url: {:action => 'changes', :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(@path), :rev => @rev }
-        } if @repository.supports_all_revisions?
+        } if @repository.supports_history?
 tabs << { name: 'annotate', label: :button_annotate,
           url: {:action => 'annotate', :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(@path), :rev => @rev }
         } if @repository.supports_annotate?
index b37631a81e828c9c673c3e9b901976f7685b932a..6653909d1dcad1e1d5ef18aaf18880f2236b830e 100644 (file)
@@ -13,7 +13,7 @@
 
 <%= link_to l(:label_statistics),
             {:action => 'stats', :id => @project, :repository_id => @repository.identifier_param},
-            :class => 'icon icon-stats' if @repository.supports_all_revisions? %>
+            :class => 'icon icon-stats' if @repository.supports_history? %>
 
 <%= actions_dropdown do %>
   <%= link_to_if_authorized l(:label_settings),
@@ -45,7 +45,7 @@
                    :id => 'tag' %>
   <% end -%>
 
-  <% if @repository.supports_all_revisions? %>
+  <% if @repository.supports_history? %>
     | <%= l(:label_revision) %>: 
     <%= text_field_tag 'rev', @rev, :size => 8 %>
   <% end %>
index 5533ff09da63193532b053c64d6ac01080e9aea5..ec2ae6fbcae9c7645797ebfee75dd4b7f95e9c33 100644 (file)
@@ -23,7 +23,7 @@
   <p>
   <% has_branches = (!@repository.branches.nil? && @repository.branches.length > 0)
      sep = '' %>
-  <% if @repository.supports_all_revisions? && @path.blank? %>
+  <% if @repository.supports_history? && @path.blank? %>
     <%= link_to l(:label_view_all_revisions), :action => 'revisions', :id => @project,
                 :repository_id => @repository.identifier_param %>
     <% sep = '|' %>
@@ -39,7 +39,7 @@
                    :rev    => @rev %>
   <% end %>
   </p>
-  <% if @repository.supports_all_revisions? %>
+  <% if @repository.supports_history? %>
     <% content_for :header_tags do %>
       <%= auto_discovery_link_tag(
                    :atom,
index 92f0edf8f6c1246e58c8343be1108f73c774d650..a2a92a9c5c7a6eee340d122b976b20fc26672267 100644 (file)
@@ -215,7 +215,7 @@ class RepositoriesFilesystemControllerTest < Redmine::RepositoryControllerTest
       assert_response :success
       assert @repository.supports_cat?
       assert_select 'a#tab-entry', :text => /View/
-      assert_not @repository.supports_all_revisions?
+      assert_not @repository.supports_history?
       assert_select 'a#tab-changes', 0
       assert_not @repository.supports_annotate?
       assert_select 'a#tab-annotate', 0