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 @@ ...@@ -9,9 +9,6 @@
= time_ago_in_words(event.created_at) = time_ago_in_words(event.created_at)
ago. ago.
.pull-right .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 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 %hr
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
= "Merge Request ##{@merge_request.id}:" = "Merge Request ##{@merge_request.id}:"
   
-if @merge_request.for_fork? -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-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 %span.label-branch= @merge_request.target_branch
- else - else
%span.label-branch= @merge_request.source_branch %span.label-branch= @merge_request.source_branch
......
class AllowMergesForForks < ActiveRecord::Migration class AllowMergesForForks < ActiveRecord::Migration
def self.up def self.up
add_column :merge_requests, :target_project_id, :integer, :null => false add_column :merge_requests, :target_project_id, :integer, :null => false
MergeRequest.update_all("target_project_id = project_id") MergeRequest.update_all("target_project_id = project_id")
...@@ -10,5 +9,4 @@ class AllowMergesForForks < ActiveRecord::Migration ...@@ -10,5 +9,4 @@ class AllowMergesForForks < ActiveRecord::Migration
remove_column :merge_requests, :target_project_id remove_column :merge_requests, :target_project_id
rename_column :merge_requests, :source_project_id,:project_id rename_column :merge_requests, :source_project_id,:project_id
end end
end end
...@@ -92,8 +92,8 @@ ActiveRecord::Schema.define(:version => 20130624162710) do ...@@ -92,8 +92,8 @@ ActiveRecord::Schema.define(:version => 20130624162710) do
t.string "title" t.string "title"
t.datetime "created_at" t.datetime "created_at"
t.datetime "updated_at" t.datetime "updated_at"
t.text "st_commits", :limit => 2147483647 t.text "st_commits", :limit => 2147483647
t.text "st_diffs", :limit => 2147483647 t.text "st_diffs", :limit => 2147483647
t.integer "milestone_id" t.integer "milestone_id"
t.string "state" t.string "state"
t.string "merge_status" t.string "merge_status"
......
...@@ -48,14 +48,14 @@ module Gitlab ...@@ -48,14 +48,14 @@ module Gitlab
def diff_in_satellite def diff_in_satellite
in_locked_and_timed_satellite do |merge_repo| in_locked_and_timed_satellite do |merge_repo|
prepare_satellite!(merge_repo) prepare_satellite!(merge_repo)
update_satellite_source_and_target!(merge_repo) update_satellite_source_and_target!(merge_repo)
if merge_request.for_fork? if merge_request.for_fork?
diff = merge_repo.git.native(:diff, default_options, "origin/#{merge_request.target_branch}", "source/#{merge_request.source_branch}") diff = merge_repo.git.native(:diff, default_options, "origin/#{merge_request.target_branch}", "source/#{merge_request.source_branch}")
else else
diff = merge_repo.git.native(:diff, default_options, "#{merge_request.target_branch}", "#{merge_request.source_branch}") diff = merge_repo.git.native(:diff, default_options, "#{merge_request.target_branch}", "#{merge_request.source_branch}")
end end
return diff return diff
end end
rescue Grit::Git::CommandFailed => ex rescue Grit::Git::CommandFailed => ex
...@@ -88,11 +88,13 @@ module Gitlab ...@@ -88,11 +88,13 @@ module Gitlab
in_locked_and_timed_satellite do |merge_repo| in_locked_and_timed_satellite do |merge_repo|
prepare_satellite!(merge_repo) prepare_satellite!(merge_repo)
update_satellite_source_and_target!(merge_repo) update_satellite_source_and_target!(merge_repo)
if (merge_request.for_fork?) 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}") patch = merge_repo.git.format_patch(default_options({stdout: true}), "origin/#{merge_request.target_branch}...source/#{merge_request.source_branch}")
else else
patch = merge_repo.git.format_patch(default_options({stdout: true}), "#{merge_request.target_branch}...#{merge_request.source_branch}") patch = merge_repo.git.format_patch(default_options({stdout: true}), "#{merge_request.target_branch}...#{merge_request.source_branch}")
end end
return patch return patch
end end
rescue Grit::Git::CommandFailed => ex rescue Grit::Git::CommandFailed => ex
...@@ -139,7 +141,7 @@ module Gitlab ...@@ -139,7 +141,7 @@ module Gitlab
# Assumes a satellite exists that is a fresh clone of the projects repo, prepares satellite for merges, diffs etc # Assumes a satellite exists that is a fresh clone of the projects repo, prepares satellite for merges, diffs etc
def update_satellite_source_and_target!(repo) def update_satellite_source_and_target!(repo)
if merge_request.for_fork? if merge_request.for_fork?
repo.remote_add('source', merge_request.source_project.repository.path_to_repo) repo.remote_add('source', merge_request.source_project.repository.path_to_repo)
repo.remote_fetch('source') repo.remote_fetch('source')
repo.git.checkout(default_options({b: true}), merge_request.target_branch, "origin/#{merge_request.target_branch}") repo.git.checkout(default_options({b: true}), merge_request.target_branch, "origin/#{merge_request.target_branch}")
......
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