2013-09-04 03:33:09 -04:00
|
|
|
- @suppress_diff ||= @suppress_diff || @force_suppress_diff
|
2012-04-05 18:00:15 -04:00
|
|
|
- if @suppress_diff
|
2013-01-30 09:53:18 -05:00
|
|
|
.alert.alert-block
|
2012-06-03 18:37:27 -04:00
|
|
|
%p
|
2013-09-04 03:33:09 -04:00
|
|
|
%strong Warning! This is a large diff.
|
2012-06-03 18:37:27 -04:00
|
|
|
%p
|
2013-09-04 03:33:09 -04:00
|
|
|
To preserve performance the diff is not shown.
|
|
|
|
- if current_controller?(:commit) or current_controller?(:merge_requests)
|
|
|
|
Please, download the diff as
|
|
|
|
- if current_controller?(:commit)
|
|
|
|
= link_to "plain diff", project_commit_path(@project, @commit, format: :diff), class: "underlined_link"
|
|
|
|
or
|
|
|
|
= link_to "email patch", project_commit_path(@project, @commit, format: :patch), class: "underlined_link"
|
|
|
|
- else
|
|
|
|
= link_to "plain diff", project_merge_request_path(@project, @merge_request, format: :diff), class: "underlined_link"
|
|
|
|
or
|
|
|
|
= link_to "email patch", project_merge_request_path(@project, @merge_request, format: :patch), class: "underlined_link"
|
|
|
|
instead.
|
|
|
|
- unless @force_suppress_diff
|
|
|
|
%p
|
|
|
|
If you still want to see the diff
|
|
|
|
= link_to "click this link", url_for(force_show_diff: true), class: "underlined_link"
|
2012-04-05 18:00:15 -04:00
|
|
|
|
2013-07-18 04:49:40 -04:00
|
|
|
%p.commit-stat-summary
|
|
|
|
Showing
|
|
|
|
%strong.cdark #{pluralize(diffs.count, "changed file")}
|
|
|
|
- if current_controller?(:commit)
|
|
|
|
- unless @commit.has_zero_stats?
|
|
|
|
with
|
|
|
|
%strong.cgreen #{@commit.stats.additions} additions
|
|
|
|
and
|
|
|
|
%strong.cred #{@commit.stats.deletions} deletions
|
2012-11-18 11:41:41 -05:00
|
|
|
.file-stats
|
2013-06-23 12:47:22 -04:00
|
|
|
= render "projects/commits/diff_head", diffs: diffs
|
2012-04-05 18:00:15 -04:00
|
|
|
|
2012-12-01 07:49:21 -05:00
|
|
|
.files
|
|
|
|
- unless @suppress_diff
|
|
|
|
- diffs.each_with_index do |diff, i|
|
|
|
|
- next if diff.diff.empty?
|
2013-10-01 13:34:41 -04:00
|
|
|
- file = project.repository.blob_at(@commit.id, diff.new_path)
|
|
|
|
- file = project.repository.blob_at(@commit.parent_id, diff.old_path) unless file
|
2013-10-01 10:00:28 -04:00
|
|
|
- next unless file
|
2012-12-01 07:49:21 -05:00
|
|
|
.file{id: "diff-#{i}"}
|
|
|
|
.header
|
|
|
|
- if diff.deleted_file
|
|
|
|
%span= diff.old_path
|
2012-11-20 16:05:15 -05:00
|
|
|
|
2013-04-02 14:46:19 -04:00
|
|
|
- if @commit.parent_ids.present?
|
2013-06-03 16:20:50 -04:00
|
|
|
= link_to project_blob_path(project, tree_join(@commit.parent_id, diff.new_path)), {:class => 'btn btn-tiny pull-right view-file'} do
|
2012-12-01 07:49:21 -05:00
|
|
|
View file @
|
|
|
|
%span.commit-short-id= @commit.short_id(6)
|
|
|
|
- else
|
|
|
|
%span= diff.new_path
|
|
|
|
- if diff.a_mode && diff.b_mode && diff.a_mode != diff.b_mode
|
|
|
|
%span.file-mode= "#{diff.a_mode} → #{diff.b_mode}"
|
|
|
|
|
2013-06-03 16:20:50 -04:00
|
|
|
= link_to project_blob_path(project, tree_join(@commit.id, diff.new_path)), {:class => 'btn btn-tiny pull-right view-file'} do
|
2012-11-18 11:41:41 -05:00
|
|
|
View file @
|
|
|
|
%span.commit-short-id= @commit.short_id(6)
|
2012-11-20 16:05:15 -05:00
|
|
|
|
2012-12-01 07:49:21 -05:00
|
|
|
.content
|
|
|
|
-# Skipp all non non-supported blobs
|
|
|
|
- next unless file.respond_to?('text?')
|
|
|
|
- if file.text?
|
2013-06-23 12:47:22 -04:00
|
|
|
= render "projects/commits/text_file", diff: diff, index: i
|
2012-12-01 07:49:21 -05:00
|
|
|
- elsif file.image?
|
2013-10-01 13:34:41 -04:00
|
|
|
- old_file = project.repository.blob_at(@commit.parent_id, diff.old_path) if @commit.parent_id
|
2013-06-23 12:47:22 -04:00
|
|
|
= render "projects/commits/image", diff: diff, old_file: old_file, file: file, index: i
|
2012-10-25 05:16:14 -04:00
|
|
|
- else
|
2012-12-01 07:49:21 -05:00
|
|
|
%p.nothing_here_message No preview for this file type
|