Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/controller/DiffusionCommitController.php
| Show First 20 Lines • Show All 1,021 Lines • ▼ Show 20 Lines | private function buildCurtain( | ||||
| if ($relationship_submenu) { | if ($relationship_submenu) { | ||||
| $curtain->addAction($relationship_submenu); | $curtain->addAction($relationship_submenu); | ||||
| } | } | ||||
| return $curtain; | return $curtain; | ||||
| } | } | ||||
| private function buildRawDiffResponse(DiffusionRequest $drequest) { | private function buildRawDiffResponse(DiffusionRequest $drequest) { | ||||
| $raw_diff = $this->callConduitWithDiffusionRequest( | $diff_info = $this->callConduitWithDiffusionRequest( | ||||
| 'diffusion.rawdiffquery', | 'diffusion.rawdiffquery', | ||||
| array( | array( | ||||
| 'commit' => $drequest->getCommit(), | 'commit' => $drequest->getCommit(), | ||||
| 'path' => $drequest->getPath(), | 'path' => $drequest->getPath(), | ||||
| )); | )); | ||||
| $file = PhabricatorFile::buildFromFileDataOrHash( | $file_phid = $diff_info['filePHID']; | ||||
| $raw_diff, | |||||
| array( | |||||
| 'name' => $drequest->getCommit().'.diff', | |||||
| 'ttl' => (60 * 60 * 24), | |||||
| 'viewPolicy' => PhabricatorPolicies::POLICY_NOONE, | |||||
| )); | |||||
| $unguarded = AphrontWriteGuard::beginScopedUnguardedWrites(); | $file = id(new PhabricatorFileQuery()) | ||||
| $file->attachToObject($drequest->getRepository()->getPHID()); | ->setViewer($this->getViewer()) | ||||
| unset($unguarded); | ->withPHIDs(array($file_phid)) | ||||
| ->executeOne(); | |||||
| if (!$file) { | |||||
| throw new Exception( | |||||
| pht( | |||||
| 'Failed to load file ("%s") returned by "%s".', | |||||
| $file_phid, | |||||
| 'diffusion.rawdiffquery')); | |||||
| } | |||||
| return $file->getRedirectResponse(); | return $file->getRedirectResponse(); | ||||
| } | } | ||||
| private function renderAuditStatusView(array $audit_requests) { | private function renderAuditStatusView(array $audit_requests) { | ||||
| assert_instances_of($audit_requests, 'PhabricatorRepositoryAuditRequest'); | assert_instances_of($audit_requests, 'PhabricatorRepositoryAuditRequest'); | ||||
| $viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
| ▲ Show 20 Lines • Show All 278 Lines • Show Last 20 Lines | |||||