From a588955bf79e152d2381c7dd14b7e16bc2bed3c9 Mon Sep 17 00:00:00 2001 From: epriestley Date: Sun, 20 Apr 2014 11:55:09 -0700 Subject: [PATCH] Remove loadPhabricatorRepository from ReleephProject Summary: Ref T3551. Repository is guaranteed if a product is loaded with modern mechanisms. Test Plan: - Edited a request. - Called `releephwork.getbranchcommitmessage`. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T3551 Differential Revision: https://secure.phabricator.com/D8821 --- ...nduitAPI_releephwork_getbranchcommitmessage_Method.php | 3 ++- .../controller/request/ReleephRequestEditController.php | 2 +- src/applications/releeph/storage/ReleephProject.php | 8 -------- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/applications/releeph/conduit/work/ConduitAPI_releephwork_getbranchcommitmessage_Method.php b/src/applications/releeph/conduit/work/ConduitAPI_releephwork_getbranchcommitmessage_Method.php index 9f5c6932c8..a5cc3d8b52 100644 --- a/src/applications/releeph/conduit/work/ConduitAPI_releephwork_getbranchcommitmessage_Method.php +++ b/src/applications/releeph/conduit/work/ConduitAPI_releephwork_getbranchcommitmessage_Method.php @@ -55,6 +55,7 @@ final class ConduitAPI_releephwork_getbranchcommitmessage_Method // Not as customizable as a ReleephRequest's commit message. It doesn't // really need to be. + // TODO: Yes it does, see FB-specific stuff below. $commit_message = array(); $commit_message[] = $h_branch->getFullName(); $commit_message[] = $h_branch->getURI(); @@ -84,7 +85,7 @@ final class ConduitAPI_releephwork_getbranchcommitmessage_Method * @new-branch: * */ - $repo = $project->loadPhabricatorRepository(); + $repo = $project->getRepository(); switch ($repo->getVersionControlSystem()) { case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT: $commit_message[] = sprintf( diff --git a/src/applications/releeph/controller/request/ReleephRequestEditController.php b/src/applications/releeph/controller/request/ReleephRequestEditController.php index e9e78cabbd..3784885a92 100644 --- a/src/applications/releeph/controller/request/ReleephRequestEditController.php +++ b/src/applications/releeph/controller/request/ReleephRequestEditController.php @@ -252,7 +252,7 @@ final class ReleephRequestEditController extends ReleephBranchController { ->setValue($title)); } else { $origin = $branch->getURI(); - $repo = $product->loadPhabricatorRepository(); + $repo = $product->getRepository(); $branch_cut_point = id(new PhabricatorRepositoryCommit()) ->loadOneWhere( 'phid = %s', diff --git a/src/applications/releeph/storage/ReleephProject.php b/src/applications/releeph/storage/ReleephProject.php index d6b520ac89..5735a49b87 100644 --- a/src/applications/releeph/storage/ReleephProject.php +++ b/src/applications/releeph/storage/ReleephProject.php @@ -95,14 +95,6 @@ final class ReleephProject extends ReleephDAO return $this->assertAttached($this->repository); } - // TODO: Remove once everything uses ProjectQuery. Also, T603. - public function loadPhabricatorRepository() { - return $this->loadOneRelative( - new PhabricatorRepository(), - 'phid', - 'getRepositoryPHID'); - } - public function getReleephFieldSelector() { return new ReleephDefaultFieldSelector(); }