Differential D18339 Diff 44158 src/applications/differential/customfield/DifferentialBranchField.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/customfield/DifferentialBranchField.php
| Show First 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | public function shouldAppearInTransactionMail() { | ||||
| return true; | return true; | ||||
| } | } | ||||
| public function updateTransactionMailBody( | public function updateTransactionMailBody( | ||||
| PhabricatorMetaMTAMailBody $body, | PhabricatorMetaMTAMailBody $body, | ||||
| PhabricatorApplicationTransactionEditor $editor, | PhabricatorApplicationTransactionEditor $editor, | ||||
| array $xactions) { | array $xactions) { | ||||
| $status_accepted = ArcanistDifferentialRevisionStatus::ACCEPTED; | $revision = $this->getObject(); | ||||
| // Show the "BRANCH" section only if there's a new diff or the revision | // Show the "BRANCH" section only if there's a new diff or the revision | ||||
| // is "Accepted". | // is "Accepted". | ||||
| if ((!$editor->getDiffUpdateTransaction($xactions)) && | $is_update = (bool)$editor->getDiffUpdateTransaction($xactions); | ||||
| ($this->getObject()->getStatus() != $status_accepted)) { | $is_accepted = $revision->isAccepted(); | ||||
| if (!$is_update && !$is_accepted) { | |||||
| return; | return; | ||||
| } | } | ||||
| $branch = $this->getBranchDescription($this->getObject()->getActiveDiff()); | $branch = $this->getBranchDescription($revision->getActiveDiff()); | ||||
| if ($branch === null) { | if ($branch === null) { | ||||
| return; | return; | ||||
| } | } | ||||
| $body->addTextSection(pht('BRANCH'), $branch); | $body->addTextSection(pht('BRANCH'), $branch); | ||||
| } | } | ||||
| } | } | ||||