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
0
Merge Requests
0
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
Kazuhiko Shiozaki
gitlab-ce
Commits
63b23470
Commit
63b23470
authored
Nov 02, 2015
by
Zeger-Jan van de Weg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MRs author can cancel automatic merge
parent
77f8a1e3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+3
-1
app/views/projects/merge_requests/widget/open/_merge_when_build_succeeds.html.haml
...requests/widget/open/_merge_when_build_succeeds.html.haml
+2
-2
No files found.
app/controllers/projects/merge_requests_controller.rb
View file @
63b23470
...
@@ -150,7 +150,9 @@ class Projects::MergeRequestsController < Projects::ApplicationController
...
@@ -150,7 +150,9 @@ class Projects::MergeRequestsController < Projects::ApplicationController
end
end
def
cancel_merge_when_build_succeeds
def
cancel_merge_when_build_succeeds
return
access_denied!
unless
@merge_request
.
can_be_merged_by?
(
current_user
)
unless
@merge_request
.
can_be_merged_by?
(
current_user
)
||
@merge_request
.
author
==
current_user
return
access_denied!
end
if
@merge_request
.
merge_when_build_succeeds?
if
@merge_request
.
merge_when_build_succeeds?
@merge_request
.
reset_merge_when_build_succeeds
@merge_request
.
reset_merge_when_build_succeeds
...
...
app/views/projects/merge_requests/widget/open/_merge_when_build_succeeds.html.haml
View file @
63b23470
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
=
succeed
'.'
do
=
succeed
'.'
do
The changes will be merged into
The changes will be merged into
%span
.label-branch
=
@merge_request
.
target_branch
%span
.label-branch
=
@merge_request
.
target_branch
The source branch w
ill no
t be removed.
The source branch w
on'
t be removed.
-
if
remove_source_branch_button
||
@merge_request
.
can_be_merged_by?
(
current_user
)
-
if
remove_source_branch_button
||
@merge_request
.
can_be_merged_by?
(
current_user
)
.clearfix.prepend-top-10
.clearfix.prepend-top-10
...
@@ -22,6 +22,6 @@
...
@@ -22,6 +22,6 @@
=
link_to
merge_namespace_project_merge_request_path
(
@merge_request
.
source_project
.
namespace
,
@merge_request
.
source_project
,
@merge_request
,
merge_when_build_succeeds:
true
,
should_remove_source_branch:
true
),
remote:
true
,
method: :post
,
class:
"btn btn-grouped btn-primary btn-sm remove_source_branch"
do
=
link_to
merge_namespace_project_merge_request_path
(
@merge_request
.
source_project
.
namespace
,
@merge_request
.
source_project
,
@merge_request
,
merge_when_build_succeeds:
true
,
should_remove_source_branch:
true
),
remote:
true
,
method: :post
,
class:
"btn btn-grouped btn-primary btn-sm remove_source_branch"
do
=
icon
(
'times'
)
=
icon
(
'times'
)
Remove Source Branch When Merged
Remove Source Branch When Merged
-
if
@merge_request
.
can_be_merged_by?
(
current_user
)
-
if
@merge_request
.
can_be_merged_by?
(
current_user
)
||
@merge_request
.
author
==
current_user
=
link_to
merge_namespace_project_merge_request_path
(
@merge_request
.
source_project
.
namespace
,
@merge_request
.
source_project
,
@merge_request
),
remote:
true
,
method: :delete
,
class:
"btn btn-grouped btn-warning btn-sm"
do
=
link_to
merge_namespace_project_merge_request_path
(
@merge_request
.
source_project
.
namespace
,
@merge_request
.
source_project
,
@merge_request
),
remote:
true
,
method: :delete
,
class:
"btn btn-grouped btn-warning btn-sm"
do
Cancel Automatic Merge
Cancel Automatic Merge
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