Page MenuHomePhorge
Diviner libphutil Tech Docs ArcanistMercurialAPI

final class ArcanistMercurialAPI
libphutil Technical Documentation ()

Interfaces with the Mercurial working copies.

Tasks

Path Status

Other Methods

scratch

  • public function readScratchFile($path) — Try to read a scratch file, if it exists and is readable.
  • public function writeScratchFile($path, $data) — Try to write a scratch file, if there's somewhere to put it and we can write there.
  • public function removeScratchFile($path) — Try to remove a scratch file.
  • public function getReadableScratchFilePath($path) — Get a human-readable description of the scratch file location.
  • public function getScratchFilePath($path) — Get the path to a scratch file, if possible.

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 getSourceControlSystemName()

This method is not documented.
Return
wild

public function getDiffLinesOfContext()
Inherited

This method is not documented.
Return
wild

public function setDiffLinesOfContext($lines)
Inherited

This method is not documented.
Parameters
$lines
Return
wild

public function getWorkingCopyIdentity()
Inherited

This method is not documented.
Return
wild

public function getConfigurationManager()
Inherited

This method is not documented.
Return
wild

public static function newAPIFromConfigurationManager($configuration_manager)
Inherited

This method is not documented.
Parameters
ArcanistConfigurationManager$configuration_manager
Return
wild

public function __construct($path)
Inherited

This method is not documented.
Parameters
$path
Return
this//Implicit.//

public function getPath($to_file)
Inherited

This method is not documented.
Parameters
$to_file
Return
wild

protected function buildUncommittedStatus()

This method is not documented.
Return
wild

protected function buildCommitRangeStatus()

This method is not documented.
Return
wild

final public function getUncommittedStatus()
Inherited

ArcanistRepositoryAPI

Get a list of uncommitted paths in the working copy that have been changed or are affected by other status effects, like conflicts or untracked files.

Convenience methods getUntrackedChanges(), getUnstagedChanges(), getUncommittedChanges(), getMergeConflicts(), and getIncompleteChanges() allow simpler selection of paths in a specific state.

This method returns a map of paths to bitmasks with status, using FLAG_ constants. For example:

array(
  'some/uncommitted/file.txt' => ArcanistRepositoryAPI::FLAG_UNSTAGED,
);

A file may be in several states. Not all states are possible with all version control systems.

Return
map<string, bitmask>Map of paths, see above.

final public function getUntrackedChanges()
Inherited

This method is not documented.
Return
wild

final public function getUnstagedChanges()
Inherited

This method is not documented.
Return
wild

final public function getUncommittedChanges()
Inherited

This method is not documented.
Return
wild

final public function getMergeConflicts()
Inherited

This method is not documented.
Return
wild

final public function getIncompleteChanges()
Inherited

This method is not documented.
Return
wild

final public function getMissingChanges()
Inherited

This method is not documented.
Return
wild

final public function getDirtyExternalChanges()
Inherited

This method is not documented.
Return
wild

private function getUncommittedPathsWithMask($mask)
Inherited

This method is not documented.
Parameters
$mask
Return
wild

final public function getCommitRangeStatus()
Inherited

ArcanistRepositoryAPI

Get a list of paths affected by the commits in the current commit range.

See getUncommittedStatus() for a description of the return value.

Return
map<string, bitmask>Map from paths to status.

final public function getWorkingCopyStatus()
Inherited

ArcanistRepositoryAPI

Get a list of paths affected by commits in the current commit range, or uncommitted changes in the working copy. See getUncommittedStatus() or getCommitRangeStatus() to retrieve smaller parts of the status.

See getUncommittedStatus() for a description of the return value.

Return
map<string, bitmask>Map from paths to status.

final public function reloadWorkingCopy()
Inherited

ArcanistRepositoryAPI

Drops caches after changes to the working copy. By default, some queries against the working copy are cached. They

Return
this

protected function didReloadWorkingCopy()

ArcanistRepositoryAPI

Hook for implementations to dirty working copy caches after the working copy has been updated.

ArcanistMercurialAPI
This method is not documented.
Return
void

