Page MenuHomePhorge

final class ArcanistDiffParser
libphutil Technical Documentation (Parsers)

Parses diffs from a working copy.

Methods

public function __get($name)
Inherited

This method is not documented.
Parameters
$name
Return
wild

public function __set($name, $value)
Inherited

This method is not documented.
Parameters
$name
$value
Return
wild

public function current()
Inherited

This method is not documented.
Return
wild

public function key()
Inherited

This method is not documented.
Return
wild

public function next()
Inherited

This method is not documented.
Return
wild

public function rewind()
Inherited

This method is not documented.
Return
wild

public function valid()
Inherited

This method is not documented.
Return
wild

private function throwOnAttemptedIteration()
Inherited

This method is not documented.
Return
wild

public function getPhobjectClassConstant($key, $byte_limit)
Inherited

Phobject

Read the value of a class constant.

This is the same as just typing self::CONSTANTNAME, but throws a more useful message if the constant is not defined and allows the constant to be limited to a maximum length.

Parameters
string$keyName of the constant.
int|null$byte_limitMaximum number of bytes permitted in the value.
Return
stringValue of the constant.

public function setRepositoryAPI($repository_api)

This method is not documented.
Parameters
ArcanistRepositoryAPI$repository_api
Return
wild

public function setDetectBinaryFiles($detect)

This method is not documented.
Parameters
$detect
Return
wild

public function setTryEncoding($encoding)

This method is not documented.
Parameters
$encoding
Return
wild

public function forcePath($path)

This method is not documented.
Parameters
$path
Return
wild

public function setChanges($changes)

This method is not documented.
Parameters
array$changes
Return
wild

public function parseSubversionDiff($api, $paths)

This method is not documented.
Parameters
ArcanistSubversionAPI$api
$paths
Return
wild

public function parseDiff($diff)

This method is not documented.
Parameters
$diff
Return
wild

protected function tryMatchHeader($patterns, $line, &$match)

This method is not documented.
Parameters
$patterns
$line
&$match
Return
wild

protected function parseCommitMessage($change)

This method is not documented.
Parameters
ArcanistDiffChange$change
Return
wild

protected function parsePropertyHunk($change)

Parse an SVN property change hunk. These hunks are ambiguous so just sort of try to get it mostly right. It's entirely possible to foil this parser (or any other parser) with a carefully constructed property change.

Parameters
ArcanistDiffChange$change
Return
wild

private function parseSVNPropertyChange($op, $prop)

This method is not documented.
Parameters
$op
$prop
Return
wild

protected function setIsGit($git)

This method is not documented.
Parameters
$git
Return
wild

protected function getIsGit()

This method is not documented.
Return
wild

public function setIsMercurial($is_mercurial)

This method is not documented.
Parameters
$is_mercurial
Return
wild

public function getIsMercurial()

This method is not documented.
Return
wild

protected function parseIndexHunk($change)

This method is not documented.
Parameters
ArcanistDiffChange$change
Return
wild

private function parseGitBinaryPatch()

This method is not documented.
Return
wild

protected function parseHunkTarget()

This method is not documented.
Return
wild

protected function markBinary($change)

This method is not documented.
Parameters
ArcanistDiffChange$change
Return
wild

protected function parseChangeset($change)

This method is not documented.
Parameters
ArcanistDiffChange$change
Return
wild

protected function buildChange($path)

This method is not documented.
Parameters
$path
Return
wild

protected function didStartParse($text)

This method is not documented.
Parameters
$text
Return
wild

protected function getLine()

This method is not documented.
Return
wild

protected function getLineTrimmed()

This method is not documented.
Return
wild

protected function nextLine()

This method is not documented.
Return
wild

protected function nextLineTrimmed()

This method is not documented.
Return
wild

protected function nextNonemptyLine()

This method is not documented.
Return
wild

protected function nextLineThatLooksLikeDiffStart()

This method is not documented.
Return
wild

protected function saveLine()

This method is not documented.
Return
wild

protected function restoreLine()

This method is not documented.
Return
wild

protected function isFirstNonEmptyLine()

This method is not documented.
Return
wild

protected function didFinishParse()

This method is not documented.
Return
wild

public function setWriteDiffOnFailure($write)

This method is not documented.
Parameters
$write
Return
wild

protected function didFailParse($message)

This method is not documented.
Parameters
$message
Return
wild

private static function unescapeFilename($name)

Unescape escaped filenames, e.g. from "git diff".

Parameters
$name
Return
wild

private function loadSyntheticData()

This method is not documented.
Return
wild

public static function extractGitCommonFilename($paths)

Extracts the common filename from two strings with differing path prefixes as found after diff --git. These strings may be quoted; if so, the filename is returned unescaped. The prefixes default to "a/" and "b/", but may be any string -- or may be entierly absent. This function may return "null" if the hunk represents a file move or copy, and with pathological renames may return an incorrect value. Such cases are expected to be recovered by later rename detection codepaths.

Parameters
string$pathsText from a diff line after "diff --git ".
Return
stringFilename being altered, or null for a rename.

private function stripGitFormatPatch($diff)

Strip the header and footer off a git-format-patch diff.

Returns a parseable normal diff and a textual commit message.

Parameters
$diff
Return
wild