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
d3c24373
Commit
d3c24373
authored
Dec 03, 2015
by
Rubén Dávila
Committed by
Robert Speicher
Feb 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new endpoint and button to revert merge. #3409
parent
96158aa6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
1 deletion
+8
-1
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+4
-0
app/views/projects/merge_requests/show/_mr_title.html.haml
app/views/projects/merge_requests/show/_mr_title.html.haml
+3
-1
config/routes.rb
config/routes.rb
+1
-0
No files found.
app/controllers/projects/merge_requests_controller.rb
View file @
d3c24373
...
...
@@ -191,6 +191,10 @@ class Projects::MergeRequestsController < Projects::ApplicationController
end
end
def
revert
redirect_to
new_namespace_project_merge_request_url
(
@project
.
namespace
,
@project
)
end
def
branch_from
#This is always source
@source_project
=
@merge_request
.
nil?
?
@project
:
@merge_request
.
source_project
...
...
app/views/projects/merge_requests/show/_mr_title.html.haml
View file @
d3c24373
...
...
@@ -17,4 +17,6 @@
%i
.fa.fa-pencil-square-o
Edit
-
if
@merge_request
.
closed?
=
link_to
'Reopen'
,
merge_request_path
(
@merge_request
,
merge_request:
{
state_event: :reopen
}),
method: :put
,
class:
'btn btn-nr btn-grouped btn-reopen reopen-mr-link'
,
title:
'Reopen merge request'
=
link_to
'Reopen'
,
merge_request_path
(
@merge_request
,
merge_request:
{
state_event: :reopen
}),
method: :put
,
class:
'btn btn-nr btn-grouped btn-reopen reopen-mr-link'
,
title:
"Reopen merge request"
-
if
@merge_request
.
merged?
=
link_to
'Revert'
,
revert_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
method: :post
,
class:
"btn btn-grouped btn-close"
,
title:
"Revert merge request"
config/routes.rb
View file @
d3c24373
...
...
@@ -590,6 +590,7 @@ Rails.application.routes.draw do
post
:cancel_merge_when_build_succeeds
get
:ci_status
post
:toggle_subscription
post
:revert
end
collection
do
...
...
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