Index: app/helpers/repositories_helper.rb
===================================================================
--- app/helpers/repositories_helper.rb (Revision 20051)
+++ app/helpers/repositories_helper.rb (Arbeitskopie)
@@ -326,4 +326,59 @@
end
max_space
end
+
+ def has_branch_detail?
+ @repository.scm.respond_to? :branch_contains
+ end
+
+ def insert_branches_detail(html)
+ return html unless has_branch_detail?
+ substring = ''
+ location = html.index(substring).to_i + substring.length
+ html.insert(location, branches_html)
+ end
+
+ def branches_html
+ content_tag(:li) do
+ content = content_tag(:strong, "#{l(:label_branch)}")
+ content << " "
+ content << "#{@repository.identifier}@ "
+ content << links_to_branches.join(', ').html_safe
+ end
+ end
+
+ def links_to_branches
+ return [] unless has_branch_detail?
+ branch_groups.map { |name, branches| branches_link(name, branches) }
+ end
+
+ def branches_link(name, branches)
+ return branch_link(branches.first) if branches.length == 1
+ link = link_to("[#{name}...]", 'javascript:;', class: 'scm-branch-group').html_safe
+ content_tag(:span, class: 'scm-branch-hide') do
+ link << content_tag(:span, class: 'scm-branches') do
+ branches.map { |branch| branch_link(branch) }.join(', ').html_safe
+ end
+ end
+ end
+
+ def branch_link(branch)
+ link_to(branch, {:controller => 'repositories',
+ :action => 'show',
+ :id => @repository.project,
+ :repository_id => @repository.identifier,
+ :path => to_path_param(@path),
+ :rev => branch}).html_safe
+ end
+
+ def branch_groups
+ @repository.scm.branch_contains(@rev).group_by do |branch|
+ branch.downcase
+ .gsub(/^\d+/, '#####')
+ .split(/[\-\._]/)
+ .first
+ end.sort_by { |name, branches| [branches.length, name] }
+ end
+
+
end
Index: app/views/issues/tabs/_changesets.html.erb
===================================================================
--- app/views/issues/tabs/_changesets.html.erb (Revision 20051)
+++ app/views/issues/tabs/_changesets.html.erb (Arbeitskopie)
@@ -14,6 +14,12 @@
:repository_id => changeset.repository.identifier_param,
:path => "",
:rev => changeset.identifier) %>)
+ <% if !Setting.display_under_associated_revisions? && changeset.scmid.present?
+ @repository = changeset.repository
+ @rev = changeset.identifier
+ %>
+ (<%= l(:label_branches) %>: <%= links_to_branches.join(', ').html_safe %>)
+ <% end %>
<% end %>
+
+
<%= setting_text_field :gantt_items_limit, :size => 6 %>
<%= setting_text_field :gantt_months_limit, :size => 6 %>
+