Feature #5386 » 0001-5386-Branch-Tags-in-Changeset-Description-7.patch
| app/assets/javascripts/application-legacy.js | ||
|---|---|---|
|
$(document).on('focus', '[data-auto-complete=true]', function(event) {
|
||
|
inlineAutoComplete(event.target);
|
||
|
});
|
||
|
// Branch groups are rendered on the revision page and in the issue
|
||
|
// history tab, which is loaded later. Delegation keeps the expander working.
|
||
|
$(document).on('click', 'a.scm-branch-group', function(e) {
|
||
|
e.preventDefault();
|
||
|
$(this).parent().removeClass('scm-branch-hide');
|
||
|
});
|
||
| app/assets/javascripts/repository_navigation.js | ||
|---|---|---|
|
$('#branch,#tag').removeAttr('disabled');
|
||
|
}
|
||
|
});
|
||
|
$('a.scm-branch-group').on('click', function(e) {
|
||
|
e.preventDefault();
|
||
|
$(this).parent().removeClass('scm-branch-hide');
|
||
|
});
|
||
|
})
|
||
| app/assets/stylesheets/application.css | ||
|---|---|---|
|
#sidebar .api-key-actions .copy-api-key-link svg {
|
||
|
opacity: 1;
|
||
|
}
|
||
|
.scm-branch-group, .scm-branch-hide > .scm-branches { display: none; }
|
||
|
.scm-branch-hide > .scm-branch-group { display: inline; }
|
||
| app/assets/stylesheets/scm.css | ||
|---|---|---|
|
.breadcrumbs>.separator::before, .breadcrumbs>.separator::after {
|
||
|
content: " ";
|
||
|
}
|
||
|
.scm-branch-group, .scm-branch-hide > .scm-branches { display: none; }
|
||
|
.scm-branch-hide > .scm-branch-group { display: inline; }
|
||
| app/helpers/repositories_helper.rb | ||
|---|---|---|
|
end
|
||
|
max_space
|
||
|
end
|
||
|
def has_branch_detail?(repository = @repository)
|
||
|
repository.present? && repository.scm.respond_to?(:branch_contains)
|
||
|
rescue Redmine::Scm::Adapters::CommandFailed
|
||
|
false
|
||
|
end
|
||
|
def insert_branches_detail(html)
|
||
|
return html unless has_branch_detail?
|
||
|
html = html.to_s.dup
|
||
|
substring = '</li>'
|
||
|
index = html.index(substring)
|
||
|
return html.html_safe unless index
|
||
|
html.insert(index + substring.length, branches_html)
|
||
|
html.html_safe
|
||
|
end
|
||
|
def branches_html
|
||
|
content_tag(:li) do
|
||
|
safe_join(
|
||
|
[
|
||
|
content_tag(:strong, l(:label_branch)),
|
||
|
' ',
|
||
|
"#{@repository.identifier}@ ",
|
||
|
safe_join(links_to_branches, ', ')
|
||
|
]
|
||
|
)
|
||
|
end
|
||
|
end
|
||
|
def links_to_branches(repository = @repository, rev = @rev)
|
||
|
return [] unless has_branch_detail?(repository)
|
||
|
branch_groups(repository, rev).map do |name, branches|
|
||
|
branches_link(repository, name, branches)
|
||
|
end
|
||
|
rescue Redmine::Scm::Adapters::CommandFailed
|
||
|
[]
|
||
|
end
|
||
|
def branches_link(repository, name, branches)
|
||
|
return branch_link(repository, branches.first) if branches.length == 1
|
||
|
link = link_to("[#{name}...]", 'javascript:;', :class => 'scm-branch-group')
|
||
|
content_tag(:span, :class => 'scm-branch-hide') do
|
||
|
link + content_tag(
|
||
|
:span,
|
||
|
safe_join(branches.map {|branch| branch_link(repository, branch)}, ', '),
|
||
|
:class => 'scm-branches'
|
||
|
)
|
||
|
end
|
||
|
end
|
||
|
def branch_link(repository, branch)
|
||
|
link_to(
|
||
|
branch,
|
||
|
{
|
||
|
:controller => 'repositories',
|
||
|
:action => 'show',
|
||
|
:id => repository.project,
|
||
|
:repository_id => repository.identifier_param,
|
||
|
:path => to_path_param(@path),
|
||
|
:rev => branch
|
||
|
}
|
||
|
)
|
||
|
end
|
||
|
def branch_groups(repository = @repository, rev = @rev)
|
||
|
return [] if rev.blank?
|
||
|
repository.scm.branch_contains(rev).group_by do |branch|
|
||
|
branch.downcase.gsub(/^\d+/, '#####').split(/[\-\._]/).first
|
||
|
end.sort_by {|name, branches| [branches.length, name.to_s]}
|
||
|
end
|
||
|
end
|
||
| app/views/issues/tabs/_changesets.html.erb | ||
|---|---|---|
|
:path => "",
|
||
|
:rev => changeset.identifier) %>)
|
||
|
<% end %>
|
||
|
<% if Setting.display_under_associated_revisions? && changeset.scmid.present? &&
|
||
|
has_branch_detail?(changeset.repository) %>
|
||
|
<% branch_links = links_to_branches(changeset.repository, changeset.identifier) %>
|
||
|
<% if branch_links.any? %>
|
||
|
(<em><%= l(:label_branches) %>: <%= safe_join(branch_links, ', ') %></em>)
|
||
|
<% end %>
|
||
|
<% end %>
|
||
|
</p>
|
||
|
<div class="wiki changeset-comments">
|
||
|
<%= format_changeset_comments changeset %>
|
||
| app/views/repositories/_changeset.html.erb | ||
|---|---|---|
|
<%= avatar(@changeset.user) %>
|
||
|
<%= authoring(@changeset.committed_on, @changeset.author) %>
|
||
|
</h4>
|
||
|
<% if @changeset.scmid.present? || @changeset.parents.present? || @changeset.children.present? %>
|
||
|
<% branch_links =
|
||
|
if Setting.display_under_single_revision? && has_branch_detail?
|
||
|
links_to_branches(@repository, @changeset.scmid.presence || @rev)
|
||
|
else
|
||
|
[]
|
||
|
end %>
|
||
|
<% if @changeset.scmid.present? || @changeset.parents.present? || @changeset.children.present? || branch_links.any? %>
|
||
|
<ul class="revision-info">
|
||
|
<% if @changeset.scmid.present? %>
|
||
|
<li>
|
||
| ... | ... | |
|
}.join(", ").html_safe %>
|
||
|
</li>
|
||
|
<% end %>
|
||
|
<% if branch_links.any? %>
|
||
|
<li>
|
||
|
<strong><%= l(:label_branches) %></strong>
|
||
|
<%= safe_join(branch_links, ', ') %>
|
||
|
</li>
|
||
|
<% end %>
|
||
|
<% if @changeset.children.present? %>
|
||
|
<li>
|
||
|
<strong><%= l(:label_child_revision) %></strong>
|
||
| app/views/settings/_issues.html.erb | ||
|---|---|---|
|
<p><%= setting_text_field :gantt_months_limit, :size => 6 %></p>
|
||
|
</div>
|
||
|
<fieldset class="box">
|
||
|
<legend><%= l(:label_display_revision_branches) %></legend>
|
||
|
<div class="tabular settings">
|
||
|
<p><%= setting_check_box :display_under_single_revision %></p>
|
||
|
<p><%= setting_check_box :display_under_associated_revisions %></p>
|
||
|
</div>
|
||
|
</fieldset>
|
||
|
<fieldset class="box">
|
||
|
<legend><%= l(:label_parent_task_attributes) %></legend>
|
||
|
<div class="tabular settings">
|
||
| config/locales/de.yml | ||
|---|---|---|
|
label_board_sticky: Wichtig (immer oben)
|
||
|
label_boolean: Boolean
|
||
|
label_branch: Zweig
|
||
|
label_branches: Zweige
|
||
|
label_bulk_edit_selected_issues: Alle ausgewählten Tickets bearbeiten
|
||
|
label_bulk_edit_selected_time_entries: Ausgewählte Zeitaufwände bearbeiten
|
||
|
label_calendar: Kalender
|
||
| ... | ... | |
|
setting_default_projects_tracker_ids: Standardmäßig aktivierte Tracker für neue Projekte
|
||
|
setting_diff_max_lines_displayed: Maximale Anzahl anzuzeigender Diff-Zeilen
|
||
|
setting_display_subprojects_issues: Tickets von Unterprojekten im Hauptprojekt anzeigen
|
||
|
setting_display_under_single_revision: Unterschiede bei Revision anzeigen
|
||
|
setting_display_under_associated_revisions: Bei zugehörigen Revisionen anzeigen
|
||
|
setting_emails_footer: E-Mail-Fußzeile
|
||
|
setting_emails_header: E-Mail-Kopfzeile
|
||
|
setting_enabled_scm: Aktivierte Versionskontrollsysteme
|
||
| ... | ... | |
|
label_ends_with: endet mit
|
||
|
label_issue_fixed_version_updated: Zielversion aktualisiert
|
||
|
setting_project_list_defaults: Voreinstellungen Projektliste
|
||
|
label_display_revision_branches: Zweige zur Revision anzeigen
|
||
|
label_display_type: Ergebnisse anzeigen als
|
||
|
label_display_type_list: Liste
|
||
|
label_display_type_board: Karte
|
||
| config/locales/en.yml | ||
|---|---|---|
|
setting_time_format: Time format
|
||
|
setting_timespan_format: Time span format
|
||
|
setting_cross_project_issue_relations: Allow cross-project issue relations
|
||
|
setting_display_under_single_revision: Display revision under Single Revision
|
||
|
setting_display_under_associated_revisions: Display revision under Associated Revisions
|
||
|
setting_cross_project_subtasks: Allow cross-project subtasks
|
||
|
setting_issue_list_default_columns: Issues list defaults
|
||
|
setting_repositories_encodings: Attachments and repositories encodings
|
||
| ... | ... | |
|
label_repository_new: New repository
|
||
|
label_repository_plural: Repositories
|
||
|
label_branch: Branch
|
||
|
label_branches: Branches
|
||
|
label_tag: Tag
|
||
|
label_revision: Revision
|
||
|
label_revision_plural: Revisions
|
||
| ... | ... | |
|
label_registration_manual_activation: Account activation by administrator approval
|
||
|
label_registration_automatic_activation: Automatic account activation
|
||
|
label_display_per_page: "Per page: %{value}"
|
||
|
label_display_revision_branches: Show branches for revision
|
||
|
label_age: Age
|
||
|
label_change_properties: Change properties
|
||
|
label_general: General
|
||
| config/settings.yml | ||
|---|---|---|
|
- done_ratio
|
||
|
display_related_issues_table_headers:
|
||
|
default: 0
|
||
|
display_under_single_revision:
|
||
|
default: 1
|
||
|
display_under_associated_revisions:
|
||
|
default: 1
|
||
|
display_subprojects_issues:
|
||
|
default: 1
|
||
|
time_entry_list_defaults:
|
||
| lib/redmine/scm/adapters/git_adapter.rb | ||
|---|---|---|
|
nil
|
||
|
end
|
||
|
# Local branch names that contain the given commit.
|
||
|
# Non-word characters are stripped before the value is passed to git.
|
||
|
def branch_contains(hash)
|
||
|
cleaned_hash = hash.to_s.gsub(/[^\w]/, '')
|
||
|
return [] if cleaned_hash.empty?
|
||
|
cmd_args = %w|branch --no-color --contains|
|
||
|
cmd_args << cleaned_hash
|
||
|
branches = []
|
||
|
git_cmd(cmd_args) do |io|
|
||
|
branches =
|
||
|
io.readlines.filter_map do |line|
|
||
|
name = line.strip.sub(/\A[*+]\s*/, '')
|
||
|
next if name.empty?
|
||
|
scm_iconv('UTF-8', @path_encoding, name)
|
||
|
end
|
||
|
end
|
||
|
branches.sort.uniq
|
||
|
rescue ScmCommandAborted
|
||
|
[]
|
||
|
end
|
||
|
def tags
|
||
|
return @tags if @tags
|
||
- « Previous
- 1
- …
- 10
- 11
- 12
- Next »