diff --git a/src/applications/releeph/commitfinder/ReleephCommitFinder.php b/src/applications/releeph/commitfinder/ReleephCommitFinder.php --- a/src/applications/releeph/commitfinder/ReleephCommitFinder.php +++ b/src/applications/releeph/commitfinder/ReleephCommitFinder.php @@ -30,13 +30,16 @@ $matches = array(); if (preg_match('/^D([1-9]\d*)$/', $partial_string, $matches)) { $diff_id = $matches[1]; - // TOOD: (T603) This is all slated for annihilation. - $diff_rev = id(new DifferentialRevision())->load($diff_id); + $diff_rev = id(new DifferentialRevisionQuery()) + ->setViewer($this->getUser()) + ->withIDs(array($diff_id)) + ->needCommitPHIDs(true) + ->executeOne(); if (!$diff_rev) { throw new ReleephCommitFinderException( "{$partial_string} does not refer to an existing diff."); } - $commit_phids = $diff_rev->loadCommitPHIDs(); + $commit_phids = $diff_rev->getCommitPHIDs(); if (!$commit_phids) { throw new ReleephCommitFinderException( @@ -45,9 +48,11 @@ $this->objectPHID = $diff_rev->getPHID(); - $commits = id(new PhabricatorRepositoryCommit())->loadAllWhere( - 'phid IN (%Ls) ORDER BY epoch ASC', - $commit_phids); + $commits = id(new DiffusionCommitQuery()) + ->setViewer($this->getUser()) + ->withPHIDs($commit_phids) + ->execute(); + $commits = msort($commits, 'getEpoch'); return head($commits); }