Page MenuHomePhabricator

D7375.id16594.diff
No OneTemporary

D7375.id16594.diff

Index: src/applications/differential/controller/DifferentialRevisionViewController.php
===================================================================
--- src/applications/differential/controller/DifferentialRevisionViewController.php
+++ src/applications/differential/controller/DifferentialRevisionViewController.php
@@ -91,9 +91,6 @@
$aux_fields = $this->loadAuxiliaryFields($revision);
$comments = $revision->loadComments();
- $comments = array_merge(
- $this->getImplicitComments($revision, reset($diffs)),
- $comments);
$all_changesets = $changesets;
$inlines = $this->loadInlineComments(
@@ -111,22 +108,8 @@
mpull($comments, 'getAuthorPHID'));
foreach ($comments as $comment) {
- $metadata = $comment->getMetadata();
- $added_reviewers = idx(
- $metadata,
- DifferentialComment::METADATA_ADDED_REVIEWERS);
- if ($added_reviewers) {
- foreach ($added_reviewers as $phid) {
- $object_phids[] = $phid;
- }
- }
- $added_ccs = idx(
- $metadata,
- DifferentialComment::METADATA_ADDED_CCS);
- if ($added_ccs) {
- foreach ($added_ccs as $phid) {
- $object_phids[] = $phid;
- }
+ foreach ($comment->getRequiredHandlePHIDs() as $phid) {
+ $object_phids[] = $phid;
}
}
@@ -479,38 +462,6 @@
));
}
- private function getImplicitComments(
- DifferentialRevision $revision,
- DifferentialDiff $diff) {
-
- $author_phid = nonempty(
- $diff->getAuthorPHID(),
- $revision->getAuthorPHID());
-
- $template = new DifferentialComment();
- $template->setAuthorPHID($author_phid);
- $template->setRevisionID($revision->getID());
- $template->setDateCreated($revision->getDateCreated());
-
- $comments = array();
-
- if (strlen($revision->getSummary())) {
- $summary_comment = clone $template;
- $summary_comment->setContent($revision->getSummary());
- $summary_comment->setAction(DifferentialAction::ACTION_SUMMARIZE);
- $comments[] = $summary_comment;
- }
-
- if (strlen($revision->getTestPlan())) {
- $testplan_comment = clone $template;
- $testplan_comment->setContent($revision->getTestPlan());
- $testplan_comment->setAction(DifferentialAction::ACTION_TESTPLAN);
- $comments[] = $testplan_comment;
- }
-
- return $comments;
- }
-
private function getRevisionActions(DifferentialRevision $revision) {
$user = $this->getRequest()->getUser();
$viewer_phid = $user->getPHID();
Index: src/applications/differential/storage/DifferentialComment.php
===================================================================
--- src/applications/differential/storage/DifferentialComment.php
+++ src/applications/differential/storage/DifferentialComment.php
@@ -25,6 +25,31 @@
return $this;
}
+ public function getRequiredHandlePHIDs() {
+ $phids = array();
+
+ $metadata = $this->getMetadata();
+ $added_reviewers = idx(
+ $metadata,
+ self::METADATA_ADDED_REVIEWERS);
+ if ($added_reviewers) {
+ foreach ($added_reviewers as $phid) {
+ $phids[] = $phid;
+ }
+ }
+ $added_ccs = idx(
+ $metadata,
+ self::METADATA_ADDED_CCS);
+ if ($added_ccs) {
+ foreach ($added_ccs as $phid) {
+ $phids[] = $phid;
+ }
+ }
+
+ return $phids;
+ }
+
+
public function getConfiguration() {
return array(
self::CONFIG_SERIALIZATION => array(
Index: src/applications/differential/view/DifferentialRevisionDetailView.php
===================================================================
--- src/applications/differential/view/DifferentialRevisionDetailView.php
+++ src/applications/differential/view/DifferentialRevisionDetailView.php
@@ -112,6 +112,26 @@
$properties->setHasKeyboardShortcuts(true);
$properties->setActionList($actions);
+ if (strlen($revision->getSummary())) {
+ $properties->addSectionHeader(pht('Summary'));
+ $properties->addTextContent(
+ PhabricatorMarkupEngine::renderOneObject(
+ id(new PhabricatorMarkupOneOff())->setContent(
+ $revision->getSummary()),
+ 'default',
+ $user));
+ }
+
+ if (strlen($revision->getTestPlan())) {
+ $properties->addSectionHeader(pht('Test Plan'));
+ $properties->addTextContent(
+ PhabricatorMarkupEngine::renderOneObject(
+ id(new PhabricatorMarkupOneOff())->setContent(
+ $revision->getTestPlan()),
+ 'default',
+ $user));
+ }
+
$object_box = id(new PHUIObjectBoxView())
->setHeader($header)
->addPropertyList($properties);

File Metadata

Mime Type
text/plain
Expires
Mon, Mar 17, 1:01 PM (2 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7708381
Default Alt Text
D7375.id16594.diff (4 KB)

Event Timeline