public function getBulkOriginalFileData($paths)

ArcanistRepositoryAPI

Fetches the original file data for each path provided.

ArcanistMercurialAPI
This method is not documented.
Parameters
$paths
Return
map<string, string>Map from path to file data.

public function getBulkCurrentFileData($paths)

ArcanistRepositoryAPI

Fetches the current file data for each path provided.

ArcanistMercurialAPI
This method is not documented.
Parameters
$paths
Return
map<string, string>Map from path to file data.

public function getAllFiles()

This method is not documented.
Return
Traversable

public function getBlame($path)

This method is not documented.
Parameters
$path
Return
wild

public function getRawDiffText($path)

This method is not documented.
Parameters
$path
Return
wild

public function getOriginalFileData($path)

This method is not documented.
Parameters
$path
Return
wild

public function getCurrentFileData($path)

This method is not documented.
Parameters
$path
Return
wild

public function getLocalCommitInformation()

This method is not documented.
Return
wild
This method is not documented.
Return
wild

public function getCanonicalRevisionName($string)

This method is not documented.
Parameters
$string
Return
wild

public function getBranchName()

This method is not documented.
Return
wild

public function getSourceControlPath()

This method is not documented.
Return
wild

public function isHistoryDefaultImmutable()

This method is not documented.
Return
wild

public function supportsAmend()

This method is not documented.
Return
wild

public function getWorkingCopyRevision()

This method is not documented.
Return
wild

public function updateWorkingCopy()

This method is not documented.
Return
wild

public function getMetadataPath()

This method is not documented.
Return
wild

public function loadWorkingCopyDifferentialRevisions($conduit, $query)

This method is not documented.
Parameters
ConduitClient$conduit
array$query
Return
wild

public function getRemoteURI()

This method is not documented.
Return
wild

public function getChangedFiles($since_commit)

This method is not documented.
Parameters
$since_commit
Return
wild

public function getAuthor()

This method is not documented.
Return
wild

public function addToCommit($paths)

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

public function supportsLocalCommits()

This method is not documented.
Return
wild

public function doCommit($message)

This method is not documented.
Parameters
$message
Return
wild

public function amendCommit($message)

This method is not documented.
Parameters
$message
Return
wild

public function getBaseCommitRef()

This method is not documented.
Return
wild

public function hasLocalCommit($commit)

This method is not documented.
Parameters
$commit
Return
wild

public function getCommitMessage($commit)

This method is not documented.
Parameters
$commit
Return
wild

public function getCommitSummary($commit)

This method is not documented.
Parameters
$commit
Return
wild

public function getAllLocalChanges()

This method is not documented.
Return
wild

public function getFinalizedRevisionMessage()

This method is not documented.
Return
wild

public function execxLocal($pattern)
Inherited

This method is not documented.
Parameters
$pattern
Return
wild

public function execManualLocal($pattern)
Inherited

This method is not documented.
Parameters
$pattern
Return
wild

public function execFutureLocal($pattern)
Inherited

This method is not documented.
Parameters
$pattern
Return
wild

protected function buildLocalFuture($argv)

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

public function canStashChanges()
Inherited

This method is not documented.
Return
wild

public function stashChanges()
Inherited

This method is not documented.
Return
wild

public function unstashChanges()
Inherited

This method is not documented.
Return
wild

public function readScratchFile($path)
Inherited

ArcanistRepositoryAPI

Try to read a scratch file, if it exists and is readable.

Parameters
string$pathScratch file name.
Return
mixedString for file contents, or false for failure.

public function writeScratchFile($path, $data)
Inherited

ArcanistRepositoryAPI

Try to write a scratch file, if there's somewhere to put it and we can write there.

Parameters
string$pathScratch file name to write.
string$dataData to write.
Return
boolTrue on success, false on failure.

public function removeScratchFile($path)
Inherited

ArcanistRepositoryAPI

Try to remove a scratch file.

Parameters
string$pathScratch file name to remove.
Return
boolTrue if the file was removed successfully.

public function getReadableScratchFilePath($path)
Inherited

ArcanistRepositoryAPI

