diff --git a/src/applications/diffusion/conduit/DiffusionExistsQueryConduitAPIMethod.php b/src/applications/diffusion/conduit/DiffusionExistsQueryConduitAPIMethod.php index 3c6d09ebda..4280230002 100644 --- a/src/applications/diffusion/conduit/DiffusionExistsQueryConduitAPIMethod.php +++ b/src/applications/diffusion/conduit/DiffusionExistsQueryConduitAPIMethod.php @@ -33,16 +33,13 @@ final class DiffusionExistsQueryConduitAPIMethod protected function getSVNResult(ConduitAPIRequest $request) { $repository = $this->getDiffusionRequest()->getRepository(); $commit = $request->getValue('commit'); - list($info) = $repository->execxRemoteCommand( - 'info %s', - $repository->getRemoteURI()); - $exists = false; - $matches = null; - if (preg_match('/^Revision: (\d+)$/m', $info, $matches)) { - $base_revision = $matches[1]; - $exists = $base_revision >= $commit; - } - return $exists; + + $refs = id(new DiffusionCachedResolveRefsQuery()) + ->setRepository($repository) + ->withRefs(array($commit)) + ->execute(); + + return (bool)$refs; } protected function getMercurialResult(ConduitAPIRequest $request) { diff --git a/src/applications/diffusion/controller/DiffusionCommitController.php b/src/applications/diffusion/controller/DiffusionCommitController.php index fe2f539f09..a698eba5c0 100644 --- a/src/applications/diffusion/controller/DiffusionCommitController.php +++ b/src/applications/diffusion/controller/DiffusionCommitController.php @@ -1136,14 +1136,17 @@ final class DiffusionCommitController extends DiffusionController { $merge_limit = $this->getMergeDisplayLimit(); try { - $merges = $this->callConduitWithDiffusionRequest( - 'diffusion.mergedcommitsquery', - array( - 'commit' => $commit, - 'limit' => $merge_limit + 1, - )); - - $this->commitMerges = DiffusionPathChange::newFromConduit($merges); + if ($repository->isSVN()) { + $this->commitMerges = array(); + } else { + $merges = $this->callConduitWithDiffusionRequest( + 'diffusion.mergedcommitsquery', + array( + 'commit' => $commit, + 'limit' => $merge_limit + 1, + )); + $this->commitMerges = DiffusionPathChange::newFromConduit($merges); + } } catch (Exception $ex) { $this->commitMerges = false; $exceptions[] = $ex; diff --git a/src/applications/diffusion/query/lowlevel/DiffusionLowLevelParentsQuery.php b/src/applications/diffusion/query/lowlevel/DiffusionLowLevelParentsQuery.php index 60ee4b5fe2..f49f828d79 100644 --- a/src/applications/diffusion/query/lowlevel/DiffusionLowLevelParentsQuery.php +++ b/src/applications/diffusion/query/lowlevel/DiffusionLowLevelParentsQuery.php @@ -70,7 +70,21 @@ final class DiffusionLowLevelParentsQuery } private function loadSubversionParents() { - $n = (int)$this->identifier; + $repository = $this->getRepository(); + $identifier = $this->identifier; + + $refs = id(new DiffusionCachedResolveRefsQuery()) + ->setRepository($repository) + ->withRefs(array($identifier)) + ->execute(); + if (!$refs) { + throw new Exception( + pht( + 'No commit "%s" in this repository.', + $identifier)); + } + + $n = (int)$identifier; if ($n > 1) { $ids = array($n - 1); } else {