revision_links.patch

Alexei Kornienko, 2012-01-07 17:07

Download (2.23 KB)

View differences:

app/models/repository/mercurial.rb (working copy)
67 67
    changeset.scmid
68 68
  end
69 69

  
70
  def diff_format_revisions(cs, cs_to, sep=':')
71
    super(cs, cs_to, ' ')
72
  end
73

  
74 70
  # Finds and returns a revision with a number or the beginning of a hash
75 71
  def find_changeset_by_name(name)
76 72
    return nil if name.nil? || name.empty?
app/models/repository.rb (working copy)
144 144
    scm.diff(path, rev, rev_to)
145 145
  end
146 146

  
147
  def diff_format_revisions(cs, cs_to, sep=':')
148
    text = ""
149
    text << cs_to.format_identifier + sep if cs_to
150
    text << cs.format_identifier if cs
151
    text
152
  end
153

  
154 147
  # Returns a path relative to the url of the repository
155 148
  def relative_path(path)
156 149
    path
app/views/repositories/diff.html.erb (working copy)
1
<h2><%= l(:label_revision) %> <%= @diff_format_revisions %> <%=h @path %></h2>
1
<h2><%= l(:label_revision) %>
2
<%= revision_links = ""
3
revision_links << link_to_revision(@changeset_to, @project, :text => format_revision(@changeset_to)) + ":" if @changeset_to
4
revision_links << link_to_revision(@changeset, @project, :text => format_revision(@changeset)) 
5
revision_links %>
6
<%=h @path %></h2>
2 7

  
3 8
<!-- Choose view type -->
4 9
<% form_tag({:path => to_path_param(@path)}, :method => 'get') do %>
app/controllers/repositories_controller.rb (working copy)
225 225

  
226 226
      @changeset = @repository.find_changeset_by_name(@rev)
227 227
      @changeset_to = @rev_to ? @repository.find_changeset_by_name(@rev_to) : nil
228
      @diff_format_revisions = @repository.diff_format_revisions(@changeset, @changeset_to)
229 228
    end
230 229
  end
231 230