diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-05-06 15:46:42 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-05-06 15:46:42 +0300 |
commit | 3f2282300d9c97e8c0c1df955bdd13d7ee1dc96e (patch) | |
tree | 5aecfc4a32e2a784211cfc1fa3d37b49ca791f66 | |
parent | 7af59c54fc1fcf9d19927e76be49318689684f8b (diff) | |
parent | 22d5e9855c776b32a79853548839211bba07f792 (diff) |
Merge branch 'mr-change-branches' into 'master'
When use change branches link at MR form - save source branch selection instead of target one
Fix for https://dev.gitlab.org/gitlab/gitlabhq/issues/1800
cc @jacobvosmaer
See merge request !615
-rw-r--r-- | CHANGELOG | 2 | ||||
-rw-r--r-- | app/helpers/merge_requests_helper.rb | 12 | ||||
-rw-r--r-- | app/views/projects/merge_requests/_new_submit.html.haml | 2 |
3 files changed, 14 insertions, 2 deletions
diff --git a/CHANGELOG b/CHANGELOG index 433ea27a31c..c7fb49dc183 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -20,7 +20,7 @@ v 7.11.0 (unreleased) - 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 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. - 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. diff --git a/app/helpers/merge_requests_helper.rb b/app/helpers/merge_requests_helper.rb index 54462fd00e3..45ee4fe4135 100644 --- a/app/helpers/merge_requests_helper.rb +++ b/app/helpers/merge_requests_helper.rb @@ -49,4 +49,16 @@ module MergeRequestsHelper def issues_sentence(issues) issues.map { |i| "##{i.iid}" }.to_sentence 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 diff --git a/app/views/projects/merge_requests/_new_submit.html.haml b/app/views/projects/merge_requests/_new_submit.html.haml index 4e72458932c..6dc883ba22b 100644 --- a/app/views/projects/merge_requests/_new_submit.html.haml +++ b/app/views/projects/merge_requests/_new_submit.html.haml @@ -7,7 +7,7 @@ %strong.label-branch #{@merge_request.target_project_namespace}:#{@merge_request.target_branch} %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| .merge-request-form-info |