mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-30 01:10:58 +01:00
Link to commits when sending Differential Commit notifications.
Wholly untested. Unlikely to work.
This commit is contained in:
parent
3dcf902a39
commit
17ea3cfab5
2 changed files with 19 additions and 8 deletions
|
@ -108,16 +108,23 @@ class DifferentialCommentMail extends DifferentialMail {
|
|||
$body[] = $this->renderRevisionDetailLink();
|
||||
$revision = $this->getRevision();
|
||||
if ($revision->getStatus() == DifferentialRevisionStatus::COMMITTED) {
|
||||
/*
|
||||
|
||||
TODO
|
||||
|
||||
$rev_ref = $revision->getRevisionRef();
|
||||
if ($rev_ref) {
|
||||
$body[] = " Detail URL: ".$rev_ref->getDetailURL();
|
||||
$phids = $revision->loadCommitPHIDs();
|
||||
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
|
||||
if (count($handles) == 1) {
|
||||
$body[] = "COMMIT";
|
||||
} else {
|
||||
// This is unlikely to ever happen since we'll send this mail the first
|
||||
// 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;
|
||||
|
||||
return implode("\n", $body);
|
||||
|
|
|
@ -9,6 +9,10 @@
|
|||
phutil_require_module('phabricator', 'applications/differential/constants/action');
|
||||
phutil_require_module('phabricator', 'applications/differential/constants/revisionstatus');
|
||||
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');
|
||||
|
|
Loading…
Reference in a new issue