Migrate Differential revision edges to use modern EdgeType subclasses
Summary: Modernize Differential edges to subclass `PhabricatorEdgeType`. Largely based on D11045. Test Plan: From previous experience, these changes are fairly trivial and safe. I poked around a little to make sure things looked reasonably okay. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: Korvin, Krenair, epriestley Differential Revision: https://secure.phabricator.com/D11074
This commit is contained in:
@@ -639,7 +639,7 @@ final class DifferentialRevisionQuery
|
||||
'AND e_reviewers.type = %s '.
|
||||
'AND e_reviewers.dst in (%Ls)',
|
||||
PhabricatorEdgeConfig::TABLE_NAME_EDGE,
|
||||
PhabricatorEdgeConfig::TYPE_DREV_HAS_REVIEWER,
|
||||
DifferentialRevisionHasReviewerEdgeType::EDGECONST,
|
||||
$this->reviewers);
|
||||
}
|
||||
|
||||
@@ -900,7 +900,7 @@ final class DifferentialRevisionQuery
|
||||
private function loadRelationships($conn_r, array $revisions) {
|
||||
assert_instances_of($revisions, 'DifferentialRevision');
|
||||
|
||||
$type_reviewer = PhabricatorEdgeConfig::TYPE_DREV_HAS_REVIEWER;
|
||||
$type_reviewer = DifferentialRevisionHasReviewerEdgeType::EDGECONST;
|
||||
$type_subscriber = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_SUBSCRIBER;
|
||||
|
||||
$edges = id(new PhabricatorEdgeQuery())
|
||||
@@ -1019,7 +1019,7 @@ final class DifferentialRevisionQuery
|
||||
array $revisions) {
|
||||
|
||||
assert_instances_of($revisions, 'DifferentialRevision');
|
||||
$edge_type = PhabricatorEdgeConfig::TYPE_DREV_HAS_REVIEWER;
|
||||
$edge_type = DifferentialRevisionHasReviewerEdgeType::EDGECONST;
|
||||
|
||||
$edges = id(new PhabricatorEdgeQuery())
|
||||
->withSourcePHIDs(mpull($revisions, 'getPHID'))
|
||||
@@ -1125,7 +1125,7 @@ final class DifferentialRevisionQuery
|
||||
// Find all the project reviewers which the user may have authority over.
|
||||
$project_phids = array();
|
||||
$project_type = PhabricatorProjectProjectPHIDType::TYPECONST;
|
||||
$edge_type = PhabricatorEdgeConfig::TYPE_DREV_HAS_REVIEWER;
|
||||
$edge_type = DifferentialRevisionHasReviewerEdgeType::EDGECONST;
|
||||
foreach ($edges as $src => $types) {
|
||||
if (!$allow_self) {
|
||||
if ($revision_map[$src]->getAuthorPHID() == $viewer_phid) {
|
||||
|
||||
Reference in New Issue
Block a user