public function setRange($start, $end)
$start | ||
$end |
wild |
public function setMask($mask)
array | $mask |
wild |
public function renderChangeset()
wild |
public function setShowEditAndReplyLinks($bool)
$bool |
wild |
public function getShowEditAndReplyLinks()
wild |
public function setViewState($view_state)
PhabricatorChangesetViewState | $view_state |
wild |
public function getViewState()
wild |
public function setRenderer($renderer)
DifferentialChangesetRenderer | $renderer |
wild |
public function getRenderer()
wild |
public function setDisableCache($disable_cache)
$disable_cache |
wild |
public function getDisableCache()
wild |
public function setCanMarkDone($can_mark_done)
$can_mark_done |
wild |
public function getCanMarkDone()
wild |
public function setObjectOwnerPHID($phid)
$phid |
wild |
public function getObjectOwnerPHID()
wild |
public function setOffsetMode($offset_mode)
$offset_mode |
wild |
public function getOffsetMode()
wild |
public function setViewer($viewer)
PhabricatorUser | $viewer |
wild |
public function getViewer()
wild |
private function newRenderer()
wild |
public function setOldLines($lines)
array | $lines |
wild |
public function setNewLines($lines)
array | $lines |
wild |
public function setSpecialAttributes($attributes)
array | $attributes |
wild |
public function setIntraLineDiffs($diffs)
array | $diffs |
wild |
public function setDepthOnlyLines($lines)
array | $lines |
wild |
public function getDepthOnlyLines()
wild |
public function setVisibleLinesMask($mask)
array | $mask |
wild |
public function setLinesOfContext($lines_of_context)
$lines_of_context |
wild |
public function getLinesOfContext()
wild |
public function setRightSideCommentMapping($id, $is_new)
Configure which Changeset comments added to the right side of the visible diff will be attached to. The ID must be the ID of a real Differential Changeset.
The complexity here is that we may show an arbitrary side of an arbitrary changeset as either the left or right part of a diff. This method allows the left and right halves of the displayed diff to be correctly mapped to storage changesets.
id | $id | The Differential Changeset ID that comments added to the right side of the visible diff should be attached to. |
bool | $is_new | If true, attach new comments to the right side of the storage changeset. Note that this may be false, if the left side of some storage changeset is being shown as the right side of a display diff. |
this |
public function setLeftSideCommentMapping($id, $is_new)
See setRightSideCommentMapping(), but this sets information for the left side of the display diff.
$id | ||
$is_new |
wild |
public function setOriginals($left, $right)
DifferentialChangeset | $left | |
DifferentialChangeset | $right |
wild |
public function diffOriginals()
wild |
public function setRenderCacheKey($key)
Set a key for identifying this changeset in the render cache. If set, the parser will attempt to use the changeset render cache, which can improve performance for frequently-viewed changesets.
By default, there is no render cache key and parsers do not use the cache. This is appropriate for rarely-viewed changesets.
string | $key | Key for identifying this changeset in the render cache. |
this |
private function getRenderCacheKey()
wild |
public function setChangeset($changeset)
DifferentialChangeset | $changeset |
wild |
public function setRenderingReference($ref)
$ref |
wild |
private function getRenderingReference()
wild |
public function getChangeset()
wild |
public function setFilename($filename)
$filename |
wild |
public function setHandles($handles)
array | $handles |
wild |
public function setMarkupEngine($engine)
PhabricatorMarkupEngine | $engine |
wild |
public function setCoverage($coverage)
$coverage |
wild |
private function getCoverage()
wild |
public function parseInlineComment($comment)
PhabricatorInlineComment | $comment |
wild |
private function loadCache()
wild |
protected static function getCacheableProperties()
wild |
public function saveCache()
wild |
private function markGenerated($new_corpus_block)
$new_corpus_block |
wild |
public function isGenerated()
wild |
public function isDeleted()
wild |
public function isUnchanged()
wild |
public function isMoveAway()
wild |
private function applyIntraline(&$render, $intra, $corpus)
&$render | ||
$intra | ||
$corpus |
wild |
private function getHighlightFuture($corpus)
$corpus |
wild |
protected function processHighlightedSource($data, $result)
$data | ||
$result |
wild |
private function tryCacheStuff()
wild |
private function process()
wild |
private function shouldRenderPropertyChangeHeader($changeset)
$changeset |
wild |
public function render($range_start, $range_len, $mask_force)
$range_start | ||
$range_len | ||
$mask_force |
wild |
private function calculateGapsAndMask($mask_force, $feedback_mask, $range_start, $range_len)
This function calculates a lot of stuff we need to know to display the diff:
Gaps - compute gaps in the visible display diff, where we will render "Show more context" spacers. If a gap is smaller than the context size, we just display it. Otherwise, we record it into $gaps and will render a "show more context" element instead of diff text below. A given $gap is a tuple of $gap_line_number_start and $gap_length.
Mask - compute the actual lines that need to be shown (because they are near changes lines, near inline comments, or the request has explicitly asked for them, i.e. resulting from the user clicking "show more"). The $mask returned is a sparsely populated dictionary of $visible_line_number => true.
$mask_force | ||
$feedback_mask | ||
$range_start | ||
$range_len |
array($gaps, $mask) |
private function isCommentVisibleOnRenderedDiff($comment)
Determine if an inline comment will appear on the rendered diff, taking into consideration which halves of which changesets will actually be shown.
PhabricatorInlineComment | $comment | Comment to test for visibility. |
bool | True if the comment is visible on the rendered diff. |
private function isCommentOnRightSideWhenDisplayed($comment)
Determine if a comment will appear on the right side of the display diff. Note that the comment must appear somewhere on the rendered changeset, as per isCommentVisibleOnRenderedDiff().
PhabricatorInlineComment | $comment | Comment to test for display location. |
bool | True for right, false for left. |
public static function parseRangeSpecification($spec)
Parse the 'range' specification that this class and the client-side JS emit to indicate that a user clicked "Show more..." on a diff. Generally, use is something like this:
$spec = $request->getStr('range'); $parsed = DifferentialChangesetParser::parseRangeSpecification($spec); list($start, $end, $mask) = $parsed; $parser->render($start, $end, $mask);
string | $spec | Range specification, indicating the range of the diff that should be rendered. |
tuple | List of <start, end, mask> suitable for passing to @{method:render}. |
public function renderModifiedCoverage()
Render "modified coverage" information; test coverage on modified lines. This synthesizes diff information with unit test information into a useful indicator of how well tested a change is.
wild |
private function buildLineBackmaps()
Build maps from lines comments appear on to actual lines.
wild |
private function getOffset($map, $line)
array | $map | |
$line |
wild |
private function realignDiff($changeset, $hunk_parser)
DifferentialChangeset | $changeset | |
DifferentialHunkParser | $hunk_parser |
wild |
private function adjustRenderedLineForDisplay($line)
$line |
wild |
private function newSuspiciousCharacterRules()
wild |
public static function replaceTabsWithSpaces($line, $tab_width)
$line | ||
$tab_width |
wild |
private function newDocumentEngine()
wild |
private function loadFileObjectsForChangeset()
wild |
public function newChangesetResponse()
wild |
private function getRawDocumentEngineData($lines)
array | $lines |
wild |