From c65b58b21c32777ba653c233b47ee7fbfae3a438 Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 3 Feb 2015 09:54:32 -0800 Subject: [PATCH] Clean up a ConduitException around Diffusion merges Summary: Ref T7123. Two general issues: For proxied repositories, we currently throw a ConduitClientException, vs ConduitException for local repositories. This is inconsistent and we should fix it, but I also want to examine the use of try-the-call-and-throw at these sites since it may be something we can update. In particular, trying a call that we know will always fail is now more expensive (in proxied repositories) than it used to be. Here, we try-and-throw for merges, but they're //never// supported in Subversion. Just don't bother trying. Test Plan: Browsed a SVN repository with proxying set up, got a clean commit page. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T7123 Differential Revision: https://secure.phabricator.com/D11646 --- .../controller/DiffusionCommitController.php | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/applications/diffusion/controller/DiffusionCommitController.php b/src/applications/diffusion/controller/DiffusionCommitController.php index 2e0a9931e9..694a08638b 100644 --- a/src/applications/diffusion/controller/DiffusionCommitController.php +++ b/src/applications/diffusion/controller/DiffusionCommitController.php @@ -873,21 +873,23 @@ final class DiffusionCommitController extends DiffusionController { private function buildMergesTable(PhabricatorRepositoryCommit $commit) { $drequest = $this->getDiffusionRequest(); + $repository = $drequest->getRepository(); + + $vcs = $repository->getVersionControlSystem(); + switch ($vcs) { + case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN: + // These aren't supported under SVN. + return null; + } + $limit = 50; - $merges = array(); - try { - $merges = $this->callConduitWithDiffusionRequest( - 'diffusion.mergedcommitsquery', - array( - 'commit' => $drequest->getCommit(), - 'limit' => $limit + 1, - )); - } catch (ConduitException $ex) { - if ($ex->getMessage() != 'ERR-UNSUPPORTED-VCS') { - throw $ex; - } - } + $merges = $this->callConduitWithDiffusionRequest( + 'diffusion.mergedcommitsquery', + array( + 'commit' => $drequest->getCommit(), + 'limit' => $limit + 1, + )); if (!$merges) { return null;