Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F18048057
D10542.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D10542.id.diff
View Options
diff --git a/src/applications/audit/editor/PhabricatorAuditEditor.php b/src/applications/audit/editor/PhabricatorAuditEditor.php
--- a/src/applications/audit/editor/PhabricatorAuditEditor.php
+++ b/src/applications/audit/editor/PhabricatorAuditEditor.php
@@ -663,6 +663,7 @@
if ($is_commit) {
$data = $object->getCommitData();
+ $this->showMergedCommits($body, $object);
$body->addTextSection(pht('AFFECTED FILES'), $this->affectedFiles);
$this->inlinePatch(
$body,
@@ -729,6 +730,54 @@
return $body;
}
+ private function showMergedCommits(
+ PhabricatorMetaMTAMailBody $body,
+ PhabricatorRepositoryCommit $commit) {
+
+ // Get all the merged commits if this one is a merge
+ $merges_caption = '';
+ $limit = 50;
+ try {
+ $drequest = DiffusionRequest::newFromDictionary(
+ array(
+ 'user' => PhabricatorUser::getOmnipotentUser(),
+ 'initFromConduit' => false,
+ 'repository' => $commit->getRepository(),
+ 'commit' => $commit->getCommitIdentifier(),
+ ));
+
+ $merges = DiffusionQuery::callConduitWithDiffusionRequest(
+ PhabricatorUser::getOmnipotentUser(),
+ $drequest,
+ 'diffusion.mergedcommitsquery',
+ array(
+ 'commit' => $commit->getCommitIdentifier(),
+ 'limit' => $limit + 1,
+ ));
+
+ if (count($merges) > $limit) {
+ $merges = array_slice($merges, 0, $limit);
+ $merges_caption =
+ "This commit merges more than {$limit} changes. Only the first ".
+ "{$limit} are shown.\n";
+ }
+
+ if ($merges) {
+ for ($i = 0; $i < count($merges); $i++) {
+ $merges[$i] = $merges[$i]->getAuthorName().
+ ': '.
+ $merges[$i]->getSummary();
+ }
+ $body->addTextSection(
+ pht('MERGED COMMITS'),
+ $merges_caption.implode("\n", $merges));
+ }
+ } catch (ConduitException $ex) {
+ // Log the exception and continue.
+ phlog($ex);
+ }
+ }
+
private function attachPatch(
PhabricatorMetaMTAMail $template,
PhabricatorRepositoryCommit $commit) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Aug 4, 1:19 PM (2 w, 4 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
8793349
Default Alt Text
D10542.id.diff (2 KB)
Attached To
Mode
D10542: Provide more information in Herald Commit Email notifications - Add a list of merged commits to merge commits. - Show the author's name
Attached
Detach File
Event Timeline
Log In to Comment