Changeset View
Changeset View
Standalone View
Standalone View
src/repository/api/ArcanistMercurialAPI.php
Show First 20 Lines • Show All 536 Lines • ▼ Show 20 Lines | final class ArcanistMercurialAPI extends ArcanistRepositoryAPI { | ||||
public function getAllBranchRefs() { | public function getAllBranchRefs() { | ||||
$branches = $this->getAllBranches(); | $branches = $this->getAllBranches(); | ||||
$refs = array(); | $refs = array(); | ||||
foreach ($branches as $branch) { | foreach ($branches as $branch) { | ||||
$commit_ref = $this->newCommitRef() | $commit_ref = $this->newCommitRef() | ||||
->setCommitHash($branch['hash']); | ->setCommitHash($branch['hash']); | ||||
$refs[] = $this->newBranchRef() | $refs[] = $this->newMarkerRef() | ||||
->setBranchName($branch['name']) | ->setBranchName($branch['name']) | ||||
->setIsCurrentBranch($branch['current']) | ->setIsCurrentBranch($branch['current']) | ||||
->attachCommitRef($commit_ref); | ->attachCommitRef($commit_ref); | ||||
} | } | ||||
return $refs; | return $refs; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 631 Lines • ▼ Show 20 Lines | |||||
private function resolveMercurialFeatureFuture($feature, $future) { | private function resolveMercurialFeatureFuture($feature, $future) { | ||||
// By default, assume the feature is a simple capability test and the | // By default, assume the feature is a simple capability test and the | ||||
// capability is present if the feature resolves without an error. | // capability is present if the feature resolves without an error. | ||||
list($err) = $future->resolve(); | list($err) = $future->resolve(); | ||||
return !$err; | return !$err; | ||||
} | } | ||||
protected function newSupportedMarkerTypes() { | |||||
return array( | |||||
ArcanistMarkerRef::TYPE_BRANCH, | |||||
ArcanistMarkerRef::TYPE_BOOKMARK, | |||||
); | |||||
} | |||||
protected function newMarkerRefQueryTemplate() { | |||||
return new ArcanistMercurialRepositoryMarkerQuery(); | |||||
} | |||||
} | } |