mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
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
This commit is contained in:
parent
3b6100d620
commit
c65b58b21c
1 changed files with 15 additions and 13 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue