Merge pull request #2067 from riyad/diff-and-patch-for-commits-and-merge-requests
Diff and patch for commits and merge requests
This commit is contained in:
commit
e750efd9fc
14 changed files with 238 additions and 37 deletions
|
@ -1 +0,0 @@
|
|||
<%= @commit.to_patch %>
|
|
@ -5,9 +5,14 @@
|
|||
%span.btn.disabled.grouped
|
||||
%i.icon-comment
|
||||
= @notes_count
|
||||
= link_to project_commit_path(@project, @commit, format: :patch), class: "btn small grouped" do
|
||||
%i.icon-download-alt
|
||||
Get Patch
|
||||
.left.btn-group
|
||||
%a.btn.small.grouped.dropdown-toggle{ data: {toggle: :dropdown} }
|
||||
%i.icon-download-alt
|
||||
Download as
|
||||
%span.caret
|
||||
%ul.dropdown-menu
|
||||
%li= link_to "Email Patches", project_commit_path(@project, @commit, format: :patch)
|
||||
%li= link_to "Plain Diff", project_commit_path(@project, @commit, format: :diff)
|
||||
= link_to project_tree_path(@project, @commit), class: "browse-button primary grouped" do
|
||||
%strong Browse Code »
|
||||
%h3.commit-title.page_title
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
- if @merge_request.valid_diffs?
|
||||
= render "commits/diffs", diffs: @diffs
|
||||
- elsif @merge_request.broken_diffs?
|
||||
%h4.nothing_here_message
|
||||
%h4.nothing_here_message
|
||||
Can't load diff.
|
||||
You can #{link_to "download MR patch", raw_project_merge_request_path(@project, @merge_request), class: "vlink"} instead.
|
||||
You can
|
||||
= link_to "download it", project_merge_request_path(@project, @merge_request), format: :diff, class: "vlink"
|
||||
instead.
|
||||
- else
|
||||
%h4.nothing_here_message Nothing to merge
|
||||
|
|
|
@ -13,9 +13,14 @@
|
|||
= "MERGED"
|
||||
- if can?(current_user, :modify_merge_request, @merge_request)
|
||||
- if @merge_request.open?
|
||||
= link_to raw_project_merge_request_path(@project, @merge_request), class: "btn grouped" do
|
||||
%i.icon-download-alt
|
||||
Get Patch
|
||||
.left.btn-group
|
||||
%a.btn.grouped.dropdown-toggle{ data: {toggle: :dropdown} }
|
||||
%i.icon-download-alt
|
||||
Download as
|
||||
%span.caret
|
||||
%ul.dropdown-menu
|
||||
%li= link_to "Email Patches", project_merge_request_path(@project, @merge_request, format: :patch)
|
||||
%li= link_to "Plain Diff", project_merge_request_path(@project, @merge_request, format: :diff)
|
||||
|
||||
= link_to 'Close', project_merge_request_path(@project, @merge_request, merge_request: {closed: true }, status_only: true), method: :put, class: "btn grouped danger", title: "Close merge request"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue