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
22e8d36a
Commit
22e8d36a
authored
Jan 13, 2016
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add MergeRequest#must_be_rebased? and use it in mergeable?
parent
a7770f67
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
9 deletions
+6
-9
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+0
-5
app/models/merge_request.rb
app/models/merge_request.rb
+5
-1
app/services/merge_requests/ff_merge_service.rb
app/services/merge_requests/ff_merge_service.rb
+0
-2
app/views/projects/merge_requests/widget/_open.html.haml
app/views/projects/merge_requests/widget/_open.html.haml
+1
-1
No files found.
app/controllers/projects/merge_requests_controller.rb
View file @
22e8d36a
...
...
@@ -179,11 +179,6 @@ class Projects::MergeRequestsController < Projects::ApplicationController
return
end
if
@project
.
ff_merge_must_be_possible?
&&
!
@merge_request
.
ff_merge_possible?
@status
=
:failed
return
end
@merge_request
.
update
(
merge_error:
nil
)
if
params
[
:merge_when_build_succeeds
].
present?
&&
@merge_request
.
ci_commit
&&
@merge_request
.
ci_commit
.
active?
...
...
app/models/merge_request.rb
View file @
22e8d36a
...
...
@@ -255,7 +255,7 @@ class MergeRequest < ActiveRecord::Base
end
def
mergeable?
open
?
&&
!
work_in_progress?
&&
can_be_merged?
open
?
&&
!
work_in_progress?
&&
can_be_merged?
&&
!
must_be_rebased?
end
def
gitlab_merge_status
...
...
@@ -567,6 +567,10 @@ class MergeRequest < ActiveRecord::Base
target_sha
==
source_sha_parent
end
def
must_be_rebased?
self
.
project
.
ff_merge_must_be_possible?
&&
!
ff_merge_possible?
end
def
rebase_dir_path
File
.
join
(
Gitlab
.
config
.
shared
.
path
,
'tmp/rebase'
,
source_project
.
id
.
to_s
,
id
.
to_s
).
to_s
end
...
...
app/services/merge_requests/ff_merge_service.rb
View file @
22e8d36a
...
...
@@ -9,8 +9,6 @@ module MergeRequests
private
def
commit
return
false
unless
@merge_request
.
ff_merge_possible?
repository
.
ff_merge
(
current_user
,
merge_request
.
source_sha
,
merge_request
.
target_branch
)
end
end
...
...
app/views/projects/merge_requests/widget/_open.html.haml
View file @
22e8d36a
...
...
@@ -19,7 +19,7 @@
=
render
'projects/merge_requests/widget/open/merge_when_build_succeeds'
-
elsif
!
@merge_request
.
can_be_merged_by?
(
current_user
)
=
render
'projects/merge_requests/widget/open/not_allowed'
-
elsif
@
project
.
ff_merge_must_be_possible?
&&
!
@merge_request
.
ff_merge_possible
?
-
elsif
@
merge_request
.
must_be_rebased
?
=
render
'projects/merge_requests/widget/open/rebase'
-
else
=
render
'projects/merge_requests/widget/open/accept'
...
...
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