mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 08:42:41 +01:00
Rename "needReviewerStatus()" into "needReviewers()"
Summary: Ref T10967. The old name was because we had a `getReviewers()` tied to `needRelationships()`, rename this method to use a simpler and more clear name. Test Plan: `grep`, browsed around. Reviewers: chad Reviewed By: chad Maniphest Tasks: T10967 Differential Revision: https://secure.phabricator.com/D17519
This commit is contained in:
parent
d179d0150c
commit
a15df4f8d5
22 changed files with 29 additions and 29 deletions
|
@ -44,7 +44,7 @@ final class DifferentialCloseConduitAPIMethod
|
||||||
$revision = id(new DifferentialRevisionQuery())
|
$revision = id(new DifferentialRevisionQuery())
|
||||||
->withIDs(array($id))
|
->withIDs(array($id))
|
||||||
->setViewer($viewer)
|
->setViewer($viewer)
|
||||||
->needReviewerStatus(true)
|
->needReviewers(true)
|
||||||
->executeOne();
|
->executeOne();
|
||||||
if (!$revision) {
|
if (!$revision) {
|
||||||
throw new ConduitException('ERR_NOT_FOUND');
|
throw new ConduitException('ERR_NOT_FOUND');
|
||||||
|
|
|
@ -47,7 +47,7 @@ final class DifferentialCreateCommentConduitAPIMethod
|
||||||
$revision = id(new DifferentialRevisionQuery())
|
$revision = id(new DifferentialRevisionQuery())
|
||||||
->setViewer($viewer)
|
->setViewer($viewer)
|
||||||
->withIDs(array($request->getValue('revision_id')))
|
->withIDs(array($request->getValue('revision_id')))
|
||||||
->needReviewerStatus(true)
|
->needReviewers(true)
|
||||||
->needReviewerAuthority(true)
|
->needReviewerAuthority(true)
|
||||||
->executeOne();
|
->executeOne();
|
||||||
if (!$revision) {
|
if (!$revision) {
|
||||||
|
|
|
@ -39,7 +39,7 @@ final class DifferentialGetCommitMessageConduitAPIMethod
|
||||||
$revision = id(new DifferentialRevisionQuery())
|
$revision = id(new DifferentialRevisionQuery())
|
||||||
->withIDs(array($id))
|
->withIDs(array($id))
|
||||||
->setViewer($viewer)
|
->setViewer($viewer)
|
||||||
->needReviewerStatus(true)
|
->needReviewers(true)
|
||||||
->needActiveDiffs(true)
|
->needActiveDiffs(true)
|
||||||
->executeOne();
|
->executeOne();
|
||||||
if (!$revision) {
|
if (!$revision) {
|
||||||
|
|
|
@ -42,7 +42,7 @@ final class DifferentialGetRevisionConduitAPIMethod
|
||||||
$revision = id(new DifferentialRevisionQuery())
|
$revision = id(new DifferentialRevisionQuery())
|
||||||
->withIDs(array($revision_id))
|
->withIDs(array($revision_id))
|
||||||
->setViewer($request->getUser())
|
->setViewer($request->getUser())
|
||||||
->needReviewerStatus(true)
|
->needReviewers(true)
|
||||||
->executeOne();
|
->executeOne();
|
||||||
|
|
||||||
if (!$revision) {
|
if (!$revision) {
|
||||||
|
|
|
@ -182,7 +182,7 @@ final class DifferentialQueryConduitAPIMethod
|
||||||
$query->withBranches($branches);
|
$query->withBranches($branches);
|
||||||
}
|
}
|
||||||
|
|
||||||
$query->needReviewerStatus(true);
|
$query->needReviewers(true);
|
||||||
$query->needCommitPHIDs(true);
|
$query->needCommitPHIDs(true);
|
||||||
$query->needDiffIDs(true);
|
$query->needDiffIDs(true);
|
||||||
$query->needActiveDiffs(true);
|
$query->needActiveDiffs(true);
|
||||||
|
|
|
@ -57,7 +57,7 @@ final class DifferentialUpdateRevisionConduitAPIMethod
|
||||||
$revision = id(new DifferentialRevisionQuery())
|
$revision = id(new DifferentialRevisionQuery())
|
||||||
->setViewer($request->getUser())
|
->setViewer($request->getUser())
|
||||||
->withIDs(array($request->getValue('id')))
|
->withIDs(array($request->getValue('id')))
|
||||||
->needReviewerStatus(true)
|
->needReviewers(true)
|
||||||
->needActiveDiffs(true)
|
->needActiveDiffs(true)
|
||||||
->requireCapabilities(
|
->requireCapabilities(
|
||||||
array(
|
array(
|
||||||
|
|
|
@ -17,7 +17,7 @@ final class DifferentialRevisionViewController extends DifferentialController {
|
||||||
$revision = id(new DifferentialRevisionQuery())
|
$revision = id(new DifferentialRevisionQuery())
|
||||||
->withIDs(array($this->revisionID))
|
->withIDs(array($this->revisionID))
|
||||||
->setViewer($viewer)
|
->setViewer($viewer)
|
||||||
->needReviewerStatus(true)
|
->needReviewers(true)
|
||||||
->needReviewerAuthority(true)
|
->needReviewerAuthority(true)
|
||||||
->executeOne();
|
->executeOne();
|
||||||
if (!$revision) {
|
if (!$revision) {
|
||||||
|
@ -784,7 +784,7 @@ final class DifferentialRevisionViewController extends DifferentialController {
|
||||||
->setLimit(10)
|
->setLimit(10)
|
||||||
->needFlags(true)
|
->needFlags(true)
|
||||||
->needDrafts(true)
|
->needDrafts(true)
|
||||||
->needReviewerStatus(true);
|
->needReviewers(true);
|
||||||
|
|
||||||
foreach ($path_map as $path => $path_id) {
|
foreach ($path_map as $path => $path_id) {
|
||||||
$query->withPath($repository->getID(), $path_id);
|
$query->withPath($repository->getID(), $path_id);
|
||||||
|
|
|
@ -26,7 +26,7 @@ final class DifferentialDoorkeeperRevisionFeedStoryPublisher
|
||||||
return id(new DifferentialRevisionQuery())
|
return id(new DifferentialRevisionQuery())
|
||||||
->setViewer($this->getViewer())
|
->setViewer($this->getViewer())
|
||||||
->withIDs(array($object->getID()))
|
->withIDs(array($object->getID()))
|
||||||
->needReviewerStatus(true)
|
->needReviewers(true)
|
||||||
->executeOne();
|
->executeOne();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ final class DifferentialRevisionEditEngine
|
||||||
protected function newObjectQuery() {
|
protected function newObjectQuery() {
|
||||||
return id(new DifferentialRevisionQuery())
|
return id(new DifferentialRevisionQuery())
|
||||||
->needActiveDiffs(true)
|
->needActiveDiffs(true)
|
||||||
->needReviewerStatus(true)
|
->needReviewers(true)
|
||||||
->needReviewerAuthority(true);
|
->needReviewerAuthority(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -614,7 +614,7 @@ final class DifferentialTransactionEditor
|
||||||
|
|
||||||
$new_revision = id(new DifferentialRevisionQuery())
|
$new_revision = id(new DifferentialRevisionQuery())
|
||||||
->setViewer($this->getActor())
|
->setViewer($this->getActor())
|
||||||
->needReviewerStatus(true)
|
->needReviewers(true)
|
||||||
->needActiveDiffs(true)
|
->needActiveDiffs(true)
|
||||||
->withIDs(array($object->getID()))
|
->withIDs(array($object->getID()))
|
||||||
->executeOne();
|
->executeOne();
|
||||||
|
@ -1575,7 +1575,7 @@ final class DifferentialTransactionEditor
|
||||||
->setViewer($this->getActor())
|
->setViewer($this->getActor())
|
||||||
->withPHIDs(array($object->getPHID()))
|
->withPHIDs(array($object->getPHID()))
|
||||||
->needActiveDiffs(true)
|
->needActiveDiffs(true)
|
||||||
->needReviewerStatus(true)
|
->needReviewers(true)
|
||||||
->executeOne();
|
->executeOne();
|
||||||
if (!$revision) {
|
if (!$revision) {
|
||||||
throw new Exception(
|
throw new Exception(
|
||||||
|
@ -1791,7 +1791,7 @@ final class DifferentialTransactionEditor
|
||||||
// Reload to pick up the active diff and reviewer status.
|
// Reload to pick up the active diff and reviewer status.
|
||||||
return id(new DifferentialRevisionQuery())
|
return id(new DifferentialRevisionQuery())
|
||||||
->setViewer($this->getActor())
|
->setViewer($this->getActor())
|
||||||
->needReviewerStatus(true)
|
->needReviewers(true)
|
||||||
->needActiveDiffs(true)
|
->needActiveDiffs(true)
|
||||||
->withIDs(array($object->getID()))
|
->withIDs(array($object->getID()))
|
||||||
->executeOne();
|
->executeOne();
|
||||||
|
|
|
@ -25,7 +25,7 @@ final class DifferentialHovercardEngineExtension
|
||||||
$revisions = id(new DifferentialRevisionQuery())
|
$revisions = id(new DifferentialRevisionQuery())
|
||||||
->setViewer($viewer)
|
->setViewer($viewer)
|
||||||
->withPHIDs($phids)
|
->withPHIDs($phids)
|
||||||
->needReviewerStatus(true)
|
->needReviewers(true)
|
||||||
->execute();
|
->execute();
|
||||||
$revisions = mpull($revisions, null, 'getPHID');
|
$revisions = mpull($revisions, null, 'getPHID');
|
||||||
|
|
||||||
|
|
|
@ -85,7 +85,7 @@ final class HeraldDifferentialRevisionAdapter
|
||||||
$revision = id(new DifferentialRevisionQuery())
|
$revision = id(new DifferentialRevisionQuery())
|
||||||
->withIDs(array($revision->getID()))
|
->withIDs(array($revision->getID()))
|
||||||
->setViewer(PhabricatorUser::getOmnipotentUser())
|
->setViewer(PhabricatorUser::getOmnipotentUser())
|
||||||
->needReviewerStatus(true)
|
->needReviewers(true)
|
||||||
->executeOne();
|
->executeOne();
|
||||||
|
|
||||||
$object->revision = $revision;
|
$object->revision = $revision;
|
||||||
|
|
|
@ -18,7 +18,7 @@ final class DifferentialRevisionMailReceiver
|
||||||
return id(new DifferentialRevisionQuery())
|
return id(new DifferentialRevisionQuery())
|
||||||
->setViewer($viewer)
|
->setViewer($viewer)
|
||||||
->withIDs(array($id))
|
->withIDs(array($id))
|
||||||
->needReviewerStatus(true)
|
->needReviewers(true)
|
||||||
->needReviewerAuthority(true)
|
->needReviewerAuthority(true)
|
||||||
->needActiveDiffs(true)
|
->needActiveDiffs(true)
|
||||||
->executeOne();
|
->executeOne();
|
||||||
|
|
|
@ -47,7 +47,7 @@ final class DifferentialRevisionQuery
|
||||||
private $needDiffIDs = false;
|
private $needDiffIDs = false;
|
||||||
private $needCommitPHIDs = false;
|
private $needCommitPHIDs = false;
|
||||||
private $needHashes = false;
|
private $needHashes = false;
|
||||||
private $needReviewerStatus = false;
|
private $needReviewers = false;
|
||||||
private $needReviewerAuthority;
|
private $needReviewerAuthority;
|
||||||
private $needDrafts;
|
private $needDrafts;
|
||||||
private $needFlags;
|
private $needFlags;
|
||||||
|
@ -283,14 +283,14 @@ final class DifferentialRevisionQuery
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set whether or not the query should load associated reviewer status.
|
* Set whether or not the query should load associated reviewers.
|
||||||
*
|
*
|
||||||
* @param bool True to load and attach reviewers.
|
* @param bool True to load and attach reviewers.
|
||||||
* @return this
|
* @return this
|
||||||
* @task config
|
* @task config
|
||||||
*/
|
*/
|
||||||
public function needReviewerStatus($need_reviewer_status) {
|
public function needReviewers($need_reviewers) {
|
||||||
$this->needReviewerStatus = $need_reviewer_status;
|
$this->needReviewers = $need_reviewers;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -429,7 +429,7 @@ final class DifferentialRevisionQuery
|
||||||
$this->loadHashes($conn_r, $revisions);
|
$this->loadHashes($conn_r, $revisions);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->needReviewerStatus || $this->needReviewerAuthority) {
|
if ($this->needReviewers || $this->needReviewerAuthority) {
|
||||||
$this->loadReviewers($conn_r, $revisions);
|
$this->loadReviewers($conn_r, $revisions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ final class DifferentialRevisionSearchEngine
|
||||||
return id(new DifferentialRevisionQuery())
|
return id(new DifferentialRevisionQuery())
|
||||||
->needFlags(true)
|
->needFlags(true)
|
||||||
->needDrafts(true)
|
->needDrafts(true)
|
||||||
->needReviewerStatus(true);
|
->needReviewers(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function buildQueryFromParameters(array $map) {
|
protected function buildQueryFromParameters(array $map) {
|
||||||
|
|
|
@ -10,7 +10,7 @@ final class DifferentialRevisionFulltextEngine
|
||||||
$revision = id(new DifferentialRevisionQuery())
|
$revision = id(new DifferentialRevisionQuery())
|
||||||
->setViewer($this->getViewer())
|
->setViewer($this->getViewer())
|
||||||
->withPHIDs(array($object->getPHID()))
|
->withPHIDs(array($object->getPHID()))
|
||||||
->needReviewerStatus(true)
|
->needReviewers(true)
|
||||||
->executeOne();
|
->executeOne();
|
||||||
|
|
||||||
// TODO: This isn't very clean, but custom fields currently rely on it.
|
// TODO: This isn't very clean, but custom fields currently rely on it.
|
||||||
|
|
|
@ -478,7 +478,7 @@ final class DifferentialRevision extends DifferentialDAO
|
||||||
$reviewers = id(new DifferentialRevisionQuery())
|
$reviewers = id(new DifferentialRevisionQuery())
|
||||||
->setViewer(PhabricatorUser::getOmnipotentUser())
|
->setViewer(PhabricatorUser::getOmnipotentUser())
|
||||||
->withPHIDs(array($this->getPHID()))
|
->withPHIDs(array($this->getPHID()))
|
||||||
->needReviewerStatus(true)
|
->needReviewers(true)
|
||||||
->executeOne()
|
->executeOne()
|
||||||
->getReviewerStatus();
|
->getReviewerStatus();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1765,7 +1765,7 @@ final class DiffusionBrowseController extends DiffusionController {
|
||||||
->withUpdatedEpochBetween($recent, null)
|
->withUpdatedEpochBetween($recent, null)
|
||||||
->setOrder(DifferentialRevisionQuery::ORDER_MODIFIED)
|
->setOrder(DifferentialRevisionQuery::ORDER_MODIFIED)
|
||||||
->setLimit(10)
|
->setLimit(10)
|
||||||
->needReviewerStatus(true)
|
->needReviewers(true)
|
||||||
->needFlags(true)
|
->needFlags(true)
|
||||||
->needDrafts(true)
|
->needDrafts(true)
|
||||||
->execute();
|
->execute();
|
||||||
|
|
|
@ -190,7 +190,7 @@ final class HeraldCommitAdapter
|
||||||
$revision = id(new DifferentialRevisionQuery())
|
$revision = id(new DifferentialRevisionQuery())
|
||||||
->withIDs(array($revision_id))
|
->withIDs(array($revision_id))
|
||||||
->setViewer(PhabricatorUser::getOmnipotentUser())
|
->setViewer(PhabricatorUser::getOmnipotentUser())
|
||||||
->needReviewerStatus(true)
|
->needReviewers(true)
|
||||||
->executeOne();
|
->executeOne();
|
||||||
if ($revision) {
|
if ($revision) {
|
||||||
$this->affectedRevision = $revision;
|
$this->affectedRevision = $revision;
|
||||||
|
|
|
@ -190,7 +190,7 @@ final class HeraldPreCommitContentAdapter extends HeraldPreCommitAdapter {
|
||||||
$this->revision = id(new DifferentialRevisionQuery())
|
$this->revision = id(new DifferentialRevisionQuery())
|
||||||
->setViewer(PhabricatorUser::getOmnipotentUser())
|
->setViewer(PhabricatorUser::getOmnipotentUser())
|
||||||
->withIDs(array($revision_id))
|
->withIDs(array($revision_id))
|
||||||
->needReviewerStatus(true)
|
->needReviewers(true)
|
||||||
->executeOne();
|
->executeOne();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,7 +67,7 @@ final class PhabricatorRepositoryCommitOwnersWorker
|
||||||
$revision = id(new DifferentialRevisionQuery())
|
$revision = id(new DifferentialRevisionQuery())
|
||||||
->setViewer($viewer)
|
->setViewer($viewer)
|
||||||
->withIDs(array($revision_id))
|
->withIDs(array($revision_id))
|
||||||
->needReviewerStatus(true)
|
->needReviewers(true)
|
||||||
->executeOne();
|
->executeOne();
|
||||||
} else {
|
} else {
|
||||||
$revision = null;
|
$revision = null;
|
||||||
|
|
|
@ -178,7 +178,7 @@ abstract class PhabricatorRepositoryCommitMessageParserWorker
|
||||||
$revision_query = id(new DifferentialRevisionQuery())
|
$revision_query = id(new DifferentialRevisionQuery())
|
||||||
->withIDs(array($revision_id))
|
->withIDs(array($revision_id))
|
||||||
->setViewer($actor)
|
->setViewer($actor)
|
||||||
->needReviewerStatus(true)
|
->needReviewers(true)
|
||||||
->needActiveDiffs(true);
|
->needActiveDiffs(true);
|
||||||
|
|
||||||
$revision = $revision_query->executeOne();
|
$revision = $revision_query->executeOne();
|
||||||
|
|
Loading…
Reference in a new issue