mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-08 14:35:52 +01:00
(refs #2)Add the details page for the pull request.
This commit is contained in:
@@ -13,11 +13,11 @@ import scala.Some
|
|||||||
import util.JGitUtil.CommitInfo
|
import util.JGitUtil.CommitInfo
|
||||||
|
|
||||||
class PullRequestsController extends PullRequestsControllerBase
|
class PullRequestsController extends PullRequestsControllerBase
|
||||||
with RepositoryService with AccountService with IssuesService with PullRequestService
|
with RepositoryService with AccountService with IssuesService with PullRequestService with MilestonesService
|
||||||
with ReferrerAuthenticator with CollaboratorsAuthenticator
|
with ReferrerAuthenticator with CollaboratorsAuthenticator
|
||||||
|
|
||||||
trait PullRequestsControllerBase extends ControllerBase {
|
trait PullRequestsControllerBase extends ControllerBase {
|
||||||
self: ReferrerAuthenticator with RepositoryService with IssuesService
|
self: ReferrerAuthenticator with RepositoryService with IssuesService with MilestonesService
|
||||||
with PullRequestService with CollaboratorsAuthenticator =>
|
with PullRequestService with CollaboratorsAuthenticator =>
|
||||||
|
|
||||||
val form = mapping(
|
val form = mapping(
|
||||||
@@ -133,6 +133,28 @@ trait PullRequestsControllerBase extends ControllerBase {
|
|||||||
redirect(s"/${repository.owner}/${repository.name}/pulls/${issueId}")
|
redirect(s"/${repository.owner}/${repository.name}/pulls/${issueId}")
|
||||||
})
|
})
|
||||||
|
|
||||||
|
get("/:owner/:repository/pulls/:id")(referrersOnly { repository =>
|
||||||
|
val owner = repository.owner
|
||||||
|
val name = repository.name
|
||||||
|
val issueId = params("id")
|
||||||
|
|
||||||
|
getIssue(owner, name, issueId) map {
|
||||||
|
issues.html.issue(
|
||||||
|
_,
|
||||||
|
getComments(owner, name, issueId.toInt),
|
||||||
|
getIssueLabels(owner, name, issueId.toInt),
|
||||||
|
(getCollaborators(owner, name) :+ owner).sorted,
|
||||||
|
getMilestones(owner, name),
|
||||||
|
Nil,
|
||||||
|
hasWritePermission(owner, name, context.loginAccount),
|
||||||
|
repository)
|
||||||
|
} getOrElse NotFound
|
||||||
|
})
|
||||||
|
|
||||||
|
post("/:owner/:repository/pulls/:id/merge")(collaboratorsOnly { repository =>
|
||||||
|
// TODO Not implemented yet.
|
||||||
|
})
|
||||||
|
|
||||||
private def withGit[T](oldDir: java.io.File, newDir: java.io.File)(action: (Git, Git) => T): T = {
|
private def withGit[T](oldDir: java.io.File, newDir: java.io.File)(action: (Git, Git) => T): T = {
|
||||||
val oldGit = Git.open(oldDir)
|
val oldGit = Git.open(oldDir)
|
||||||
val newGit = Git.open(newDir)
|
val newGit = Git.open(newDir)
|
||||||
|
|||||||
Reference in New Issue
Block a user