Get a human-readable description of the scratch file location.

Parameters
string$pathScratch file name.
Return
mixedString, or false on failure.

public function getScratchFilePath($path)
Inherited

ArcanistRepositoryAPI

Get the path to a scratch file, if possible.

Parameters
string$pathScratch file name.
Return
mixedFile path, or false on failure.

public function supportsCommitRanges()

This method is not documented.
Return
wild

final public function setBaseCommit($symbolic_commit)
Inherited

This method is not documented.
Parameters
$symbolic_commit
Return
wild

public function setHeadCommit($symbolic_commit)
Inherited

This method is not documented.
Parameters
$symbolic_commit
Return
wild

final public function getBaseCommit()
Inherited

This method is not documented.
Return
wild

public function getHeadCommit()
Inherited

This method is not documented.
Return
wild

final public function reloadCommitRange()
Inherited

This method is not documented.
Return
wild

protected function didReloadCommitRange()

This method is not documented.
Return
wild

protected function buildBaseCommit($symbolic_commit)

This method is not documented.
Parameters
$symbolic_commit
Return
wild

public function getBaseCommitExplanation()
Inherited

This method is not documented.
Return
wild

public function setBaseCommitExplanation($explanation)
Inherited

This method is not documented.
Parameters
$explanation
Return
wild

public function resolveBaseCommitRule($rule, $source)

This method is not documented.
Parameters
$rule
$source
Return
wild

public function setBaseCommitArgumentRules($base_commit_argument_rules)
Inherited

This method is not documented.
Parameters
$base_commit_argument_rules
Return
wild

public function getBaseCommitArgumentRules()
Inherited

This method is not documented.
Return
wild

public function resolveBaseCommit()
Inherited

This method is not documented.
Return
wild

public function getRepositoryUUID()
Inherited

This method is not documented.
Return
wild

final public function newFuture($pattern)
Inherited

This method is not documented.
Parameters
$pattern
Return
wild

public function newPassthru($pattern)

This method is not documented.
Parameters
$pattern
Return
wild

final public function execPassthru($pattern)
Inherited

This method is not documented.
Parameters
$pattern
Return
wild

final public function setRuntime($runtime)
Inherited

This method is not documented.
Parameters
ArcanistRuntime$runtime
Return
wild

final public function getRuntime()
Inherited

This method is not documented.
Return
wild

final protected function getSymbolEngine()
Inherited

This method is not documented.
Return
wild

final public function getCurrentWorkingCopyStateRef()
Inherited

This method is not documented.
Return
wild

protected function newCurrentWorkingCopyStateRef()
Inherited

This method is not documented.
Return
wild

final public function getCurrentCommitRef()
Inherited

This method is not documented.
Return
wild

protected function newCurrentCommitRef()
Inherited

This method is not documented.
Return
wild

protected function newCurrentCommitSymbol()

This method is not documented.
Return
wild

final public function newCommitRef()
Inherited

This method is not documented.
Return
wild

final public function newMarkerRef()
Inherited

This method is not documented.
Return
wild

final public function getLandEngine()
Inherited

This method is not documented.
Return
wild

protected function newLandEngine()

This method is not documented.
Return
wild

final public function getWorkEngine()
Inherited

This method is not documented.
Return
wild

protected function newWorkEngine()

This method is not documented.
Return
wild

final public function getSupportedMarkerTypes()
Inherited

This method is not documented.
Return
wild

protected function newSupportedMarkerTypes()

This method is not documented.
Return
wild

final public function newMarkerRefQuery()
Inherited

This method is not documented.
Return
wild

protected function newMarkerRefQueryTemplate()

This method is not documented.
Return
wild

final public function newRemoteRefQuery()
Inherited

This method is not documented.
Return
wild

protected function newRemoteRefQueryTemplate()

This method is not documented.
Return
wild

final public function newCommitGraphQuery()
Inherited

This method is not documented.
Return
wild

protected function newCommitGraphQueryTemplate()

This method is not documented.
Return
wild

final public function getDisplayHash($hash)
Inherited

This method is not documented.
Parameters
$hash
Return
wild

