]> source.dussan.org Git - redmine.git/commitdiff
scm: changing two revision diff text at SCM adapter level (#3724).
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Tue, 11 Jan 2011 16:04:07 +0000 (16:04 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Tue, 11 Jan 2011 16:04:07 +0000 (16:04 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4698 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/repositories_controller.rb
app/models/repository.rb
app/views/repositories/diff.rhtml

index 6195c6409ac201feaf0abddebb85074b4daefd2b..4b0a834644527f3bb39bae7379d43232bea0a386 100644 (file)
@@ -177,9 +177,10 @@ class RepositoriesController < ApplicationController
 
       @changeset = @repository.find_changeset_by_name(@rev)
       @changeset_to = @rev_to ? @repository.find_changeset_by_name(@rev_to) : nil
+      @diff_format_revisions = @repository.diff_format_revisions(@changeset, @changeset_to)
     end
   end
-  
+
   def stats  
   end
   
index dee705c97d3df0306b7a42c6d707e77aaea487fc..3a84a691a282db7f98b95867a86331df7045acf9 100644 (file)
@@ -86,7 +86,14 @@ class Repository < ActiveRecord::Base
   def diff(path, rev, rev_to)
     scm.diff(path, rev, rev_to)
   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
   def relative_path(path)
     path
index e2323549e2b83789cd3af15c477746cec0a9f11c..efb84a44d20810d0bf30b05892c0758ae7f22994 100644 (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 -->
 <% form_tag({:path => to_path_param(@path)}, :method => 'get') do %>