mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 22:10:55 +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:
parent
06371bc2cd
commit
3718e49f9c
2 changed files with 19 additions and 3 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue