mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-30 17:30:59 +01:00
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
This commit is contained in:
parent
d75d0acba5
commit
a588955bf7
3 changed files with 3 additions and 10 deletions
|
@ -55,6 +55,7 @@ final class ConduitAPI_releephwork_getbranchcommitmessage_Method
|
||||||
|
|
||||||
// Not as customizable as a ReleephRequest's commit message. It doesn't
|
// Not as customizable as a ReleephRequest's commit message. It doesn't
|
||||||
// really need to be.
|
// really need to be.
|
||||||
|
// TODO: Yes it does, see FB-specific stuff below.
|
||||||
$commit_message = array();
|
$commit_message = array();
|
||||||
$commit_message[] = $h_branch->getFullName();
|
$commit_message[] = $h_branch->getFullName();
|
||||||
$commit_message[] = $h_branch->getURI();
|
$commit_message[] = $h_branch->getURI();
|
||||||
|
@ -84,7 +85,7 @@ final class ConduitAPI_releephwork_getbranchcommitmessage_Method
|
||||||
* @new-branch: <branch-name>
|
* @new-branch: <branch-name>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
$repo = $project->loadPhabricatorRepository();
|
$repo = $project->getRepository();
|
||||||
switch ($repo->getVersionControlSystem()) {
|
switch ($repo->getVersionControlSystem()) {
|
||||||
case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:
|
case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:
|
||||||
$commit_message[] = sprintf(
|
$commit_message[] = sprintf(
|
||||||
|
|
|
@ -252,7 +252,7 @@ final class ReleephRequestEditController extends ReleephBranchController {
|
||||||
->setValue($title));
|
->setValue($title));
|
||||||
} else {
|
} else {
|
||||||
$origin = $branch->getURI();
|
$origin = $branch->getURI();
|
||||||
$repo = $product->loadPhabricatorRepository();
|
$repo = $product->getRepository();
|
||||||
$branch_cut_point = id(new PhabricatorRepositoryCommit())
|
$branch_cut_point = id(new PhabricatorRepositoryCommit())
|
||||||
->loadOneWhere(
|
->loadOneWhere(
|
||||||
'phid = %s',
|
'phid = %s',
|
||||||
|
|
|
@ -95,14 +95,6 @@ final class ReleephProject extends ReleephDAO
|
||||||
return $this->assertAttached($this->repository);
|
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() {
|
public function getReleephFieldSelector() {
|
||||||
return new ReleephDefaultFieldSelector();
|
return new ReleephDefaultFieldSelector();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue