Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
d19d094b
Commit
d19d094b
authored
Jul 30, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove ugly button and truncate too long project names. Remove unecessary newlines
parent
0d715bcd
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
13 deletions
+10
-13
app/views/events/_event_last_push.html.haml
app/views/events/_event_last_push.html.haml
+1
-4
app/views/projects/merge_requests/show/_mr_title.html.haml
app/views/projects/merge_requests/show/_mr_title.html.haml
+2
-2
db/migrate/20130419190306_allow_merges_for_forks.rb
db/migrate/20130419190306_allow_merges_for_forks.rb
+0
-2
db/schema.rb
db/schema.rb
+2
-2
lib/gitlab/satellite/merge_action.rb
lib/gitlab/satellite/merge_action.rb
+5
-3
No files found.
app/views/events/_event_last_push.html.haml
View file @
d19d094b
...
@@ -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
app/views/projects/merge_requests/show/_mr_title.html.haml
View file @
d19d094b
...
@@ -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
...
...
db/migrate/20130419190306_allow_merges_for_forks.rb
View file @
d19d094b
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
db/schema.rb
View file @
d19d094b
...
@@ -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"
...
...
lib/gitlab/satellite/merge_action.rb
View file @
d19d094b
...
@@ -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
}
"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment