From 3b6100d620efad23ab7c347b143ab8a7e47d9daf Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 3 Feb 2015 09:54:17 -0800 Subject: [PATCH] Fix lookup of commits in Subversion Summary: Fixes T7122. The way this query works is a little surprising: - If executed as `withRepositoryIDs(...)`, it assumes you are passing one //or more// repository IDs, so it will never resolve ambiguous identifiers (e.g., "123" instead of "rSVN123"). - If executed as `withRepository(...)`, it knows you are passing exactly one repository and will use that to imply context and resolve these identifiers correctly. This isn't very obvious from the API, but I'm not sure how to make it more clear. (Making `withRepositoryIDs()` do the `withRepository(...)` thing if only one ID was passed in would mean its behavior varied if you passed 1 vs 2 repository IDs, which seems worse / morse surprising.) Test Plan: Various subversion UIs no longer fail to look up commits. Reviewers: btrahan Reviewed By: btrahan Subscribers: mormegil, epriestley Maniphest Tasks: T7122 Differential Revision: https://secure.phabricator.com/D11645 --- src/applications/diffusion/request/DiffusionRequest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/applications/diffusion/request/DiffusionRequest.php b/src/applications/diffusion/request/DiffusionRequest.php index 8e51a4f509..3e8b4a8b19 100644 --- a/src/applications/diffusion/request/DiffusionRequest.php +++ b/src/applications/diffusion/request/DiffusionRequest.php @@ -389,7 +389,7 @@ abstract class DiffusionRequest { $commit = id(new DiffusionCommitQuery()) ->setViewer($this->getUser()) - ->withRepositoryIDs(array($repository->getID())) + ->withRepository($repository) ->withIdentifiers(array($this->getStableCommit())) ->executeOne(); if ($commit) {