diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-07-30 14:12:24 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-07-30 14:12:24 +0300 |
commit | d19d094b935b6b1b773d369893d4f112e91b38a9 (patch) | |
tree | 1ded12ce6bed836952d8f10a9e7cf30be6775838 | |
parent | 0d715bcd812ca6c99884e117f28a400669aa8e57 (diff) | |
download | gitlab-ce-d19d094b935b6b1b773d369893d4f112e91b38a9.tar.gz |
Remove ugly button and truncate too long project names. Remove unecessary newlines
-rw-r--r-- | app/views/events/_event_last_push.html.haml | 5 | ||||
-rw-r--r-- | app/views/projects/merge_requests/show/_mr_title.html.haml | 4 | ||||
-rw-r--r-- | db/migrate/20130419190306_allow_merges_for_forks.rb | 2 | ||||
-rw-r--r-- | db/schema.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/satellite/merge_action.rb | 8 |
5 files changed, 10 insertions, 13 deletions
diff --git a/app/views/events/_event_last_push.html.haml b/app/views/events/_event_last_push.html.haml index a634365ff3e..de5634d3c55 100644 --- a/app/views/events/_event_last_push.html.haml +++ b/app/views/events/_event_last_push.html.haml @@ -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 diff --git a/app/views/projects/merge_requests/show/_mr_title.html.haml b/app/views/projects/merge_requests/show/_mr_title.html.haml index c36ac2ed55b..e7838733af3 100644 --- a/app/views/projects/merge_requests/show/_mr_title.html.haml +++ b/app/views/projects/merge_requests/show/_mr_title.html.haml @@ -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 diff --git a/db/migrate/20130419190306_allow_merges_for_forks.rb b/db/migrate/20130419190306_allow_merges_for_forks.rb index 13135cbafcf..691293a1c3e 100644 --- a/db/migrate/20130419190306_allow_merges_for_forks.rb +++ b/db/migrate/20130419190306_allow_merges_for_forks.rb @@ -1,5 +1,4 @@ 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 diff --git a/db/schema.rb b/db/schema.rb index 10191c6923a..e7940e2f724 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -92,8 +92,8 @@ ActiveRecord::Schema.define(:version => 20130624162710) do t.string "title" t.datetime "created_at" t.datetime "updated_at" - t.text "st_commits", :limit => 2147483647 - t.text "st_diffs", :limit => 2147483647 + t.text "st_commits", :limit => 2147483647 + t.text "st_diffs", :limit => 2147483647 t.integer "milestone_id" t.string "state" t.string "merge_status" diff --git a/lib/gitlab/satellite/merge_action.rb b/lib/gitlab/satellite/merge_action.rb index 6f402e80a63..969bb999936 100644 --- a/lib/gitlab/satellite/merge_action.rb +++ b/lib/gitlab/satellite/merge_action.rb @@ -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 @@ -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 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_fetch('source') repo.git.checkout(default_options({b: true}), merge_request.target_branch, "origin/#{merge_request.target_branch}") |