1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-10 14:51:06 +01:00

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
This commit is contained in:
vrana 2012-05-24 14:21:50 -07:00
parent 0e3aeab1b3
commit 0da0632242

View file

@ -58,13 +58,15 @@ final class DifferentialRevisionViewController extends DifferentialController {
} }
} }
$target_manual = $target;
if (!$target_id) {
foreach ($diffs as $diff) { foreach ($diffs as $diff) {
if ($diff->getCreationMethod() != 'commit') { if ($diff->getCreationMethod() != 'commit') {
$target_manual = $diff; $last_manual = $diff;
} }
} }
$target_manual = $target;
if (!$target_id) {
$target_manual = $last_manual;
} }
$diffs = mpull($diffs, null, 'getID'); $diffs = mpull($diffs, null, 'getID');
@ -85,7 +87,7 @@ final class DifferentialRevisionViewController extends DifferentialController {
$comments = $revision->loadComments(); $comments = $revision->loadComments();
$comments = array_merge( $comments = array_merge(
$this->getImplicitComments($revision), $this->getImplicitComments($revision, $last_manual),
$comments); $comments);
$all_changesets = $changesets; $all_changesets = $changesets;
@ -362,9 +364,9 @@ final class DifferentialRevisionViewController extends DifferentialController {
)); ));
} }
private function getImplicitComments(DifferentialRevision $revision) { private function getImplicitComments(
DifferentialRevision $revision,
$diff = $revision->loadActiveDiff(); DifferentialDiff $diff) {
$template = new DifferentialComment(); $template = new DifferentialComment();
$template->setAuthorPHID($diff->getAuthorPHID()); $template->setAuthorPHID($diff->getAuthorPHID());