Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/parser/DifferentialChangesetParser.php
Show First 20 Lines • Show All 746 Lines • ▼ Show 20 Lines | private function shouldRenderPropertyChangeHeader($changeset) { | ||||
return true; | return true; | ||||
} | } | ||||
public function render( | public function render( | ||||
$range_start = null, | $range_start = null, | ||||
$range_len = null, | $range_len = null, | ||||
$mask_force = array()) { | $mask_force = array()) { | ||||
$viewer = $this->getViewer(); | |||||
$renderer = $this->getRenderer(); | $renderer = $this->getRenderer(); | ||||
if (!$renderer) { | if (!$renderer) { | ||||
$renderer = $this->newRenderer(); | $renderer = $this->newRenderer(); | ||||
$this->setRenderer($renderer); | $this->setRenderer($renderer); | ||||
} | } | ||||
// "Top level" renders are initial requests for the whole file, versus | // "Top level" renders are initial requests for the whole file, versus | ||||
// requests for a specific range generated by clicking "show more". We | // requests for a specific range generated by clicking "show more". We | ||||
▲ Show 20 Lines • Show All 85 Lines • ▼ Show 20 Lines | if ($engine) { | ||||
$old_ref, | $old_ref, | ||||
$new_ref); | $new_ref); | ||||
} else { | } else { | ||||
$engine_blocks = null; | $engine_blocks = null; | ||||
} | } | ||||
$has_document_engine = ($engine_blocks !== null); | $has_document_engine = ($engine_blocks !== null); | ||||
// Remove empty comments that don't have any unsaved draft data. | |||||
PhabricatorInlineComment::loadAndAttachVersionedDrafts( | |||||
$viewer, | |||||
$this->comments); | |||||
foreach ($this->comments as $key => $comment) { | |||||
if ($comment->isVoidComment($viewer)) { | |||||
unset($this->comments[$key]); | |||||
} | |||||
} | |||||
// See T13515. Sometimes, we collapse file content by default: for | // See T13515. Sometimes, we collapse file content by default: for | ||||
// example, if the file is marked as containing generated code. | // example, if the file is marked as containing generated code. | ||||
// If a file has inline comments, that normally means we never collapse | // If a file has inline comments, that normally means we never collapse | ||||
// it. However, if the viewer has already collapsed all of the inlines, | // it. However, if the viewer has already collapsed all of the inlines, | ||||
// it's fine to collapse the file. | // it's fine to collapse the file. | ||||
$expanded_comments = array(); | $expanded_comments = array(); | ||||
▲ Show 20 Lines • Show All 181 Lines • ▼ Show 20 Lines | if ($this->comments) { | ||||
$final = max(1, $final); | $final = max(1, $final); | ||||
if ($this->isCommentOnRightSideWhenDisplayed($comment)) { | if ($this->isCommentOnRightSideWhenDisplayed($comment)) { | ||||
$new_comments[$final][] = $comment; | $new_comments[$final][] = $comment; | ||||
} else { | } else { | ||||
$old_comments[$final][] = $comment; | $old_comments[$final][] = $comment; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
$renderer | $renderer | ||||
->setOldComments($old_comments) | ->setOldComments($old_comments) | ||||
->setNewComments($new_comments); | ->setNewComments($new_comments); | ||||
if ($engine_blocks !== null) { | if ($engine_blocks !== null) { | ||||
$reference = $this->getRenderingReference(); | $reference = $this->getRenderingReference(); | ||||
$parts = explode('/', $reference); | $parts = explode('/', $reference); | ||||
if (count($parts) == 2) { | if (count($parts) == 2) { | ||||
▲ Show 20 Lines • Show All 835 Lines • Show Last 20 Lines |