Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14913074
D10542.id31267.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.id31267.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
Thu, Feb 13, 1:51 AM (18 h, 43 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7125941
Default Alt Text
D10542.id31267.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