Page MenuHomePhabricator

D10542.id31267.diff
No OneTemporary

D10542.id31267.diff

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

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)

Event Timeline