(refs #2)Add merge pull request form.

This commit is contained in:
takezoe
2013-07-14 12:49:49 +09:00
parent 6fd312f784
commit 2fb9f83227
6 changed files with 298 additions and 20 deletions

View File

@@ -9,10 +9,20 @@ import model._
//import Q.interpolation
trait PullRequestService {
trait PullRequestService { self: IssuesService =>
def getPullRequest(owner: String, repository: String, issueId: Int): Option[(Issue, PullRequest)] = {
val issue = getIssue(owner, repository, issueId.toString)
if(issue.isDefined){
Query(PullRequests).filter(_.byPrimaryKey(owner, repository, issueId)).firstOption match {
case Some(pullreq) => Some((issue.get, pullreq))
case None => None
}
} else None
}
def createPullRequest(originUserName: String, originRepositoryName: String, issueId: Int,
originBranch: String, requestUserName: String, requestRepositoryName: String, requestCommitId: String): Unit =
originBranch: String, requestUserName: String, requestRepositoryName: String, requestBranch: String): Unit =
PullRequests insert (PullRequest(
originUserName,
originRepositoryName,
@@ -20,6 +30,6 @@ trait PullRequestService {
originBranch,
requestUserName,
requestRepositoryName,
requestCommitId))
requestBranch))
}