Page MenuHomePhorge
Diviner libphutil Tech Docs ArcanistMercurialParser

final class ArcanistMercurialParser
libphutil Technical Documentation ()

Parses output from various "hg" commands into structured data. This class provides low-level APIs for reading "hg" output.

Tasks

Parsing "hg" Output

  • public static function parseMercurialStatusDetails($stdout) — Parse the output of "hg status". This provides detailed information, you can get less detailed information with @{method:parseMercurialStatus}. In particular, this will parse copy sources as per "hg status -C".
  • public static function parseMercurialStatus($stdout) — Parse the output of "hg status". This provides only basic information, you can get more detailed information by invoking @{method:parseMercurialStatusDetails}.
  • public static function parseMercurialLog($stdout) — Parse the output of "hg log". This also parses "hg outgoing", "hg parents", and other similar commands. This assumes "--style default".
  • public static function parseMercurialBranches($stdout) — Parse the output of "hg branches".

Other Methods

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 static function parseMercurialStatusDetails($stdout)

Parse the output of "hg status". This provides detailed information, you can get less detailed information with parseMercurialStatus(). In particular, this will parse copy sources as per "hg status -C".

Parameters
string$stdoutThe stdout from running an "hg status" command.
Return
dictMap of paths to status dictionaries.

public static function parseMercurialStatus($stdout)

Parse the output of "hg status". This provides only basic information, you can get more detailed information by invoking parseMercurialStatusDetails().

Parameters
string$stdoutThe stdout from running an "hg status" command.
Return
dictMap of paths to ArcanistRepositoryAPI status flags.

public static function parseMercurialLog($stdout)

Parse the output of "hg log". This also parses "hg outgoing", "hg parents", and other similar commands. This assumes "--style default".

Parameters
string$stdoutThe stdout from running an "hg log" command.
Return
listList of dictionaries with commit information.

public static function parseMercurialBranches($stdout)

Parse the output of "hg branches".

Parameters
string$stdoutThe stdout from running an "hg branches" command.
Return
listA list of dictionaries with branch information.