Commit 3dd7ad50 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Improve mr compare message when base is different

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent d0fb1835
...@@ -402,12 +402,11 @@ ...@@ -402,12 +402,11 @@
} }
.content-block { .content-block {
border-top: 1px solid $border-color;
padding: $gl-padding-top $gl-padding; padding: $gl-padding-top $gl-padding;
} }
.comments-disabled-notif { .comments-disabled-notif {
border-top: 1px solid $border-color;
.btn { .btn {
margin-left: 5px; margin-left: 5px;
} }
......
...@@ -123,4 +123,8 @@ module MergeRequestsHelper ...@@ -123,4 +123,8 @@ module MergeRequestsHelper
def version_index(merge_request_diff) def version_index(merge_request_diff)
@merge_request_diffs.size - @merge_request_diffs.index(merge_request_diff) @merge_request_diffs.size - @merge_request_diffs.index(merge_request_diff)
end end
def different_base?(version1, version2)
version1 && version2 && version1.base_commit_sha != version2.base_commit_sha
end
end end
...@@ -64,13 +64,16 @@ ...@@ -64,13 +64,16 @@
#{@merge_request.target_branch} (base) #{@merge_request.target_branch} (base)
.monospace #{short_sha(@merge_request_diff.base_commit_sha)} .monospace #{short_sha(@merge_request_diff.base_commit_sha)}
- if @start_version && @start_version.base_commit_sha != @merge_request_diff.base_commit_sha - if different_base?(@start_version, @merge_request_diff)
.content-block .content-block
= icon('info-circle')
Selected versions have different base commits. Selected versions have different base commits.
Changes will include Changes will include
= link_to namespace_project_compare_path(@project.namespace, @project, from: @start_version.base_commit_sha, to: @merge_request_diff.base_commit_sha) do = link_to namespace_project_compare_path(@project.namespace, @project, from: @start_version.base_commit_sha, to: @merge_request_diff.base_commit_sha) do
new commits new commits
from #{@merge_request.target_branch} from
%code #{@merge_request.target_branch}
- unless @merge_request_diff.latest? && !@start_sha - unless @merge_request_diff.latest? && !@start_sha
.comments-disabled-notif.content-block .comments-disabled-notif.content-block
= icon('info-circle') = icon('info-circle')
......
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