1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-24 14:30:56 +01:00

Display link to change since last diff in Differential update e-mail

Test Plan: Updated revision, clicked on the link.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D2731
This commit is contained in:
vrana 2012-06-12 15:14:45 -07:00
parent 06371bc2cd
commit 3718e49f9c
2 changed files with 19 additions and 3 deletions

View file

@ -105,8 +105,24 @@ final class DifferentialRevisionIDFieldSpecification
} }
public function renderValueForMail($phase) { public function renderValueForMail($phase) {
$uri = PhabricatorEnv::getProductionURI('/D'.$this->id); $body = array();
return "REVISION DETAIL\n {$uri}"; $body[] = 'REVISION DETAIL';
$body[] = ' '.PhabricatorEnv::getProductionURI('/D'.$this->id);
if ($phase == DifferentialMailPhase::UPDATE) {
$diffs = id(new DifferentialDiff())->loadAllWhere(
'revisionID = %d ORDER BY id DESC LIMIT 2',
$this->id);
if (count($diffs) == 2) {
list($new, $old) = array_values(mpull($diffs, 'getID'));
$body[] = null;
$body[] = 'CHANGE SINCE LAST DIFF';
$body[] = ' '.PhabricatorEnv::getProductionURI(
"/D{$this->id}?vs={$old}&id={$new}#differential-review-toc");
}
}
return implode("\n", $body);
} }
} }

View file

@ -266,7 +266,7 @@ EOTEXT;
protected function formatText($text) { protected function formatText($text) {
$text = explode("\n", $text); $text = explode("\n", rtrim($text));
foreach ($text as &$line) { foreach ($text as &$line) {
$line = rtrim(' '.$line); $line = rtrim(' '.$line);
} }