##// END OF EJS Templates
scm: use format_revision() for history, view and annotate (#3724)....
Toshi MARUYAMA -
r4613:6e1fa1603b16
parent child
Show More
@@ -94,6 +94,7 class RepositoriesController < ApplicationController
94 (show_error_not_found; return) unless @entry
94 (show_error_not_found; return) unless @entry
95 @changesets = @repository.latest_changesets(@path, @rev, Setting.repository_log_display_limit.to_i)
95 @changesets = @repository.latest_changesets(@path, @rev, Setting.repository_log_display_limit.to_i)
96 @properties = @repository.properties(@path, @rev)
96 @properties = @repository.properties(@path, @rev)
97 @changeset = @repository.find_changeset_by_name(@rev)
97 end
98 end
98
99
99 def revisions
100 def revisions
@@ -127,17 +128,19 class RepositoriesController < ApplicationController
127 else
128 else
128 # Prevent empty lines when displaying a file with Windows style eol
129 # Prevent empty lines when displaying a file with Windows style eol
129 @content.gsub!("\r\n", "\n")
130 @content.gsub!("\r\n", "\n")
131 @changeset = @repository.find_changeset_by_name(@rev)
130 end
132 end
131 end
133 end
132
134
133 def annotate
135 def annotate
134 @entry = @repository.entry(@path, @rev)
136 @entry = @repository.entry(@path, @rev)
135 (show_error_not_found; return) unless @entry
137 (show_error_not_found; return) unless @entry
136
138
137 @annotate = @repository.scm.annotate(@path, @rev)
139 @annotate = @repository.scm.annotate(@path, @rev)
138 (render_error l(:error_scm_annotate); return) if @annotate.nil? || @annotate.empty?
140 (render_error l(:error_scm_annotate); return) if @annotate.nil? || @annotate.empty?
141 @changeset = @repository.find_changeset_by_name(@rev)
139 end
142 end
140
143
141 def revision
144 def revision
142 raise ChangesetNotFound if @rev.blank?
145 raise ChangesetNotFound if @rev.blank?
143 @changeset = @repository.find_changeset_by_name(@rev)
146 @changeset = @repository.find_changeset_by_name(@rev)
@@ -16,6 +16,6 dirs.each do |dir|
16 / <%= link_to h(filename), :action => 'changes', :id => @project, :path => to_path_param("#{link_path}/#{filename}"), :rev => @rev %>
16 / <%= link_to h(filename), :action => 'changes', :id => @project, :path => to_path_param("#{link_path}/#{filename}"), :rev => @rev %>
17 <% end %>
17 <% end %>
18
18
19 <%= "@ #{h revision}" if revision %>
19 <%= "@ #{h format_revision(@changeset)}" if @changeset %>
20
20
21 <% html_title(with_leading_slash(path)) -%>
21 <% html_title(with_leading_slash(path)) -%>
General Comments 0
You need to be logged in to leave comments. Login now