From 5752faecceea000c0532203284a23ae3ed24cf69 Mon Sep 17 00:00:00 2001 From: vrana Date: Thu, 7 Jun 2012 17:46:51 -0700 Subject: [PATCH] Display Arcanist project in Differential e-mails Summary: I need this information quite often. I don't know how many people are working on a single project and this information will be useless for them but I guess it won't hurt much? Test Plan: Commented on accepted revision. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D2674 --- .../DifferentialDefaultFieldSelector.php | 1 + ...ntialArcanistProjectFieldSpecification.php | 20 ++++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/applications/differential/field/selector/DifferentialDefaultFieldSelector.php b/src/applications/differential/field/selector/DifferentialDefaultFieldSelector.php index d5332a1ed7..a5fd50a896 100644 --- a/src/applications/differential/field/selector/DifferentialDefaultFieldSelector.php +++ b/src/applications/differential/field/selector/DifferentialDefaultFieldSelector.php @@ -105,6 +105,7 @@ final class DifferentialDefaultFieldSelector 'DifferentialRevisionIDFieldSpecification', 'DifferentialManiphestTasksFieldSpecification', 'DifferentialBranchFieldSpecification', + 'DifferentialArcanistProjectFieldSpecification', 'DifferentialCommitsFieldSpecification', )) + $map; diff --git a/src/applications/differential/field/specification/DifferentialArcanistProjectFieldSpecification.php b/src/applications/differential/field/specification/DifferentialArcanistProjectFieldSpecification.php index d8098b3839..a405747656 100644 --- a/src/applications/differential/field/specification/DifferentialArcanistProjectFieldSpecification.php +++ b/src/applications/differential/field/specification/DifferentialArcanistProjectFieldSpecification.php @@ -1,7 +1,7 @@ getArcanistProjectPHID(); } + public function renderValueForMail($phase) { + $status = $this->getRevision()->getStatus(); + + if ($status != ArcanistDifferentialRevisionStatus::NEEDS_REVISION && + $status != ArcanistDifferentialRevisionStatus::ACCEPTED) { + return null; + } + + $diff = $this->getRevision()->loadActiveDiff(); + if ($diff) { + $phid = $diff->getArcanistProjectPHID(); + if ($phid) { + $handle = PhabricatorObjectHandleData::loadOneHandle($phid); + return "ARCANIST PROJECT\n ".$handle->getName(); + } + } + } + }