diff --git a/src/applications/releeph/storage/ReleephRequest.php b/src/applications/releeph/storage/ReleephRequest.php index 4e68fb54fe..00beab892c 100644 --- a/src/applications/releeph/storage/ReleephRequest.php +++ b/src/applications/releeph/storage/ReleephRequest.php @@ -207,13 +207,15 @@ final class ReleephRequest extends ReleephDAO } public function loadRequestCommitDiffPHID() { + $phids = array(); $commit = $this->loadPhabricatorRepositoryCommit(); if ($commit) { - $edges = $this - ->loadPhabricatorRepositoryCommit() - ->loadRelativeEdges(PhabricatorEdgeConfig::TYPE_COMMIT_HAS_DREV); - return head(array_keys($edges)); + $phids = PhabricatorEdgeQuery::loadDestinationPHIDs( + $commit->getPHID(), + PhabricatorEdgeConfig::TYPE_COMMIT_HAS_DREV); } + + return head($phids); } diff --git a/src/infrastructure/edges/query/PhabricatorEdgeQuery.php b/src/infrastructure/edges/query/PhabricatorEdgeQuery.php index f42af09848..675354bedc 100644 --- a/src/infrastructure/edges/query/PhabricatorEdgeQuery.php +++ b/src/infrastructure/edges/query/PhabricatorEdgeQuery.php @@ -150,8 +150,7 @@ final class PhabricatorEdgeQuery extends PhabricatorQuery { $result = array(); // When a query specifies types, make sure we return data for all queried - // types. This is mostly to make sure PhabricatorLiskDAO->attachEdges() - // gets some data, so that getEdges() doesn't throw later. + // types. if ($this->edgeTypes) { foreach ($this->sourcePHIDs as $phid) { foreach ($this->edgeTypes as $type) { diff --git a/src/infrastructure/storage/lisk/LiskDAOSet.php b/src/infrastructure/storage/lisk/LiskDAOSet.php index ad2ad452ca..a554a19b62 100644 --- a/src/infrastructure/storage/lisk/LiskDAOSet.php +++ b/src/infrastructure/storage/lisk/LiskDAOSet.php @@ -23,11 +23,10 @@ final class LiskDAOSet { private $daos = array(); private $relatives = array(); - private $edges = array(); private $subsets = array(); public function addToSet(LiskDAO $dao) { - if ($this->relatives || $this->edges) { + if ($this->relatives) { throw new Exception("Don't call addToSet() after loading data!"); } $this->daos[] = $dao; @@ -42,7 +41,6 @@ final class LiskDAOSet { final public function clearSet() { $this->daos = array(); $this->relatives = array(); - $this->edges = array(); foreach ($this->subsets as $set) { $set->clearSet(); } @@ -88,26 +86,4 @@ final class LiskDAOSet { return $relatives; } - public function loadRelativeEdges($type) { - $edges = &$this->edges[$type]; - - if ($edges === null) { - if (!$this->daos) { - $edges = array(); - } else { - assert_instances_of($this->daos, 'PhabricatorLiskDAO'); - $phids = mpull($this->daos, 'getPHID', 'getPHID'); - $edges = id(new PhabricatorEdgeQuery()) - ->withSourcePHIDs($phids) - ->withEdgeTypes(array($type)) - ->execute(); - foreach ($this->daos as $dao) { - $dao->attachEdges($edges[$dao->getPHID()]); - } - } - } - - return $edges; - } - } diff --git a/src/infrastructure/storage/lisk/PhabricatorLiskDAO.php b/src/infrastructure/storage/lisk/PhabricatorLiskDAO.php index ae28fca4c7..cca5c3accf 100644 --- a/src/infrastructure/storage/lisk/PhabricatorLiskDAO.php +++ b/src/infrastructure/storage/lisk/PhabricatorLiskDAO.php @@ -1,58 +1,14 @@ "; -/* -( Managing Edges )----------------------------------------------------- */ - - - /** - * @task edges - */ - public function attachEdges(array $edges) { - foreach ($edges as $type => $type_edges) { - $this->edges[$type] = $type_edges; - } - return $this; - } - - - /** - * @task edges - */ - public function getEdges($type) { - return $this->assertAttachedKey($this->edges, $type); - } - - - /** - * @task edges - */ - public function loadRelativeEdges($type) { - if (!$this->getInSet()) { - id(new LiskDAOSet())->addToSet($this); - } - $this->getInSet()->loadRelativeEdges($type); - return $this->getEdges($type); - } - - - /** - * @task edges - */ - public function getEdgePHIDs($type) { - return ipull($this->getEdges($type), 'dst'); - } - - /* -( Configuring Storage )------------------------------------------------ */ /**