Differential D13319 Diff 32234 src/applications/repository/customfield/PhabricatorCommitBranchesField.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/customfield/PhabricatorCommitBranchesField.php
Show All 23 Lines | public function updateTransactionMailBody( | ||||
PhabricatorApplicationTransactionEditor $editor, | PhabricatorApplicationTransactionEditor $editor, | ||||
array $xactions) { | array $xactions) { | ||||
$params = array( | $params = array( | ||||
'contains' => $this->getObject()->getCommitIdentifier(), | 'contains' => $this->getObject()->getCommitIdentifier(), | ||||
'callsign' => $this->getObject()->getRepository()->getCallsign(), | 'callsign' => $this->getObject()->getRepository()->getCallsign(), | ||||
); | ); | ||||
try { | |||||
$branches_raw = id(new ConduitCall('diffusion.branchquery', $params)) | $branches_raw = id(new ConduitCall('diffusion.branchquery', $params)) | ||||
->setUser($this->getViewer()) | ->setUser($this->getViewer()) | ||||
->execute(); | ->execute(); | ||||
$branches = DiffusionRepositoryRef::loadAllFromDictionaries($branches_raw); | $branches = DiffusionRepositoryRef::loadAllFromDictionaries( | ||||
$branches_raw); | |||||
if (!$branches) { | if (!$branches) { | ||||
return; | return; | ||||
} | } | ||||
$branch_names = mpull($branches, 'getShortName'); | $branch_names = mpull($branches, 'getShortName'); | ||||
sort($branch_names); | sort($branch_names); | ||||
$branch_text = implode(', ', $branch_names); | |||||
} catch (Exception $ex) { | |||||
$branch_text = pht('<%s: %s>', get_class($ex), $ex->getMessage()); | |||||
} | |||||
$body->addTextSection(pht('BRANCHES'), implode(', ', $branch_names)); | $body->addTextSection(pht('BRANCHES'), $branch_text); | ||||
} | } | ||||
} | } |