Differential D21233 Diff 50569 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 44 Lines • ▼ Show 20 Lines | if ($changeset_ids) { | ||||
->withIDs($changeset_ids) | ->withIDs($changeset_ids) | ||||
->execute(); | ->execute(); | ||||
$changesets = mpull($changesets, null, 'getID'); | $changesets = mpull($changesets, null, 'getID'); | ||||
} else { | } else { | ||||
$changesets = array(); | $changesets = array(); | ||||
} | } | ||||
foreach ($inlines as $key => $inline) { | foreach ($inlines as $key => $inline) { | ||||
$inlines[$key] = DifferentialInlineComment::newFromModernComment( | $inlines[$key] = $inline->newInlineCommentObject(); | ||||
$inline); | |||||
} | } | ||||
$query = id(new DifferentialInlineCommentQuery()) | |||||
->needHidden(true) | |||||
->setViewer($viewer); | |||||
// 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. | ||||
$query->adjustInlinesForChangesets( | |||||
$inlines, | $old = array_select_keys($changesets, $old_ids); | ||||
array_select_keys($changesets, $old_ids), | $new = array_select_keys($changesets, $new_ids); | ||||
array_select_keys($changesets, $new_ids), | id(new PhabricatorInlineCommentAdjustmentEngine()) | ||||
$revision); | ->setViewer($viewer) | ||||
->setRevision($revision) | |||||
->setOldChangesets($old) | |||||
->setNewChangesets($new) | |||||
->setInlines($inlines) | |||||
->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); | ||||
} | } | ||||
} | } |