Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/controller/DiffusionHistoryController.php
| Show All 29 Lines | public function handleRequest(AphrontRequest $request) { | ||||
| $history_results = $this->callConduitWithDiffusionRequest( | $history_results = $this->callConduitWithDiffusionRequest( | ||||
| 'diffusion.historyquery', | 'diffusion.historyquery', | ||||
| $params); | $params); | ||||
| $history = DiffusionPathChange::newFromConduit( | $history = DiffusionPathChange::newFromConduit( | ||||
| $history_results['pathChanges']); | $history_results['pathChanges']); | ||||
| $history = $pager->sliceResults($history); | $history = $pager->sliceResults($history); | ||||
| $history_list = id(new DiffusionHistoryListView()) | $identifiers = array(); | ||||
| foreach ($history as $item) { | |||||
| $identifiers[] = $item->getCommitIdentifier(); | |||||
| } | |||||
| if ($identifiers) { | |||||
| $commits = id(new DiffusionCommitQuery()) | |||||
| ->setViewer($viewer) | |||||
| ->withRepositoryPHIDs(array($repository->getPHID())) | |||||
| ->withIdentifiers($identifiers) | |||||
| ->needCommitData(true) | |||||
| ->needIdentities(true) | |||||
| ->execute(); | |||||
| } else { | |||||
| $commits = array(); | |||||
| } | |||||
| $history_list = id(new DiffusionCommitGraphView()) | |||||
| ->setViewer($viewer) | ->setViewer($viewer) | ||||
| ->setParents($history_results['parents']) | |||||
| ->setIsHead(!$pager->getOffset()) | |||||
| ->setIsTail(!$pager->getHasMorePages()) | |||||
| ->setDiffusionRequest($drequest) | ->setDiffusionRequest($drequest) | ||||
| ->setHistory($history); | ->setHistory($history) | ||||
| ->setCommits($commits); | |||||
| $header = $this->buildHeader($drequest); | $header = $this->buildHeader($drequest); | ||||
| $crumbs = $this->buildCrumbs( | $crumbs = $this->buildCrumbs( | ||||
| array( | array( | ||||
| 'branch' => true, | 'branch' => true, | ||||
| 'path' => true, | 'path' => true, | ||||
| 'view' => 'history', | 'view' => 'history', | ||||
| ▲ Show 20 Lines • Show All 60 Lines • Show Last 20 Lines | |||||