Differential D10935 Diff 26267 src/applications/differential/controller/DifferentialRevisionViewController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/controller/DifferentialRevisionViewController.php
Show First 20 Lines • Show All 90 Lines • ▼ Show 20 Lines | public function processRequest() { | ||||
} | } | ||||
$props = id(new DifferentialDiffProperty())->loadAllWhere( | $props = id(new DifferentialDiffProperty())->loadAllWhere( | ||||
'diffID = %d', | 'diffID = %d', | ||||
$target_manual->getID()); | $target_manual->getID()); | ||||
$props = mpull($props, 'getData', 'getName'); | $props = mpull($props, 'getData', 'getName'); | ||||
$all_changesets = $changesets; | $all_changesets = $changesets; | ||||
$inlines = $this->loadInlineComments( | $inlines = $revision->loadInlineComments($all_changesets); | ||||
$revision, | |||||
$all_changesets); | |||||
$object_phids = array_merge( | $object_phids = array_merge( | ||||
$revision->getReviewers(), | $revision->getReviewers(), | ||||
$revision->getCCPHIDs(), | $revision->getCCPHIDs(), | ||||
$revision->loadCommitPHIDs(), | $revision->loadCommitPHIDs(), | ||||
array( | array( | ||||
$revision->getAuthorPHID(), | $revision->getAuthorPHID(), | ||||
$user->getPHID(), | $user->getPHID(), | ||||
▲ Show 20 Lines • Show All 529 Lines • ▼ Show 20 Lines | private function getRevisionCommentActions(DifferentialRevision $revision) { | ||||
$actions_dict = array(); | $actions_dict = array(); | ||||
foreach ($actions as $action) { | foreach ($actions as $action) { | ||||
$actions_dict[$action] = DifferentialAction::getActionVerb($action); | $actions_dict[$action] = DifferentialAction::getActionVerb($action); | ||||
} | } | ||||
return $actions_dict; | return $actions_dict; | ||||
} | } | ||||
private function loadInlineComments( | |||||
DifferentialRevision $revision, | |||||
array &$changesets) { | |||||
assert_instances_of($changesets, 'DifferentialChangeset'); | |||||
$inline_comments = array(); | |||||
$inline_comments = id(new DifferentialInlineCommentQuery()) | |||||
->withRevisionIDs(array($revision->getID())) | |||||
->withNotDraft(true) | |||||
->execute(); | |||||
$load_changesets = array(); | |||||
foreach ($inline_comments as $inline) { | |||||
$changeset_id = $inline->getChangesetID(); | |||||
if (isset($changesets[$changeset_id])) { | |||||
continue; | |||||
} | |||||
$load_changesets[$changeset_id] = true; | |||||
} | |||||
$more_changesets = array(); | |||||
if ($load_changesets) { | |||||
$changeset_ids = array_keys($load_changesets); | |||||
$more_changesets += id(new DifferentialChangeset()) | |||||
->loadAllWhere( | |||||
'id IN (%Ld)', | |||||
$changeset_ids); | |||||
} | |||||
if ($more_changesets) { | |||||
$changesets += $more_changesets; | |||||
$changesets = msort($changesets, 'getSortKey'); | |||||
} | |||||
return $inline_comments; | |||||
} | |||||
private function loadChangesetsAndVsMap( | private function loadChangesetsAndVsMap( | ||||
DifferentialDiff $target, | DifferentialDiff $target, | ||||
DifferentialDiff $diff_vs = null, | DifferentialDiff $diff_vs = null, | ||||
PhabricatorRepository $repository = null) { | PhabricatorRepository $repository = null) { | ||||
$load_diffs = array($target); | $load_diffs = array($target); | ||||
if ($diff_vs) { | if ($diff_vs) { | ||||
$load_diffs[] = $diff_vs; | $load_diffs[] = $diff_vs; | ||||
▲ Show 20 Lines • Show All 268 Lines • Show Last 20 Lines |