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(); + } + } + } + }