From 8fead366154fadc86e78287e12e19f7814231c48 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 27 Feb 2013 18:41:21 -0800 Subject: [PATCH] Implement DiffusionMercurialContainsQuery in Diffusion Summary: Currently, we have no implementation, so all Mercurial commits show "None" for "Branches". Instead, implement this method. Test Plan: {F34076} Reviewers: DurhamGoode, vrana, chad Reviewed By: chad CC: aran Differential Revision: https://secure.phabricator.com/D5145 --- .../contains/DiffusionMercurialContainsQuery.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/applications/diffusion/query/contains/DiffusionMercurialContainsQuery.php b/src/applications/diffusion/query/contains/DiffusionMercurialContainsQuery.php index d796525c55..dbf40062ba 100644 --- a/src/applications/diffusion/query/contains/DiffusionMercurialContainsQuery.php +++ b/src/applications/diffusion/query/contains/DiffusionMercurialContainsQuery.php @@ -3,10 +3,16 @@ final class DiffusionMercurialContainsQuery extends DiffusionContainsQuery { protected function executeQuery() { + $request = $this->getRequest(); + $repository = $request->getRepository(); + list($contains) = $repository->execxLocalCommand( + 'log --template %s --limit 1 --rev %s --', + '{branch}', + $request->getCommit()); - // TODO: Implement this. - - return array(); + return array( + trim($contains) => $request->getCommit(), + ); } }