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
Tatuya Kamada
gitlab-ce
Commits
d00e5455
Commit
d00e5455
authored
8 years ago
by
Douwe Maan
Committed by
Douwe Maan
8 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Verify the MR being displayed question has a merge commit set and can be cherry-picked
parent
34eacc53
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
7 deletions
+13
-7
app/models/merge_request.rb
app/models/merge_request.rb
+4
-0
app/views/projects/merge_requests/_show.html.haml
app/views/projects/merge_requests/_show.html.haml
+2
-2
app/views/projects/merge_requests/widget/_merged_buttons.haml
...views/projects/merge_requests/widget/_merged_buttons.haml
+7
-5
No files found.
app/models/merge_request.rb
View file @
d00e5455
...
...
@@ -602,4 +602,8 @@ class MergeRequest < ActiveRecord::Base
def
can_be_reverted?
(
current_user
=
nil
)
merge_commit
&&
!
merge_commit
.
has_been_reverted?
(
current_user
,
self
)
end
def
can_be_cherry_picked?
merge_commit
end
end
This diff is collapsed.
Click to expand it.
app/views/projects/merge_requests/_show.html.haml
View file @
d00e5455
...
...
@@ -86,9 +86,9 @@
=
spinner
=
render
'shared/issuable/sidebar'
,
issuable:
@merge_request
-
if
@merge_request
.
can_be_reverted?
-
if
@merge_request
.
can_be_reverted?
(
current_user
)
=
render
"projects/commit/change"
,
type:
'revert'
,
commit:
@merge_request
.
merge_commit
,
title:
@merge_request
.
title
-
if
@merge_request
.
merge_commit
-
if
@merge_request
.
can_be_cherry_picked?
=
render
"projects/commit/change"
,
type:
'cherry-pick'
,
commit:
@merge_request
.
merge_commit
,
title:
@merge_request
.
title
:javascript
...
...
This diff is collapsed.
Click to expand it.
app/views/projects/merge_requests/widget/_merged_buttons.haml
View file @
d00e5455
-
source_branch_exists
=
local_assigns
.
fetch
(
:source_branch_exists
,
false
)
-
mr_can_be_reverted
=
@merge_request
.
can_be_reverted?
-
can_remove_source_branch
=
local_assigns
.
fetch
(
:source_branch_exists
,
false
)
&&
@merge_request
.
can_remove_source_branch?
(
current_user
)
-
mr_can_be_reverted
=
@merge_request
.
can_be_reverted?
(
current_user
)
-
mr_can_be_cherry_picked
=
@merge_request
.
can_be_cherry_picked?
-
if
source_branch_exists
||
mr_can_be_revert
ed
-
if
can_remove_source_branch
||
mr_can_be_reverted
||
mr_can_be_cherry_pick
ed
.btn-group
-
if
source_branch_exists
-
if
can_remove_source_branch
=
link_to
namespace_project_branch_path
(
@merge_request
.
source_project
.
namespace
,
@merge_request
.
source_project
,
@merge_request
.
source_branch
),
remote:
true
,
method: :delete
,
class:
"btn btn-default btn-grouped btn-sm remove_source_branch"
do
=
icon
(
'trash-o'
)
Remove Source Branch
-
if
mr_can_be_reverted
=
revert_commit_link
(
@merge_request
.
merge_commit
,
namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
btn_class:
'sm'
)
=
cherry_pick_commit_link
(
@merge_request
.
merge_commit
,
namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
btn_class:
'sm'
)
-
if
mr_can_be_cherry_picked
=
cherry_pick_commit_link
(
@merge_request
.
merge_commit
,
namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
btn_class:
'sm'
)
This diff is collapsed.
Click to expand it.
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