Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/controller/DiffusionCommitController.php
| Show First 20 Lines • Show All 790 Lines • ▼ Show 20 Lines | private function renderAddCommentPanel( | ||||
| $loading = phutil_tag_div( | $loading = phutil_tag_div( | ||||
| 'aphront-panel-preview-loading-text', | 'aphront-panel-preview-loading-text', | ||||
| pht('Loading preview...')); | pht('Loading preview...')); | ||||
| $preview_panel = phutil_tag_div( | $preview_panel = phutil_tag_div( | ||||
| 'aphront-panel-preview aphront-panel-flush', | 'aphront-panel-preview aphront-panel-flush', | ||||
| array( | array( | ||||
| phutil_tag('div', array('id' => 'audit-preview'), $loading), | phutil_tag('div', array('id' => 'audit-preview'), $loading), | ||||
| phutil_tag('div', array('id' => 'inline-comment-preview')) | phutil_tag('div', array('id' => 'inline-comment-preview')), | ||||
| )); | )); | ||||
| // TODO: This is pretty awkward, unify the CSS between Diffusion and | // TODO: This is pretty awkward, unify the CSS between Diffusion and | ||||
| // Differential better. | // Differential better. | ||||
| require_celerity_resource('differential-core-view-css'); | require_celerity_resource('differential-core-view-css'); | ||||
| $anchor = id(new PhabricatorAnchorView()) | $anchor = id(new PhabricatorAnchorView()) | ||||
| ->setAnchorName('comment') | ->setAnchorName('comment') | ||||
| ▲ Show 20 Lines • Show All 98 Lines • ▼ Show 20 Lines | private function buildMergesTable(PhabricatorRepositoryCommit $commit) { | ||||
| $limit = 50; | $limit = 50; | ||||
| $merges = array(); | $merges = array(); | ||||
| try { | try { | ||||
| $merges = $this->callConduitWithDiffusionRequest( | $merges = $this->callConduitWithDiffusionRequest( | ||||
| 'diffusion.mergedcommitsquery', | 'diffusion.mergedcommitsquery', | ||||
| array( | array( | ||||
| 'commit' => $drequest->getCommit(), | 'commit' => $drequest->getCommit(), | ||||
| 'limit' => $limit + 1)); | 'limit' => $limit + 1, | ||||
| )); | |||||
| } catch (ConduitException $ex) { | } catch (ConduitException $ex) { | ||||
| if ($ex->getMessage() != 'ERR-UNSUPPORTED-VCS') { | if ($ex->getMessage() != 'ERR-UNSUPPORTED-VCS') { | ||||
| throw $ex; | throw $ex; | ||||
| } | } | ||||
| } | } | ||||
| if (!$merges) { | if (!$merges) { | ||||
| return null; | return null; | ||||
| ▲ Show 20 Lines • Show All 98 Lines • ▼ Show 20 Lines | private function buildRefs(DiffusionRequest $request) { | ||||
| return phutil_implode_html(', ', $ref_links); | return phutil_implode_html(', ', $ref_links); | ||||
| } | } | ||||
| private function buildRawDiffResponse(DiffusionRequest $drequest) { | private function buildRawDiffResponse(DiffusionRequest $drequest) { | ||||
| $raw_diff = $this->callConduitWithDiffusionRequest( | $raw_diff = $this->callConduitWithDiffusionRequest( | ||||
| 'diffusion.rawdiffquery', | 'diffusion.rawdiffquery', | ||||
| array( | array( | ||||
| 'commit' => $drequest->getCommit(), | 'commit' => $drequest->getCommit(), | ||||
| 'path' => $drequest->getPath())); | 'path' => $drequest->getPath(), | ||||
| )); | |||||
| $file = PhabricatorFile::buildFromFileDataOrHash( | $file = PhabricatorFile::buildFromFileDataOrHash( | ||||
| $raw_diff, | $raw_diff, | ||||
| array( | array( | ||||
| 'name' => $drequest->getCommit().'.diff', | 'name' => $drequest->getCommit().'.diff', | ||||
| 'ttl' => (60 * 60 * 24), | 'ttl' => (60 * 60 * 24), | ||||
| 'viewPolicy' => PhabricatorPolicies::POLICY_NOONE, | 'viewPolicy' => PhabricatorPolicies::POLICY_NOONE, | ||||
| )); | )); | ||||
| ▲ Show 20 Lines • Show All 115 Lines • Show Last 20 Lines | |||||