diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-07-30 14:35:33 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-07-30 14:35:33 +0400 |
commit | 0d715bcd812ca6c99884e117f28a400669aa8e57 (patch) | |
tree | 5690fa43c790af40c51441425b9d8be068d4139d /app/views | |
parent | 4f07a6a99cab8f8ae3ad0a786a6cc9a837955c08 (diff) | |
parent | 4d373005968b8269a8d2fe56b7776820396127a4 (diff) |
Merge branch 'mr-on-fork' of https://github.com/karlhungus/gitlabhq into karlhungus-mr-on-fork
Conflicts:
app/views/projects/commit/show.html.haml
app/views/projects/compare/show.html.haml
app/views/projects/merge_requests/branch_from.js.haml
Diffstat (limited to 'app/views')
29 files changed, 143 insertions, 85 deletions
diff --git a/app/views/events/_event_last_push.html.haml b/app/views/events/_event_last_push.html.haml index de5634d3c55..a634365ff3e 100644 --- a/app/views/events/_event_last_push.html.haml +++ b/app/views/events/_event_last_push.html.haml @@ -9,6 +9,9 @@ = time_ago_in_words(event.created_at) ago. .pull-right - = link_to new_mr_path_from_push_event(event), title: "New Merge Request", class: "btn btn-create btn-small" do + = link_to new_mr_path_from_push_event(event), title: "New Merge Request", class: "btn btn-new-mr" do Create Merge Request + - if !event.project.nil? && event.project.forked? + = link_to new_mr_path_for_fork_from_push_event(event), title: "New Merge Request", class: "btn btn-create btn-small" do + Create Merge Request on fork %hr diff --git a/app/views/notify/closed_merge_request_email.html.haml b/app/views/notify/closed_merge_request_email.html.haml index 0c6c79e097a..c6b45b1710a 100644 --- a/app/views/notify/closed_merge_request_email.html.haml +++ b/app/views/notify/closed_merge_request_email.html.haml @@ -1,9 +1,9 @@ %p = "Merge Request #{@merge_request.id} was closed by #{@updated_by.name}" %p - = link_to_gfm truncate(@merge_request.title, length: 40), project_merge_request_url(@merge_request.project, @merge_request) + = link_to_gfm truncate(@merge_request.title, length: 40), project_merge_request_url(@merge_request.target_project, @merge_request) %p - Branches: #{@merge_request.source_branch} → #{@merge_request.target_branch} + != merge_path_description(@merge_request, '→') %p Assignee: #{@merge_request.author_name} → #{@merge_request.assignee_name} diff --git a/app/views/notify/closed_merge_request_email.text.haml b/app/views/notify/closed_merge_request_email.text.haml index ee4648e3d09..9a5bce5915a 100644 --- a/app/views/notify/closed_merge_request_email.text.haml +++ b/app/views/notify/closed_merge_request_email.text.haml @@ -1,8 +1,8 @@ = "Merge Request #{@merge_request.id} was closed by #{@updated_by.name}" -Merge Request url: #{project_merge_request_url(@merge_request.project, @merge_request)} +Merge Request url: #{project_merge_request_url(@merge_request.target_project, @merge_request)} -Branches: #{@merge_request.source_branch} - #{@merge_request.target_branch} += merge_path_description(@merge_request, 'to') Author: #{@merge_request.author_name} Assignee: #{@merge_request.assignee_name} diff --git a/app/views/notify/merged_merge_request_email.html.haml b/app/views/notify/merged_merge_request_email.html.haml index 2b8cc030b23..e3ae41819f8 100644 --- a/app/views/notify/merged_merge_request_email.html.haml +++ b/app/views/notify/merged_merge_request_email.html.haml @@ -1,9 +1,9 @@ %p = "Merge Request #{@merge_request.id} was merged" %p - = link_to_gfm truncate(@merge_request.title, length: 40), project_merge_request_url(@merge_request.project, @merge_request) + = link_to_gfm truncate(@merge_request.title, length: 40), project_merge_request_url(@merge_request.target_project, @merge_request) %p - Branches: #{@merge_request.source_branch} → #{@merge_request.target_branch} + != merge_path_description(@merge_request, '→') %p Assignee: #{@merge_request.author_name} → #{@merge_request.assignee_name} diff --git a/app/views/notify/merged_merge_request_email.text.haml b/app/views/notify/merged_merge_request_email.text.haml index 91c23360195..fa9ef0a4b32 100644 --- a/app/views/notify/merged_merge_request_email.text.haml +++ b/app/views/notify/merged_merge_request_email.text.haml @@ -1,8 +1,8 @@ = "Merge Request #{@merge_request.id} was merged" -Merge Request Url: #{project_merge_request_url(@merge_request.project, @merge_request)} +Merge Request Url: #{project_merge_request_url(@merge_request.target_project, @merge_request)} -Branches: #{@merge_request.source_branch} - #{@merge_request.target_branch} += merge_path_description(@merge_request, 'to') Author: #{@merge_request.author_name} Assignee: #{@merge_request.assignee_name} diff --git a/app/views/notify/new_merge_request_email.html.haml b/app/views/notify/new_merge_request_email.html.haml index 0f1cfff5831..3b060001e6b 100644 --- a/app/views/notify/new_merge_request_email.html.haml +++ b/app/views/notify/new_merge_request_email.html.haml @@ -1,9 +1,9 @@ %p = "New Merge Request !#{@merge_request.id}" %p - = link_to_gfm truncate(@merge_request.title, length: 40), project_merge_request_url(@merge_request.project, @merge_request) + = link_to_gfm truncate(@merge_request.title, length: 40), project_merge_request_url(@merge_request.target_project, @merge_request) %p - Branches: #{@merge_request.source_branch} → #{@merge_request.target_branch} + != merge_path_description(@merge_request, '→') %p Assignee: #{@merge_request.author_name} → #{@merge_request.assignee_name} diff --git a/app/views/notify/new_merge_request_email.text.erb b/app/views/notify/new_merge_request_email.text.erb index 3393d8384f1..3f711840a51 100644 --- a/app/views/notify/new_merge_request_email.text.erb +++ b/app/views/notify/new_merge_request_email.text.erb @@ -1,9 +1,8 @@ New Merge Request <%= @merge_request.id %> -<%= url_for(project_merge_request_url(@merge_request.project, @merge_request)) %> - +<%= url_for(project_merge_request_url(@merge_request.target_project, @merge_request)) %> -Branches: <%= @merge_request.source_branch %> to <%= @merge_request.target_branch %> +<%= merge_path_description(@merge_request, 'to') %> Author: <%= @merge_request.author_name %> Asignee: <%= @merge_request.assignee_name %> diff --git a/app/views/notify/note_merge_request_email.html.haml b/app/views/notify/note_merge_request_email.html.haml index 4f97867e49d..14abcca6070 100644 --- a/app/views/notify/note_merge_request_email.html.haml +++ b/app/views/notify/note_merge_request_email.html.haml @@ -1,8 +1,8 @@ %p - if @note.for_diff_line? - = link_to "New comment on diff", diffs_project_merge_request_url(@merge_request.project, @merge_request, anchor: "note_#{@note.id}") + = link_to "New comment on diff", diffs_project_merge_request_url(@merge_request.target_project, @merge_request, anchor: "note_#{@note.id}") - else - = link_to "New comment", project_merge_request_url(@merge_request.project, @merge_request, anchor: "note_#{@note.id}") + = link_to "New comment", project_merge_request_url(@merge_request.target_project, @merge_request, anchor: "note_#{@note.id}") for Merge Request ##{@merge_request.id} %cite "#{truncate(@merge_request.title, length: 20)}" = render 'note_message' diff --git a/app/views/notify/note_merge_request_email.text.erb b/app/views/notify/note_merge_request_email.text.erb index 26c73bdaa38..3daa091db81 100644 --- a/app/views/notify/note_merge_request_email.text.erb +++ b/app/views/notify/note_merge_request_email.text.erb @@ -1,6 +1,6 @@ New comment for Merge Request <%= @merge_request.id %> -<%= url_for(project_merge_request_url(@merge_request.project, @merge_request, anchor: "note_#{@note.id}")) %> +<%= url_for(project_merge_request_url(@merge_request.target_project, @merge_request, anchor: "note_#{@note.id}")) %> <%= @note.author_name %> diff --git a/app/views/notify/reassigned_merge_request_email.html.haml b/app/views/notify/reassigned_merge_request_email.html.haml index 5ad72764e38..314b2882672 100644 --- a/app/views/notify/reassigned_merge_request_email.html.haml +++ b/app/views/notify/reassigned_merge_request_email.html.haml @@ -1,6 +1,6 @@ %p = "Reassigned Merge Request !#{@merge_request.id}" - = link_to_gfm truncate(@merge_request.title, length: 30), project_merge_request_url(@merge_request.project, @merge_request) + = link_to_gfm truncate(@merge_request.title, length: 30), project_merge_request_url(@merge_request.target_project, @merge_request) %p Assignee changed - if @previous_assignee diff --git a/app/views/notify/reassigned_merge_request_email.text.erb b/app/views/notify/reassigned_merge_request_email.text.erb index 25b2a43fcdd..05a9797165d 100644 --- a/app/views/notify/reassigned_merge_request_email.text.erb +++ b/app/views/notify/reassigned_merge_request_email.text.erb @@ -1,6 +1,6 @@ Reassigned Merge Request <%= @merge_request.id %> -<%= url_for(project_merge_request_url(@merge_request.project, @merge_request)) %> +<%= url_for(project_merge_request_url(@merge_request.target_project, @merge_request)) %> Assignee changed <%= "from #{@previous_assignee.name}" if @previous_assignee %> to <%= @merge_request.assignee_name %> diff --git a/app/views/projects/commit/show.html.haml b/app/views/projects/commit/show.html.haml index 38c98d81b5c..da1b4c10f87 100644 --- a/app/views/projects/commit/show.html.haml +++ b/app/views/projects/commit/show.html.haml @@ -1,3 +1,3 @@ = render "commit_box" -= render "projects/commits/diffs", diffs: @commit.diffs += render "projects/commits/diffs", diffs: @commit.diffs, project: @project = render "projects/notes/notes_with_form" diff --git a/app/views/projects/commits/_commit.html.haml b/app/views/projects/commits/_commit.html.haml index eba6c206c46..eb5bdb886e2 100644 --- a/app/views/projects/commits/_commit.html.haml +++ b/app/views/projects/commits/_commit.html.haml @@ -1,12 +1,12 @@ %li.commit .browse_code_link_holder %p - %strong= link_to "Browse Code »", project_tree_path(@project, commit), class: "right" + %strong= link_to "Browse Code »", project_tree_path(project, commit), class: "right" %p - = link_to commit.short_id(8), project_commit_path(@project, commit), class: "commit_short_id" + = link_to commit.short_id(8), project_commit_path(project, commit), class: "commit_short_id" = commit_author_link(commit, avatar: true, size: 24) - = link_to_gfm truncate(commit.title, length: 70), project_commit_path(@project, commit.id), class: "row_title" + = link_to_gfm truncate(commit.title, length: 70), project_commit_path(project, commit.id), class: "row_title" %time.committed_ago{ datetime: commit.committed_date, title: commit.committed_date.stamp("Aug 21, 2011 9:23pm") } = time_ago_in_words(commit.committed_date) @@ -14,7 +14,7 @@ %span.notes_count - - notes = @project.notes.for_commit_id(commit.id) + - notes = project.notes.for_commit_id(commit.id) - if notes.any? %span.badge.badge-info %i.icon-comment diff --git a/app/views/projects/commits/_commits.html.haml b/app/views/projects/commits/_commits.html.haml index acdb8891344..243299d028c 100644 --- a/app/views/projects/commits/_commits.html.haml +++ b/app/views/projects/commits/_commits.html.haml @@ -3,7 +3,6 @@ .title %i.icon-calendar %span= day.stamp("28 Aug, 2010") - .pull-right %small= pluralize(commits.count, 'commit') - %ul.well-list= render commits + %ul.well-list= render commits, project: @project diff --git a/app/views/projects/commits/_diffs.html.haml b/app/views/projects/commits/_diffs.html.haml index a60bf75175d..ca025731258 100644 --- a/app/views/projects/commits/_diffs.html.haml +++ b/app/views/projects/commits/_diffs.html.haml @@ -5,7 +5,7 @@ %p To prevent performance issue we rejected diff information. %p But if you still want to see diff - = link_to "click this link", project_commit_path(@project, @commit, force_show_diff: true), class: "underlined_link" + = link_to "click this link", project_commit_path(project, @commit, force_show_diff: true), class: "underlined_link" %p.commit-stat-summary Showing @@ -23,8 +23,8 @@ - unless @suppress_diff - diffs.each_with_index do |diff, i| - next if diff.diff.empty? - - file = Gitlab::Git::Blob.new(@repository, @commit.id, @ref, diff.new_path) - - file = Gitlab::Git::Blob.new(@repository, @commit.parent_id, @ref, diff.old_path) unless file.exists? + - file = Gitlab::Git::Blob.new(project.repository, @commit.id, @ref, diff.new_path) + - file = Gitlab::Git::Blob.new(project.repository, @commit.parent_id, @ref, diff.old_path) unless file.exists? - next unless file.exists? .file{id: "diff-#{i}"} .header @@ -32,7 +32,7 @@ %span= diff.old_path - if @commit.parent_ids.present? - = link_to project_blob_path(@project, tree_join(@commit.parent_id, diff.new_path)), {:class => 'btn btn-tiny pull-right view-file'} do + = link_to project_blob_path(project, tree_join(@commit.parent_id, diff.new_path)), {:class => 'btn btn-tiny pull-right view-file'} do View file @ %span.commit-short-id= @commit.short_id(6) - else @@ -40,7 +40,7 @@ - if diff.a_mode && diff.b_mode && diff.a_mode != diff.b_mode %span.file-mode= "#{diff.a_mode} → #{diff.b_mode}" - = link_to project_blob_path(@project, tree_join(@commit.id, diff.new_path)), {:class => 'btn btn-tiny pull-right view-file'} do + = link_to project_blob_path(project, tree_join(@commit.id, diff.new_path)), {:class => 'btn btn-tiny pull-right view-file'} do View file @ %span.commit-short-id= @commit.short_id(6) @@ -50,7 +50,7 @@ - if file.text? = render "projects/commits/text_file", diff: diff, index: i - elsif file.image? - - old_file = Gitlab::Git::Blob.new(@repository, @commit.parent_id, @ref, diff.old_path) if @commit.parent_id + - old_file = Gitlab::Git::Blob.new(project.repository, @commit.parent_id, @ref, diff.old_path) if @commit.parent_id = render "projects/commits/image", diff: diff, old_file: old_file, file: file, index: i - else %p.nothing_here_message No preview for this file type diff --git a/app/views/projects/compare/show.html.haml b/app/views/projects/compare/show.html.haml index f2e65f68da6..266c14b358a 100644 --- a/app/views/projects/compare/show.html.haml +++ b/app/views/projects/compare/show.html.haml @@ -15,8 +15,8 @@ %div.ui-box .title Commits (#{@commits.count}) - %ul.well-list= render Commit.decorate(@commits) + %ul.well-list= render Commit.decorate(@commits), project: @project - unless @diffs.empty? %h4 Diff - = render "projects/commits/diffs", diffs: @diffs + = render "projects/commits/diffs", diffs: @diffs, project: @project diff --git a/app/views/projects/merge_requests/_form.html.haml b/app/views/projects/merge_requests/_form.html.haml index 86c442142bf..54697706198 100644 --- a/app/views/projects/merge_requests/_form.html.haml +++ b/app/views/projects/merge_requests/_form.html.haml @@ -12,18 +12,20 @@ .row .span5 .light-well - %h5.cgray From (Head Branch) - = f.select(:source_branch, @repository.branch_names, { include_blank: "Select branch" }, {class: 'chosen span4'}) + %h5.cgray From + .padded= f.select(:source_project_id,[[@merge_request.source_project.path_with_namespace,@merge_request.source_project.id]] , {}, {class: 'source_project chosen span4'}) + .padded= f.select(:source_branch, @merge_request.source_project.repository.branch_names, { include_blank: "Select branch" }, {class: 'source_branch chosen span4'}) .mr_source_commit.prepend-top-10 - .span2 %h1.merge-request-angle %i.icon-angle-right .span5 .light-well - %h5.cgray To (Base Branch) - = f.select(:target_branch, @repository.branch_names, { include_blank: "Select branch" }, {class: 'chosen span4'}) - .mr_target_commit.prepend-top-10 + %h5.cgray To + - projects = @project.forked_from_project.nil? ? [@project] : [ @project,@project.forked_from_project] + .padded= f.select(:target_project_id, projects.map { |proj| [proj.path_with_namespace,proj.id] }, {include_blank: "Select Target Project" }, {class: 'target_project chosen span4'}) + .padded= f.select(:target_branch, @target_branches, { include_blank: "Select branch" }, {class: 'target_branch chosen span4'}) + .mr_target_commit.prepend-top-10 %hr @@ -47,32 +49,34 @@ Milestone .input= f.select(:milestone_id, @project.milestones.active.all.map {|p| [ p.title, p.id ] }, { include_blank: "Select milestone" }, {class: 'chosen'}) - .form-actions - if @merge_request.new_record? = f.submit 'Submit merge request', class: "btn btn-create" -else = f.submit 'Save changes', class: "btn btn-save" - if @merge_request.new_record? - = link_to project_merge_requests_path(@project), class: "btn btn-cancel" do + = link_to project_merge_requests_path(@source_project), class: "btn btn-cancel" do Cancel - else - = link_to project_merge_request_path(@project, @merge_request), class: "btn btn-cancel" do + = link_to project_merge_request_path(@target_project, @merge_request), class: "btn btn-cancel" do Cancel :javascript disableButtonIfEmptyField("#merge_request_title", ".btn-save"); var source_branch = $("#merge_request_source_branch") - , target_branch = $("#merge_request_target_branch"); + , target_branch = $("#merge_request_target_branch") + , target_project = $("#merge_request_target_project_id"); - $.get("#{branch_from_project_merge_requests_path(@project)}", {ref: source_branch.val() }); - $.get("#{branch_to_project_merge_requests_path(@project)}", {ref: target_branch.val() }); + $.get("#{branch_from_project_merge_requests_path(@source_project)}", {ref: source_branch.val() }); + $.get("#{branch_to_project_merge_requests_path(@source_project)}", {target_project_id: target_project.val(),ref: target_branch.val() }); - source_branch.live("change", function() { - $.get("#{branch_from_project_merge_requests_path(@project)}", {ref: $(this).val() }); + target_project.on("change", function() { + $.get("#{update_branches_project_merge_requests_path(@source_project)}", {target_project_id: $(this).val() }); }); - - target_branch.live("change", function() { - $.get("#{branch_to_project_merge_requests_path(@project)}", {ref: $(this).val() }); + source_branch.on("change", function() { + $.get("#{branch_from_project_merge_requests_path(@source_project)}", {ref: $(this).val() }); + }); + target_branch.on("change", function() { + $.get("#{branch_to_project_merge_requests_path(@source_project)}", {target_project_id: target_project.val(),ref: $(this).val() }); }); diff --git a/app/views/projects/merge_requests/_merge_request.html.haml b/app/views/projects/merge_requests/_merge_request.html.haml index ffc6b8fda1e..a10ed02a077 100644 --- a/app/views/projects/merge_requests/_merge_request.html.haml +++ b/app/views/projects/merge_requests/_merge_request.html.haml @@ -1,18 +1,24 @@ %li{ class: mr_css_classes(merge_request) } .merge-request-title %span.light= "##{merge_request.id}" - = link_to_gfm truncate(merge_request.title, length: 80), project_merge_request_path(merge_request.project, merge_request), class: "row_title" + = link_to_gfm truncate(merge_request.title, length: 80), project_merge_request_path(merge_request.target_project, merge_request), class: "row_title" - if merge_request.merged? %small.pull-right %i.icon-ok = "MERGED" - else %span.pull-right - %i.icon-angle-right - = merge_request.target_branch + - if merge_request.for_fork? + = "#{merge_request.source_project.path_with_namespace}/#{merge_request.source_branch}" + %i.icon-angle-right + = "#{merge_request.target_project.path_with_namespace}/#{merge_request.target_branch}" + - else + = "#{merge_request.source_branch}" + %i.icon-angle-right + = "#{merge_request.target_branch}" .merge-request-info - if merge_request.author - authored by #{link_to_member(@project, merge_request.author)} + authored by #{link_to_member(merge_request.source_project, merge_request.author)} - if merge_request.votes_count > 0 = render 'votes/votes_inline', votable: merge_request - if merge_request.notes.any? diff --git a/app/views/projects/merge_requests/branch_from.js.haml b/app/views/projects/merge_requests/branch_from.js.haml index 1d6b10f03ae..d0a148575dc 100644 --- a/app/views/projects/merge_requests/branch_from.js.haml +++ b/app/views/projects/merge_requests/branch_from.js.haml @@ -1,5 +1,5 @@ :plain - $(".mr_source_commit").html("#{commit_to_html(@commit)}"); + $(".mr_source_commit").html("#{commit_to_html(@commit, @source_project)}"); var mrTitle = $('#merge_request_title'); if(mrTitle.is(":empty")) { diff --git a/app/views/projects/merge_requests/branch_to.js.haml b/app/views/projects/merge_requests/branch_to.js.haml index 974100d1ba7..f4e2886ee44 100644 --- a/app/views/projects/merge_requests/branch_to.js.haml +++ b/app/views/projects/merge_requests/branch_to.js.haml @@ -1,2 +1,2 @@ :plain - $(".mr_target_commit").html("#{commit_to_html(@commit)}"); + $(".mr_target_commit").html("#{commit_to_html(@commit, @target_project)}"); diff --git a/app/views/projects/merge_requests/show/_commits.html.haml b/app/views/projects/merge_requests/show/_commits.html.haml index 40876d16ddd..7b0e67053a5 100644 --- a/app/views/projects/merge_requests/show/_commits.html.haml +++ b/app/views/projects/merge_requests/show/_commits.html.haml @@ -7,19 +7,19 @@ - if @commits.count > 8 %ul.first-commits.well-list - @commits.first(8).each do |commit| - = render "projects/commits/commit", commit: commit + = render "projects/commits/commit", commit: commit, project: @merge_request.source_project %li.bottom 8 of #{@commits.count} commits displayed. %strong %a.show-all-commits Click here to show all %ul.all-commits.hide.well-list - @commits.each do |commit| - = render "projects/commits/commit", commit: commit + = render "projects/commits/commit", commit: commit, project: @merge_request.source_project - else %ul.well-list - @commits.each do |commit| - = render "projects/commits/commit", commit: commit + = render "projects/commits/commit", commit: commit, project: @merge_request.source_project - else %h4.nothing_here_message diff --git a/app/views/projects/merge_requests/show/_diffs.html.haml b/app/views/projects/merge_requests/show/_diffs.html.haml index 3c1d14572aa..25f63804858 100644 --- a/app/views/projects/merge_requests/show/_diffs.html.haml +++ b/app/views/projects/merge_requests/show/_diffs.html.haml @@ -1,10 +1,10 @@ - if @merge_request.valid_diffs? - = render "projects/commits/diffs", diffs: @merge_request.diffs + = render "projects/commits/diffs", diffs: @merge_request.diffs, project: @merge_request.source_project - elsif @merge_request.broken_diffs? %h4.nothing_here_message Can't load diff. You can - = link_to "download it", project_merge_request_path(@project, @merge_request, format: :diff), class: "vlink" + = link_to "download it", project_merge_request_path(@merge_request.source_project, @merge_request), format: :diff, class: "vlink" instead. - else %h4.nothing_here_message Nothing to merge diff --git a/app/views/projects/merge_requests/show/_how_to_merge.html.haml b/app/views/projects/merge_requests/show/_how_to_merge.html.haml index 7f1e33418de..a0eb2309585 100644 --- a/app/views/projects/merge_requests/show/_how_to_merge.html.haml +++ b/app/views/projects/merge_requests/show/_how_to_merge.html.haml @@ -3,17 +3,49 @@ %a.close{href: "#"} × %h3 How To Merge .modal-body - %p - %strong Step 1. - Checkout target branch and get recent objects from GitLab - %pre.dark - :preserve - git checkout #{@merge_request.target_branch} - git fetch origin - %p - %strong Step 2. - Merge source branch into target branch and push changes to GitLab - %pre.dark - :preserve - git merge origin/#{@merge_request.source_branch} - git push origin #{@merge_request.target_branch} + - if @merge_request.for_fork? + - source_remote = @merge_request.source_project.namespace.nil? ? "source" :@merge_request.source_project.namespace.path + - target_remote = @merge_request.target_project.namespace.nil? ? "target" :@merge_request.target_project.namespace.path + %p + %strong Step 1. + Checkout target branch and get recent objects from GitLab + Assuming remote for #{@merge_request.target_project.path_with_namespace} is called #{target_remote} + remote for #{@merge_request.source_project.path_with_namespace} is called #{source_remote} + %pre.dark + :preserve + git checkout #{target_remote} #{@merge_request.target_branch} + git fetch #{source_remote} + %p + %strong Step 2. + Merge source branch into target branch and push changes to GitLab + %pre.dark + :preserve + git merge #{source_remote}/#{@merge_request.source_branch} + git push #{target_remote} #{@merge_request.target_branch} + - else + %p + %strong Step 1. + Checkout target branch and get recent objects from GitLab + %pre.dark + :preserve + git checkout #{@merge_request.target_branch} + git fetch origin + %p + %strong Step 2. + Merge source branch into target branch and push changes to GitLab + %pre.dark + :preserve + git merge origin/#{@merge_request.source_branch} + git push origin #{@merge_request.target_branch} + + +:javascript + $(function(){ + var modal = $('#modal_merge_info').modal({modal: true, show:false}); + $('.how_to_merge_link').bind("click", function(){ + modal.show(); + }); + $('.modal-header .close').bind("click", function(){ + modal.hide(); + }) + }) diff --git a/app/views/projects/merge_requests/show/_mr_accept.html.haml b/app/views/projects/merge_requests/show/_mr_accept.html.haml index 01378d99c99..47db8cdc8d2 100644 --- a/app/views/projects/merge_requests/show/_mr_accept.html.haml +++ b/app/views/projects/merge_requests/show/_mr_accept.html.haml @@ -15,7 +15,7 @@ for instructions .accept_group = f.submit "Accept Merge Request", class: "btn btn-create accept_merge_request" - - unless @project.root_ref? @merge_request.source_branch + - unless @merge_request.disallow_source_branch_removal? .remove_branch_holder = label_tag :should_remove_source_branch, class: "checkbox" do = check_box_tag :should_remove_source_branch diff --git a/app/views/projects/merge_requests/show/_mr_title.html.haml b/app/views/projects/merge_requests/show/_mr_title.html.haml index 5a07258f91c..c36ac2ed55b 100644 --- a/app/views/projects/merge_requests/show/_mr_title.html.haml +++ b/app/views/projects/merge_requests/show/_mr_title.html.haml @@ -1,9 +1,16 @@ %h3.page-title = "Merge Request ##{@merge_request.id}:" - %span.label-branch= @merge_request.source_branch - → - %span.label-branch= @merge_request.target_branch + -if @merge_request.for_fork? + %span.label-project= @merge_request.source_project.path_with_namespace + %span.label-branch= @merge_request.source_branch + → + %span.label-project= @merge_request.target_project.path_with_namespace + %span.label-branch= @merge_request.target_branch + - else + %span.label-branch= @merge_request.source_branch + → + %span.label-branch= @merge_request.target_branch %span.pull-right - if can?(current_user, :modify_merge_request, @merge_request) @@ -19,7 +26,7 @@ = link_to 'Close', project_merge_request_path(@project, @merge_request, merge_request: {state_event: :close }), method: :put, class: "btn grouped btn-close", title: "Close merge request" - = link_to edit_project_merge_request_path(@project, @merge_request), class: "btn grouped" do + = link_to edit_project_merge_request_path(@project, @merge_request), class: "btn grouped", id:"edit_merge_request" do %i.icon-edit Edit diff --git a/app/views/projects/merge_requests/update_branches.js.haml b/app/views/projects/merge_requests/update_branches.js.haml new file mode 100644 index 00000000000..db25ae3b918 --- /dev/null +++ b/app/views/projects/merge_requests/update_branches.js.haml @@ -0,0 +1,5 @@ +:plain + $(".target_branch").html("#{escape_javascript(options_for_select(@target_branches))}"); + $(".target_branch").trigger("liszt:updated"); + $(".mr_target_commit").html(""); + $(".target_branch").trigger("change");
\ No newline at end of file diff --git a/app/views/projects/notes/_discussion.html.haml b/app/views/projects/notes/_discussion.html.haml index 14d81bbb5ce..8c79b5ad53e 100644 --- a/app/views/projects/notes/_discussion.html.haml +++ b/app/views/projects/notes/_discussion.html.haml @@ -23,7 +23,7 @@ discussion on this merge request diff - elsif note.for_commit? started a discussion on commit - #{link_to note.noteable.short_id, project_commit_path(@project, note.noteable)} + #{link_to note.noteable.short_id, project_commit_path(note.project, note.noteable)} = link_to_commit_diff_line_note(note) if note.for_diff_line? - else %cite.cgray started a discussion diff --git a/app/views/search/_result.html.haml b/app/views/search/_result.html.haml index 4e56eea084e..59c7738019b 100644 --- a/app/views/search/_result.html.haml +++ b/app/views/search/_result.html.haml @@ -22,11 +22,14 @@ - @merge_requests.each do |merge_request| %li merge request: - = link_to [merge_request.project, merge_request] do + = link_to [merge_request.target_project, merge_request] do %span ##{merge_request.id} %strong.term = truncate merge_request.title, length: 50 - %span.light (#{merge_request.project.name_with_namespace}) + - if merge_request.for_fork? + %span.light (#{merge_request.source_project.name_with_namespace}:#{merge_request.source_branch} → #{merge_request.target_project.name_with_namespace}:#{merge_request.target_branch}) + - else + %span.light (#{merge_request.source_branch} → #{merge_request.target_branch}) - @issues.each do |issue| %li issue: diff --git a/app/views/shared/_merge_requests.html.haml b/app/views/shared/_merge_requests.html.haml index 935a7a7f7c0..5276f4bae31 100644 --- a/app/views/shared/_merge_requests.html.haml +++ b/app/views/shared/_merge_requests.html.haml @@ -1,5 +1,5 @@ - if @merge_requests.any? - - @merge_requests.group_by(&:project).each do |group| + - @merge_requests.group_by(&:target_project).each do |group| .ui-box - project = group[0] .title |