Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/customfield/DifferentialBranchField.php
Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | final class DifferentialBranchField | ||||
public function getProTips() { | public function getProTips() { | ||||
return array( | return array( | ||||
pht( | pht( | ||||
'In Git and Mercurial, use a branch like "T123" to automatically '. | 'In Git and Mercurial, use a branch like "T123" to automatically '. | ||||
'associate changes with the corresponding task.'), | 'associate changes with the corresponding task.'), | ||||
); | ); | ||||
} | } | ||||
public function shouldAppearInTransactionMail() { | |||||
return true; | |||||
} | |||||
public function updateTransactionMailBody( | |||||
PhabricatorMetaMTAMailBody $body, | |||||
PhabricatorApplicationTransactionEditor $editor, | |||||
array $xactions) { | |||||
$status_accepted = ArcanistDifferentialRevisionStatus::ACCEPTED; | |||||
sophiebits: It's also useful to have the branch shown when a diff is accepted and ready to land. | |||||
// Show the "BRANCH" section only if there's a new diff or the revision | |||||
// is "Accepted". | |||||
if ((!$editor->getDiffUpdateTransaction($xactions)) && | |||||
($this->getObject()->getStatus() != $status_accepted)) { | |||||
return; | |||||
} | |||||
$branch = $this->getBranchDescription($this->getObject()->getActiveDiff()); | |||||
if ($branch === null) { | |||||
return; | |||||
} | |||||
$body->addTextSection(pht('BRANCH'), $branch); | |||||
} | |||||
} | } |
It's also useful to have the branch shown when a diff is accepted and ready to land.