Commit 22d5e985 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

When use change branches link at MR form - save source branch selection instead of target one

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 7af59c54
...@@ -20,7 +20,7 @@ v 7.11.0 (unreleased) ...@@ -20,7 +20,7 @@ v 7.11.0 (unreleased)
- Add "Reply quoting selected text" shortcut key (`r`) - Add "Reply quoting selected text" shortcut key (`r`)
- Fix bug causing `@whatever` inside an issue's first code block to be picked up as a user mention. - Fix bug causing `@whatever` inside an issue's first code block to be picked up as a user mention.
- Fix bug causing `@whatever` inside an inline code snippet (backtick-style) to be picked up as a user mention. - Fix bug causing `@whatever` inside an inline code snippet (backtick-style) to be picked up as a user mention.
- - When use change branches link at MR form - save source branch selection instead of target one
- Show Atom feed buttons everywhere where applicable. - Show Atom feed buttons everywhere where applicable.
- Add project activity atom feed. - Add project activity atom feed.
- Don't crash when an MR from a fork has a cross-reference comment from the target project on one of its commits. - Don't crash when an MR from a fork has a cross-reference comment from the target project on one of its commits.
......
...@@ -49,4 +49,16 @@ module MergeRequestsHelper ...@@ -49,4 +49,16 @@ module MergeRequestsHelper
def issues_sentence(issues) def issues_sentence(issues)
issues.map { |i| "##{i.iid}" }.to_sentence issues.map { |i| "##{i.iid}" }.to_sentence
end end
def mr_change_branches_path(merge_request)
new_namespace_project_merge_request_path(
@project.namespace, @project,
merge_request: {
source_project_id: @merge_request.source_project_id,
target_project_id: @merge_request.target_project_id,
source_branch: @merge_request.source_branch,
target_branch: nil
}
)
end
end end
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
%strong.label-branch #{@merge_request.target_project_namespace}:#{@merge_request.target_branch} %strong.label-branch #{@merge_request.target_project_namespace}:#{@merge_request.target_branch}
%span.pull-right %span.pull-right
= link_to 'Change branches', new_namespace_project_merge_request_path(@project.namespace, @project) = link_to 'Change branches', mr_change_branches_path(@merge_request)
= form_for [@project.namespace.becomes(Namespace), @project, @merge_request], html: { class: "merge-request-form form-horizontal gfm-form" } do |f| = form_for [@project.namespace.becomes(Namespace), @project, @merge_request], html: { class: "merge-request-form form-horizontal gfm-form" } do |f|
.merge-request-form-info .merge-request-form-info
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment