scm: changing two revision diff text at SCM adapter level (#3724).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4698 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-01-11 16:04:07 +00:00
parent fdd0a2ca9b
commit ebb19c5863
3 changed files with 11 additions and 3 deletions

View File

@ -177,6 +177,7 @@ class RepositoriesController < ApplicationController
@changeset = @repository.find_changeset_by_name(@rev) @changeset = @repository.find_changeset_by_name(@rev)
@changeset_to = @rev_to ? @repository.find_changeset_by_name(@rev_to) : nil @changeset_to = @rev_to ? @repository.find_changeset_by_name(@rev_to) : nil
@diff_format_revisions = @repository.diff_format_revisions(@changeset, @changeset_to)
end end
end end

View File

@ -87,6 +87,13 @@ class Repository < ActiveRecord::Base
scm.diff(path, rev, rev_to) scm.diff(path, rev, rev_to)
end end
def diff_format_revisions(cs, cs_to, sep=':')
text = ""
text << cs_to.format_identifier + sep if cs_to
text << cs.format_identifier if cs
text
end
# Returns a path relative to the url of the repository # Returns a path relative to the url of the repository
def relative_path(path) def relative_path(path)
path path

View File

@ -1,4 +1,4 @@
<h2><%= l(:label_revision) %> <%= format_revision(@changeset_to) + ':' if @changeset_to %><%= format_revision(@changeset) %> <%=h @path %></h2> <h2><%= l(:label_revision) %> <%= @diff_format_revisions %> <%=h @path %></h2>
<!-- Choose view type --> <!-- Choose view type -->
<% form_tag({:path => to_path_param(@path)}, :method => 'get') do %> <% form_tag({:path => to_path_param(@path)}, :method => 'get') do %>