public function updateTransactionMailBody(PhabricatorMetaMTAMailBody $body, PhabricatorApplicationTransactionEditor $editor, array $xactions) { $status_accepted = ArcanistDifferentialRevisionStatus::ACCEPTED; // 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); }
public function updateTransactionMailBody(PhabricatorMetaMTAMailBody $body, PhabricatorApplicationTransactionEditor $editor, array $xactions) { if ($editor->getIsNewObject()) { return; } if ($editor->getIsCloseByCommit()) { return; } $xaction = $editor->getDiffUpdateTransaction($xactions); if (!$xaction) { return; } $original = id(new DifferentialDiffQuery())->setViewer($this->getViewer())->withPHIDs(array($xaction->getOldValue()))->executeOne(); if (!$original) { return; } $revision = $this->getObject(); $current = $revision->getActiveDiff(); $old_id = $original->getID(); $new_id = $current->getID(); $uri = '/' . $revision->getMonogram() . '?vs=' . $old_id . '&id=' . $new_id; $uri = PhabricatorEnv::getProductionURI($uri); $body->addTextSection(pht('CHANGES SINCE LAST UPDATE'), $uri); }