From e1667dabbf1b74d92d98618550b55cc0af6952db Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Fri, 21 Jan 2011 13:22:08 +0000 Subject: [PATCH] scm: use format_revision() for history, view and annotate (#3724). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4733 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/repositories_controller.rb | 7 +++++-- app/views/repositories/_breadcrumbs.rhtml | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index b5f70e3f..50a6ff4a 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -94,6 +94,7 @@ class RepositoriesController < ApplicationController (show_error_not_found; return) unless @entry @changesets = @repository.latest_changesets(@path, @rev, Setting.repository_log_display_limit.to_i) @properties = @repository.properties(@path, @rev) + @changeset = @repository.find_changeset_by_name(@rev) end def revisions @@ -127,17 +128,19 @@ class RepositoriesController < ApplicationController else # Prevent empty lines when displaying a file with Windows style eol @content.gsub!("\r\n", "\n") + @changeset = @repository.find_changeset_by_name(@rev) end end - + def annotate @entry = @repository.entry(@path, @rev) (show_error_not_found; return) unless @entry @annotate = @repository.scm.annotate(@path, @rev) (render_error l(:error_scm_annotate); return) if @annotate.nil? || @annotate.empty? + @changeset = @repository.find_changeset_by_name(@rev) end - + def revision raise ChangesetNotFound if @rev.blank? @changeset = @repository.find_changeset_by_name(@rev) diff --git a/app/views/repositories/_breadcrumbs.rhtml b/app/views/repositories/_breadcrumbs.rhtml index bab0ff33..1dd2445c 100644 --- a/app/views/repositories/_breadcrumbs.rhtml +++ b/app/views/repositories/_breadcrumbs.rhtml @@ -16,6 +16,6 @@ dirs.each do |dir| / <%= link_to h(filename), :action => 'changes', :id => @project, :path => to_path_param("#{link_path}/#{filename}"), :rev => @rev %> <% end %> -<%= "@ #{h revision}" if revision %> +<%= "@ #{h format_revision(@changeset)}" if @changeset %> <% html_title(with_leading_slash(path)) -%>