Commit d19d094b authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Remove ugly button and truncate too long project names. Remove unecessary newlines

parent 0d715bcd
......@@ -9,9 +9,6 @@
= 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-new-mr" do
= link_to new_mr_path_from_push_event(event), title: "New Merge Request", class: "btn btn-create btn-small" 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
......@@ -2,10 +2,10 @@
= "Merge Request ##{@merge_request.id}:"
 
-if @merge_request.for_fork?
%span.label-project= @merge_request.source_project.path_with_namespace
%span.label-project= truncate(@merge_request.source_project.path_with_namespace, length: 25)
%span.label-branch= @merge_request.source_branch
→
%span.label-project= @merge_request.target_project.path_with_namespace
%span.label-project= truncate(@merge_request.target_project.path_with_namespace, length: 25)
%span.label-branch= @merge_request.target_branch
- else
%span.label-branch= @merge_request.source_branch
......
class AllowMergesForForks < ActiveRecord::Migration
def self.up
add_column :merge_requests, :target_project_id, :integer, :null => false
MergeRequest.update_all("target_project_id = project_id")
......@@ -10,5 +9,4 @@ class AllowMergesForForks < ActiveRecord::Migration
remove_column :merge_requests, :target_project_id
rename_column :merge_requests, :source_project_id,:project_id
end
end
......@@ -48,14 +48,14 @@ module Gitlab
def diff_in_satellite
in_locked_and_timed_satellite do |merge_repo|
prepare_satellite!(merge_repo)
update_satellite_source_and_target!(merge_repo)
if merge_request.for_fork?
diff = merge_repo.git.native(:diff, default_options, "origin/#{merge_request.target_branch}", "source/#{merge_request.source_branch}")
else
diff = merge_repo.git.native(:diff, default_options, "#{merge_request.target_branch}", "#{merge_request.source_branch}")
end
return diff
end
rescue Grit::Git::CommandFailed => ex
......@@ -88,11 +88,13 @@ module Gitlab
in_locked_and_timed_satellite do |merge_repo|
prepare_satellite!(merge_repo)
update_satellite_source_and_target!(merge_repo)
if (merge_request.for_fork?)
patch = merge_repo.git.format_patch(default_options({stdout: true}), "origin/#{merge_request.target_branch}...source/#{merge_request.source_branch}")
else
patch = merge_repo.git.format_patch(default_options({stdout: true}), "#{merge_request.target_branch}...#{merge_request.source_branch}")
end
return patch
end
rescue Grit::Git::CommandFailed => ex
......
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