1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-01 18:30:59 +01:00

Link to commits when sending Differential Commit notifications.

Wholly untested. Unlikely to work.
This commit is contained in:
epriestley 2011-04-10 08:31:18 -07:00
parent 3dcf902a39
commit 17ea3cfab5
2 changed files with 19 additions and 8 deletions

View file

@ -108,16 +108,23 @@ class DifferentialCommentMail extends DifferentialMail {
$body[] = $this->renderRevisionDetailLink(); $body[] = $this->renderRevisionDetailLink();
$revision = $this->getRevision(); $revision = $this->getRevision();
if ($revision->getStatus() == DifferentialRevisionStatus::COMMITTED) { if ($revision->getStatus() == DifferentialRevisionStatus::COMMITTED) {
/* $phids = $revision->loadCommitPHIDs();
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
TODO if (count($handles) == 1) {
$body[] = "COMMIT";
$rev_ref = $revision->getRevisionRef(); } else {
if ($rev_ref) { // This is unlikely to ever happen since we'll send this mail the first
$body[] = " Detail URL: ".$rev_ref->getDetailURL(); // time we discover a commit, but it's not impossible if data was
// migrated, etc.
$body[] = "COMMITS";
} }
*/
foreach ($handles as $handle) {
$body[] = ' '.PhabricatorEnv::getProductionURI($handle->getURI());
}
$body[] = null;
} }
$body[] = null; $body[] = null;
return implode("\n", $body); return implode("\n", $body);

View file

@ -9,6 +9,10 @@
phutil_require_module('phabricator', 'applications/differential/constants/action'); phutil_require_module('phabricator', 'applications/differential/constants/action');
phutil_require_module('phabricator', 'applications/differential/constants/revisionstatus'); phutil_require_module('phabricator', 'applications/differential/constants/revisionstatus');
phutil_require_module('phabricator', 'applications/differential/mail/base'); phutil_require_module('phabricator', 'applications/differential/mail/base');
phutil_require_module('phabricator', 'applications/phid/handle/data');
phutil_require_module('phabricator', 'infrastructure/env');
phutil_require_module('phutil', 'utils');
phutil_require_source('DifferentialCommentMail.php'); phutil_require_source('DifferentialCommentMail.php');