From 73d935efe3f2a2dc22477cbd224869f2f238ea0f Mon Sep 17 00:00:00 2001 From: nazoking Date: Fri, 1 Jan 2016 14:13:40 +0900 Subject: [PATCH] fix typo --- .../RepositorySettingsController.scala | 2 +- .../core/model/ProtectedBranch.scala | 4 +- .../service/ProtectedBrancheService.scala | 4 +- .../core/service/RepositoryService.scala | 42 +++++++++---------- ...scala.html => branchprotection.scala.html} | 0 5 files changed, 26 insertions(+), 26 deletions(-) rename src/main/twirl/gitbucket/core/settings/{brancheprotection.scala.html => branchprotection.scala.html} (100%) diff --git a/src/main/scala/gitbucket/core/controller/RepositorySettingsController.scala b/src/main/scala/gitbucket/core/controller/RepositorySettingsController.scala index d2af0680e..1db2f5d03 100644 --- a/src/main/scala/gitbucket/core/controller/RepositorySettingsController.scala +++ b/src/main/scala/gitbucket/core/controller/RepositorySettingsController.scala @@ -137,7 +137,7 @@ trait RepositorySettingsControllerBase extends ControllerBase { val protection = ApiBranchProtection(getProtectedBranchInfo(repository.owner, repository.name, branch)) val lastWeeks = getRecentStatuesContexts(repository.owner, repository.name, org.joda.time.LocalDateTime.now.minusWeeks(1).toDate).toSet val knownContexts = (lastWeeks ++ protection.status.contexts).toSeq.sortBy(identity) - html.brancheprotection(repository, branch, protection, knownContexts, flash.get("info")) + html.branchprotection(repository, branch, protection, knownContexts, flash.get("info")) } }); diff --git a/src/main/scala/gitbucket/core/model/ProtectedBranch.scala b/src/main/scala/gitbucket/core/model/ProtectedBranch.scala index dcc26c43d..4700a0430 100644 --- a/src/main/scala/gitbucket/core/model/ProtectedBranch.scala +++ b/src/main/scala/gitbucket/core/model/ProtectedBranch.scala @@ -15,8 +15,8 @@ trait ProtectedBranchComponent extends TemplateComponent { self: Profile => def byPrimaryKey(userName: Column[String], repositoryName: Column[String], branch: Column[String]) = byBranch(userName, repositoryName, branch) } - lazy val ProtectedBrancheContexts = TableQuery[ProtectedBrancheContexts] - class ProtectedBrancheContexts(tag: Tag) extends Table[ProtectedBranchContext](tag, "PROTECTED_BRANCH_REQUIRE_CONTEXT") with BranchTemplate { + lazy val ProtectedBranchContexts = TableQuery[ProtectedBranchContexts] + class ProtectedBranchContexts(tag: Tag) extends Table[ProtectedBranchContext](tag, "PROTECTED_BRANCH_REQUIRE_CONTEXT") with BranchTemplate { val context = column[String]("CONTEXT") def * = (userName, repositoryName, branch, context) <> (ProtectedBranchContext.tupled, ProtectedBranchContext.unapply) } diff --git a/src/main/scala/gitbucket/core/service/ProtectedBrancheService.scala b/src/main/scala/gitbucket/core/service/ProtectedBrancheService.scala index 40f398ec0..c9518b188 100644 --- a/src/main/scala/gitbucket/core/service/ProtectedBrancheService.scala +++ b/src/main/scala/gitbucket/core/service/ProtectedBrancheService.scala @@ -14,7 +14,7 @@ trait ProtectedBrancheService { import ProtectedBrancheService._ private def getProtectedBranchInfoOpt(owner: String, repository: String, branch: String)(implicit session: Session): Option[ProtectedBranchInfo] = ProtectedBranches - .leftJoin(ProtectedBrancheContexts) + .leftJoin(ProtectedBranchContexts) .on{ case (pb, c) => pb.byBranch(c.userName, c.repositoryName, c.branch) } .map{ case (pb, c) => pb -> c.context.? } .filter(_._1.byPrimaryKey(owner, repository, branch)) @@ -38,7 +38,7 @@ trait ProtectedBrancheService { disableBranchProtection(owner, repository, branch) ProtectedBranches.insert(new ProtectedBranch(owner, repository, branch, includeAdministrators)) contexts.map{ context => - ProtectedBrancheContexts.insert(new ProtectedBranchContext(owner, repository, branch, context)) + ProtectedBranchContexts.insert(new ProtectedBranchContext(owner, repository, branch, context)) } } diff --git a/src/main/scala/gitbucket/core/service/RepositoryService.scala b/src/main/scala/gitbucket/core/service/RepositoryService.scala index fd2549cce..8e74642b3 100644 --- a/src/main/scala/gitbucket/core/service/RepositoryService.scala +++ b/src/main/scala/gitbucket/core/service/RepositoryService.scala @@ -46,20 +46,20 @@ trait RepositoryService { self: AccountService => (Repositories filter { t => t.byRepository(oldUserName, oldRepositoryName) } firstOption).map { repository => Repositories insert repository.copy(userName = newUserName, repositoryName = newRepositoryName) - val webHooks = WebHooks .filter(_.byRepository(oldUserName, oldRepositoryName)).list - val webHookEvents = WebHookEvents .filter(_.byRepository(oldUserName, oldRepositoryName)).list - val milestones = Milestones .filter(_.byRepository(oldUserName, oldRepositoryName)).list - val issueId = IssueId .filter(_.byRepository(oldUserName, oldRepositoryName)).list - val issues = Issues .filter(_.byRepository(oldUserName, oldRepositoryName)).list - val pullRequests = PullRequests .filter(_.byRepository(oldUserName, oldRepositoryName)).list - val labels = Labels .filter(_.byRepository(oldUserName, oldRepositoryName)).list - val issueComments = IssueComments .filter(_.byRepository(oldUserName, oldRepositoryName)).list - val issueLabels = IssueLabels .filter(_.byRepository(oldUserName, oldRepositoryName)).list - val commitComments = CommitComments .filter(_.byRepository(oldUserName, oldRepositoryName)).list - val commitStatuses = CommitStatuses .filter(_.byRepository(oldUserName, oldRepositoryName)).list - val collaborators = Collaborators .filter(_.byRepository(oldUserName, oldRepositoryName)).list - val protectedBranches = ProtectedBranches .filter(_.byRepository(oldUserName, oldRepositoryName)).list - val protectedBrancheContexts = ProtectedBrancheContexts .filter(_.byRepository(oldUserName, oldRepositoryName)).list + val webHooks = WebHooks .filter(_.byRepository(oldUserName, oldRepositoryName)).list + val webHookEvents = WebHookEvents .filter(_.byRepository(oldUserName, oldRepositoryName)).list + val milestones = Milestones .filter(_.byRepository(oldUserName, oldRepositoryName)).list + val issueId = IssueId .filter(_.byRepository(oldUserName, oldRepositoryName)).list + val issues = Issues .filter(_.byRepository(oldUserName, oldRepositoryName)).list + val pullRequests = PullRequests .filter(_.byRepository(oldUserName, oldRepositoryName)).list + val labels = Labels .filter(_.byRepository(oldUserName, oldRepositoryName)).list + val issueComments = IssueComments .filter(_.byRepository(oldUserName, oldRepositoryName)).list + val issueLabels = IssueLabels .filter(_.byRepository(oldUserName, oldRepositoryName)).list + val commitComments = CommitComments .filter(_.byRepository(oldUserName, oldRepositoryName)).list + val commitStatuses = CommitStatuses .filter(_.byRepository(oldUserName, oldRepositoryName)).list + val collaborators = Collaborators .filter(_.byRepository(oldUserName, oldRepositoryName)).list + val protectedBranches = ProtectedBranches .filter(_.byRepository(oldUserName, oldRepositoryName)).list + val protectedBranchContexts = ProtectedBranchContexts.filter(_.byRepository(oldUserName, oldRepositoryName)).list Repositories.filter { t => (t.originUserName === oldUserName.bind) && (t.originRepositoryName === oldRepositoryName.bind) @@ -92,13 +92,13 @@ trait RepositoryService { self: AccountService => } )} :_*) - PullRequests .insertAll(pullRequests .map(_.copy(userName = newUserName, repositoryName = newRepositoryName)) :_*) - IssueComments .insertAll(issueComments .map(_.copy(userName = newUserName, repositoryName = newRepositoryName)) :_*) - Labels .insertAll(labels .map(_.copy(userName = newUserName, repositoryName = newRepositoryName)) :_*) - CommitComments .insertAll(commitComments.map(_.copy(userName = newUserName, repositoryName = newRepositoryName)) :_*) - CommitStatuses .insertAll(commitStatuses.map(_.copy(userName = newUserName, repositoryName = newRepositoryName)) :_*) - ProtectedBranches .insertAll(protectedBranches.map(_.copy(userName = newUserName, repositoryName = newRepositoryName)) :_*) - ProtectedBrancheContexts.insertAll(protectedBrancheContexts.map(_.copy(userName = newUserName, repositoryName = newRepositoryName)) :_*) + PullRequests .insertAll(pullRequests .map(_.copy(userName = newUserName, repositoryName = newRepositoryName)) :_*) + IssueComments .insertAll(issueComments .map(_.copy(userName = newUserName, repositoryName = newRepositoryName)) :_*) + Labels .insertAll(labels .map(_.copy(userName = newUserName, repositoryName = newRepositoryName)) :_*) + CommitComments .insertAll(commitComments.map(_.copy(userName = newUserName, repositoryName = newRepositoryName)) :_*) + CommitStatuses .insertAll(commitStatuses.map(_.copy(userName = newUserName, repositoryName = newRepositoryName)) :_*) + ProtectedBranches .insertAll(protectedBranches.map(_.copy(userName = newUserName, repositoryName = newRepositoryName)) :_*) + ProtectedBranchContexts.insertAll(protectedBranchContexts.map(_.copy(userName = newUserName, repositoryName = newRepositoryName)) :_*) // Update source repository of pull requests PullRequests.filter { t => diff --git a/src/main/twirl/gitbucket/core/settings/brancheprotection.scala.html b/src/main/twirl/gitbucket/core/settings/branchprotection.scala.html similarity index 100% rename from src/main/twirl/gitbucket/core/settings/brancheprotection.scala.html rename to src/main/twirl/gitbucket/core/settings/branchprotection.scala.html