Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/parser/DifferentialChangesetParser.php
Show First 20 Lines • Show All 862 Lines • ▼ Show 20 Lines | $renderer = $this->getRenderer() | ||||
->setNewLines($this->new) | ->setNewLines($this->new) | ||||
->setOriginalCharacterEncoding($encoding) | ->setOriginalCharacterEncoding($encoding) | ||||
->setShowEditAndReplyLinks($this->getShowEditAndReplyLinks()) | ->setShowEditAndReplyLinks($this->getShowEditAndReplyLinks()) | ||||
->setCanMarkDone($this->getCanMarkDone()) | ->setCanMarkDone($this->getCanMarkDone()) | ||||
->setObjectOwnerPHID($this->getObjectOwnerPHID()) | ->setObjectOwnerPHID($this->getObjectOwnerPHID()) | ||||
->setHighlightingDisabled($this->highlightingDisabled) | ->setHighlightingDisabled($this->highlightingDisabled) | ||||
->setDepthOnlyLines($this->getDepthOnlyLines()); | ->setDepthOnlyLines($this->getDepthOnlyLines()); | ||||
$engine_blocks = $this->newDocumentEngineBlocks(); | list($engine, $old_ref, $new_ref) = $this->newDocumentEngine(); | ||||
if ($engine) { | |||||
$engine_blocks = $engine->newEngineBlocks( | |||||
$old_ref, | |||||
$new_ref); | |||||
} else { | |||||
$engine_blocks = null; | |||||
} | |||||
$has_document_engine = ($engine_blocks !== null); | $has_document_engine = ($engine_blocks !== null); | ||||
$shield = null; | $shield = null; | ||||
if ($this->isTopLevel && !$this->comments && !$has_document_engine) { | if ($this->isTopLevel && !$this->comments && !$has_document_engine) { | ||||
if ($this->isGenerated()) { | if ($this->isGenerated()) { | ||||
$shield = $renderer->renderShield( | $shield = $renderer->renderShield( | ||||
pht( | pht( | ||||
'This file contains generated code, which does not normally '. | 'This file contains generated code, which does not normally '. | ||||
▲ Show 20 Lines • Show All 158 Lines • ▼ Show 20 Lines | if ($engine_blocks !== null) { | ||||
} | } | ||||
// If we don't have an explicit "vs" changeset, it's the left side of | // If we don't have an explicit "vs" changeset, it's the left side of | ||||
// the "id" changeset. | // the "id" changeset. | ||||
if (!$vs) { | if (!$vs) { | ||||
$vs = $id; | $vs = $id; | ||||
} | } | ||||
$renderer->setDocumentEngineBlocks($engine_blocks); | $renderer | ||||
->setDocumentEngine($engine) | |||||
->setDocumentEngineBlocks($engine_blocks); | |||||
return $renderer->renderDocumentEngineBlocks( | return $renderer->renderDocumentEngineBlocks( | ||||
$engine_blocks, | $engine_blocks, | ||||
(string)$id, | (string)$id, | ||||
(string)$vs); | (string)$vs); | ||||
} | } | ||||
// If we've made it here with a type of file we don't know how to render, | // If we've made it here with a type of file we don't know how to render, | ||||
▲ Show 20 Lines • Show All 597 Lines • ▼ Show 20 Lines | if ($fast_path) { | ||||
} | } | ||||
$line = implode('', $line); | $line = implode('', $line); | ||||
} | } | ||||
return $prefix.$line; | return $prefix.$line; | ||||
} | } | ||||
private function newDocumentEngineBlocks() { | private function newDocumentEngine() { | ||||
$changeset = $this->changeset; | $changeset = $this->changeset; | ||||
$viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
// TODO: This should probably be made non-optional in the future. | // TODO: This should probably be made non-optional in the future. | ||||
if (!$viewer) { | if (!$viewer) { | ||||
return null; | return null; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | if (strlen($engine_key)) { | ||||
} else { | } else { | ||||
$document_engine = null; | $document_engine = null; | ||||
} | } | ||||
} else { | } else { | ||||
$document_engine = head($shared_engines); | $document_engine = head($shared_engines); | ||||
} | } | ||||
if ($document_engine) { | if ($document_engine) { | ||||
return $document_engine->newEngineBlocks( | return array( | ||||
$document_engine, | |||||
$old_ref, | $old_ref, | ||||
$new_ref); | $new_ref); | ||||
} | } | ||||
return null; | return null; | ||||
} | } | ||||
private function loadFileObjectsForChangeset() { | private function loadFileObjectsForChangeset() { | ||||
▲ Show 20 Lines • Show All 70 Lines • Show Last 20 Lines |