Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
java-gitlab-api
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
沈俊林
java-gitlab-api
Commits
cc80a463
Commit
cc80a463
authored
Nov 04, 2015
by
Tim Olshansky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #91 from wikiwi/mr-changes
Add method to retrieve merge request changes
parents
9b9a4f27
bbf7dbc2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
GitlabAPI.java
src/main/java/org/gitlab/api/GitlabAPI.java
+13
-0
GitlabMergeRequest.java
src/main/java/org/gitlab/api/models/GitlabMergeRequest.java
+10
-0
No files found.
src/main/java/org/gitlab/api/GitlabAPI.java
View file @
cc80a463
...
...
@@ -660,6 +660,19 @@ public class GitlabAPI {
return
ls
.
get
(
0
);
}
/**
* Return a Merge Request including its changes.
*
* @param projectId The id of the project
* @param mergeRequestId The id of the merge request
* @return the Gitlab Merge Request
* @throws IOException on gitlab api call error
*/
public
GitlabMergeRequest
getMergeRequestChanges
(
Serializable
projectId
,
Integer
mergeRequestId
)
throws
IOException
{
String
tailUrl
=
GitlabProject
.
URL
+
"/"
+
sanitizeProjectId
(
projectId
)
+
"/merge_request/"
+
mergeRequestId
+
"/changes"
;
return
retrieve
().
to
(
tailUrl
,
GitlabMergeRequest
.
class
);
}
public
GitlabMergeRequest
getMergeRequest
(
GitlabProject
project
,
Integer
mergeRequestId
)
throws
IOException
{
String
tailUrl
=
GitlabProject
.
URL
+
"/"
+
project
.
getId
()
+
"/merge_request/"
+
mergeRequestId
;
return
retrieve
().
to
(
tailUrl
,
GitlabMergeRequest
.
class
);
...
...
src/main/java/org/gitlab/api/models/GitlabMergeRequest.java
View file @
cc80a463
package
org
.
gitlab
.
api
.
models
;
import
java.util.Date
;
import
java.util.List
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
...
...
@@ -19,6 +20,7 @@ public class GitlabMergeRequest {
private
GitlabMilestone
milestone
;
private
String
[]
labels
;
private
List
<
GitlabCommitDiff
>
changes
;
private
int
upvotes
;
private
int
downvotes
;
...
...
@@ -224,4 +226,12 @@ public class GitlabMergeRequest {
public
void
setCreatedAt
(
Date
createdAt
)
{
this
.
createdAt
=
createdAt
;
}
public
List
<
GitlabCommitDiff
>
getChanges
()
{
return
changes
;
}
public
void
setChanges
(
List
<
GitlabCommitDiff
>
changes
)
{
this
.
changes
=
changes
;
}
}
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