From 1377d349e1ade80e02b689c808ba6968c4586bc5 Mon Sep 17 00:00:00 2001 From: vrana Date: Fri, 25 May 2012 01:23:26 -0700 Subject: [PATCH] Use first diff author for summary and test plan in commandeered revisions Summary: I thought about it a little bit and this makes the most sense for me: # Original author usually writes at least something and commander only updates it. # There's a creation date of revision (= first diff) by these comments. I don't want to change this date because I use this information. Author should correspond to this date. # It solves all our repros. Test Plan: Display commandeered revision. Reviewers: nh, epriestley Reviewed By: epriestley CC: aran, epriestley Differential Revision: https://secure.phabricator.com/D2577 --- .../DifferentialRevisionViewController.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/applications/differential/controller/revisionview/DifferentialRevisionViewController.php b/src/applications/differential/controller/revisionview/DifferentialRevisionViewController.php index 800cbe598c..bd56a473d0 100644 --- a/src/applications/differential/controller/revisionview/DifferentialRevisionViewController.php +++ b/src/applications/differential/controller/revisionview/DifferentialRevisionViewController.php @@ -58,15 +58,13 @@ final class DifferentialRevisionViewController extends DifferentialController { } } - foreach ($diffs as $diff) { - if ($diff->getCreationMethod() != 'commit') { - $last_manual = $diff; - } - } - $target_manual = $target; if (!$target_id) { - $target_manual = $last_manual; + foreach ($diffs as $diff) { + if ($diff->getCreationMethod() != 'commit') { + $target_manual = $diff; + } + } } $diffs = mpull($diffs, null, 'getID'); @@ -87,7 +85,7 @@ final class DifferentialRevisionViewController extends DifferentialController { $comments = $revision->loadComments(); $comments = array_merge( - $this->getImplicitComments($revision, $last_manual), + $this->getImplicitComments($revision, reset($diffs)), $comments); $all_changesets = $changesets;