Page MenuHomePhorge

ArcanistGitWorkEngine.php
No OneTemporary

ArcanistGitWorkEngine.php

<?php
final class ArcanistGitWorkEngine
extends ArcanistWorkEngine {
protected function getDefaultStartSymbol() {
$api = $this->getRepositoryAPI();
// NOTE: In Git, we're trying to find the current branch name because the
// behavior of "--track" depends on the symbol we pass.
$marker = $api->newMarkerRefQuery()
->withIsActive(true)
->withMarkerTypes(array(ArcanistMarkerRef::TYPE_BRANCH))
->executeOne();
if ($marker) {
return $marker->getName();
}
return $api->getWorkingCopyRevision();
}
protected function newMarker($symbol, $start) {
$api = $this->getRepositoryAPI();
$log = $this->getLogEngine();
$log->writeStatus(
pht('NEW BRANCH'),
pht(
'Creating new branch "%s" from "%s".',
$symbol,
$start));
$future = $api->newFuture(
'checkout --track -b %s %s --',
$symbol,
$start);
$future->resolve();
}
protected function moveToMarker(ArcanistMarkerRef $marker) {
$api = $this->getRepositoryAPI();
$log = $this->getLogEngine();
$log->writeStatus(
pht('BRANCH'),
pht(
'Checking out branch "%s".',
$marker->getName()));
$future = $api->newFuture(
'checkout %s --',
$marker->getName());
$future->resolve();
}
}

File Metadata

Mime Type
text/x-php
Expires
Mon, Mar 24, 02:32 (1 d, 19 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1115227
Default Alt Text
ArcanistGitWorkEngine.php (1 KB)

Event Timeline