final public function getNormalizedURI($uri)
Inherited

This method is not documented.
Parameters
$uri
Return
wild

protected function newNormalizedURI($uri)

This method is not documented.
Parameters
$uri
Return
wild

final public function getPublishedCommitHashes()
Inherited

This method is not documented.
Return
wild

protected function newPublishedCommitHashes()

This method is not documented.
Return
wild

final public function getGraph()
Inherited

This method is not documented.
Return
wild

private function newConfiguredFuture($future)

This method is not documented.
Parameters
PhutilExecutableFuture$future
Return
wild

private function getDiffOptions()

This method is not documented.
Return
wild

public function getFullMercurialDiff()

This method is not documented.
Return
wild

private function getBulkFileDataAtRevision($paths, $revision)

This method is not documented.
Parameters
$paths
$revision
Return
wild

private function getFileDataAtRevision($path, $revision)

This method is not documented.
Parameters
$path
$revision
Return
wild

public function getCommitMessageLog()

This method is not documented.
Return
wild

private function getMercurialConfig($key, $default)

This method is not documented.
Parameters
$key
$default
Return
wild

protected function parseFullAuthor($full_author)

Parse the Mercurial author field.

Not everyone enters their email address as a part of the username field. Try to make it work when it's obvious.

Parameters
string$full_author$full_author
Return
array

private function amendNonHeadCommit($child_nodes, $tmp_file)

Amends a non-head commit with a new message and file changes. This strategy is for Mercurial repositories without the evolve extension.

  1. Run 'arc-amend' which uses Mercurial internals to amend the current commit with updated message/file-changes. It results in a new commit from the right parent
  2. For each branch from the original commit, rebase onto the new commit, removing the original branch. Note that there is potential for this to cause a conflict but this is something the user has to address.
  3. Strip the original commit.
Parameters
array$child_nodesThe list of child changesets off the original commit.
file$tmp_fileThe file containing the new commit message.
Return
wild

public function getSubversionInfo()

This method is not documented.
Return
wild

public function getActiveBookmark()

This method is not documented.
Return
wild
This method is not documented.
Return
wild

public function newLocalState()

This method is not documented.
Return
wild

public function willTestMercurialFeature($feature)

This method is not documented.
Parameters
$feature
Return
wild

public function getMercurialFeature($feature)

This method is not documented.
Parameters
$feature
Return
wild

private function getMercurialExtensionFlag($extension)

Returns the necessary flag for using a Mercurial extension. This will enable Mercurial built-in extensions and the "arc-hg" extension that is included with Arcanist. This will not enable other extensions, e.g. "evolve".

Parameters
string$extensionThe name of the extension to enable.
Return
stringA new command pattern that includes the necessary flags to enable the specified extension.

private function buildMercurialExtensionCommand($extension, $pattern, ...)

Produces the arguments that should be passed to Mercurial command execution that enables a desired extension.

Parameters
string$extensionThe name of the extension to enable.
string$patternThe command pattern that will be run with the extension enabled.
arrayParameters for the command pattern argument.
Return
arrayAn array where the first item is a Mercurial command pattern that includes the necessary flag for enabling the desired extension, and all remaining items are parameters to that command pattern.

public function execxLocalWithExtension($extension, $pattern)

This method is not documented.
Parameters
$extension
$pattern
Return
wild

public function execFutureLocalWithExtension($extension, $pattern)

This method is not documented.
Parameters
$extension
$pattern
Return
wild

public function execPassthruWithExtension($extension, $pattern)

This method is not documented.
Parameters
$extension
$pattern
Return
wild

public function execManualLocalWithExtension($extension, $pattern)

This method is not documented.
Parameters
$extension
$pattern
Return
wild

private function executeMercurialFeatureTest($feature, $resolve)

This method is not documented.
Parameters
$feature
$resolve
Return
wild

private function newMercurialFeatureFuture($feature)

This method is not documented.
Parameters
$feature
Return
wild

private function resolveMercurialFeatureFuture($feature, $future)

This method is not documented.
Parameters
$feature
$future
Return
wild