Differential D21491 Diff 51151 src/applications/differential/engine/DifferentialRevisionTimelineEngine.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/engine/DifferentialRevisionTimelineEngine.php
Show First 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | protected function newTimelineView() { | ||||
foreach ($inlines as $key => $inline) { | foreach ($inlines as $key => $inline) { | ||||
$inlines[$key] = $inline->newInlineCommentObject(); | $inlines[$key] = $inline->newInlineCommentObject(); | ||||
} | } | ||||
// NOTE: This is a bit sketchy: this method adjusts the inlines as a | // NOTE: This is a bit sketchy: this method adjusts the inlines as a | ||||
// side effect, which means it will ultimately adjust the transaction | // side effect, which means it will ultimately adjust the transaction | ||||
// comments and affect timeline rendering. | // comments and affect timeline rendering. | ||||
if (!empty($new)) { | |||||
$old = array_select_keys($changesets, $old_ids); | $old = array_select_keys($changesets, $old_ids); | ||||
$new = array_select_keys($changesets, $new_ids); | $new = array_select_keys($changesets, $new_ids); | ||||
id(new PhabricatorInlineCommentAdjustmentEngine()) | id(new PhabricatorInlineCommentAdjustmentEngine()) | ||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
->setRevision($revision) | ->setRevision($revision) | ||||
->setOldChangesets($old) | ->setOldChangesets($old) | ||||
->setNewChangesets($new) | ->setNewChangesets($new) | ||||
->setInlines($inlines) | ->setInlines($inlines) | ||||
->execute(); | ->execute(); | ||||
} | |||||
return id(new DifferentialTransactionView()) | return id(new DifferentialTransactionView()) | ||||
->setViewData($view_data) | ->setViewData($view_data) | ||||
->setChangesets($changesets) | ->setChangesets($changesets) | ||||
->setRevision($revision) | ->setRevision($revision) | ||||
->setLeftDiff($left_diff) | ->setLeftDiff($left_diff) | ||||
->setRightDiff($right_diff); | ->setRightDiff($right_diff); | ||||
} | } | ||||
} | } |