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
Léo-Paul Géneau
gitlab-ce
Commits
5880d7df
Commit
5880d7df
authored
May 12, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Docs for merge api
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
0c73e666
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
0 deletions
+49
-0
doc/api/merge_requests.md
doc/api/merge_requests.md
+48
-0
lib/api/merge_requests.rb
lib/api/merge_requests.rb
+1
-0
No files found.
doc/api/merge_requests.md
View file @
5880d7df
...
@@ -189,6 +189,54 @@ Parameters:
...
@@ -189,6 +189,54 @@ Parameters:
```
```
## Accept MR
Merge changes submitted with MR usign this API.
If merge success you get 200 OK.
If it has some conflicts and can not be merged - you get 405 and error message 'Branch cannot be merged'
If merge request is already merged or closed - you get 405 and error message 'Method Not Allowed'
If you dont have permissions to accept this merge request - you get 401
```
PUT /projects/:id/merge_request/:merge_request_id/merge
```
Parameters:
+
`id`
(required) - The ID of a project
+
`merge_request_id`
(required) - ID of MR
+
`merge_commit_message`
(optional) - Custom merge commit message
```
json
{
"id"
:
1
,
"target_branch"
:
"master"
,
"source_branch"
:
"test1"
,
"project_id"
:
3
,
"title"
:
"test1"
,
"state"
:
"merged"
,
"upvotes"
:
0
,
"downvotes"
:
0
,
"author"
:
{
"id"
:
1
,
"username"
:
"admin"
,
"email"
:
"admin@local.host"
,
"name"
:
"Administrator"
,
"state"
:
"active"
,
"created_at"
:
"2012-04-29T08:46:00Z"
},
"assignee"
:
{
"id"
:
1
,
"username"
:
"admin"
,
"email"
:
"admin@local.host"
,
"name"
:
"Administrator"
,
"state"
:
"active"
,
"created_at"
:
"2012-04-29T08:46:00Z"
}
}
```
## Post comment to MR
## Post comment to MR
Adds a comment to a merge request.
Adds a comment to a merge request.
...
...
lib/api/merge_requests.rb
View file @
5880d7df
...
@@ -137,6 +137,7 @@ module API
...
@@ -137,6 +137,7 @@ module API
if
merge_request
.
open?
if
merge_request
.
open?
if
merge_request
.
can_be_merged?
if
merge_request
.
can_be_merged?
merge_request
.
automerge!
(
current_user
,
params
[
:merge_commit_message
]
||
merge_request
.
merge_commit_message
)
merge_request
.
automerge!
(
current_user
,
params
[
:merge_commit_message
]
||
merge_request
.
merge_commit_message
)
present
merge_request
,
with:
Entities
::
MergeRequest
else
else
render_api_error!
(
'Branch cannot be merged'
,
405
)
render_api_error!
(
'Branch cannot be merged'
,
405
)
end
end
...
...
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