From 0da0632242d2d65fe08a8a2e499f3cd9ca1019fe Mon Sep 17 00:00:00 2001 From: vrana Date: Thu, 24 May 2012 14:21:50 -0700 Subject: [PATCH] Display author of last manual diff in summary and test plan comments Summary: D2550 is not compatible with D2540. Example: D2559. Test Plan: Display commandeered revision. Reviewers: nh Reviewed By: nh CC: aran, epriestley Differential Revision: https://secure.phabricator.com/D2567 --- .../DifferentialRevisionViewController.php | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/applications/differential/controller/revisionview/DifferentialRevisionViewController.php b/src/applications/differential/controller/revisionview/DifferentialRevisionViewController.php index f30fe9a341..800cbe598c 100644 --- a/src/applications/differential/controller/revisionview/DifferentialRevisionViewController.php +++ b/src/applications/differential/controller/revisionview/DifferentialRevisionViewController.php @@ -58,13 +58,15 @@ final class DifferentialRevisionViewController extends DifferentialController { } } + foreach ($diffs as $diff) { + if ($diff->getCreationMethod() != 'commit') { + $last_manual = $diff; + } + } + $target_manual = $target; if (!$target_id) { - foreach ($diffs as $diff) { - if ($diff->getCreationMethod() != 'commit') { - $target_manual = $diff; - } - } + $target_manual = $last_manual; } $diffs = mpull($diffs, null, 'getID'); @@ -85,7 +87,7 @@ final class DifferentialRevisionViewController extends DifferentialController { $comments = $revision->loadComments(); $comments = array_merge( - $this->getImplicitComments($revision), + $this->getImplicitComments($revision, $last_manual), $comments); $all_changesets = $changesets; @@ -362,9 +364,9 @@ final class DifferentialRevisionViewController extends DifferentialController { )); } - private function getImplicitComments(DifferentialRevision $revision) { - - $diff = $revision->loadActiveDiff(); + private function getImplicitComments( + DifferentialRevision $revision, + DifferentialDiff $diff) { $template = new DifferentialComment(); $template->setAuthorPHID($diff->getAuthorPHID());