Changeset View
Changeset View
Standalone View
Standalone View
src/land/ArcanistGitLandEngine.php
Show First 20 Lines • Show All 133 Lines • ▼ Show 20 Lines | final class ArcanistGitLandEngine | ||||
private function verifySourceAndTargetExist() { | private function verifySourceAndTargetExist() { | ||||
$api = $this->getRepositoryAPI(); | $api = $this->getRepositoryAPI(); | ||||
list($err) = $api->execManualLocal( | list($err) = $api->execManualLocal( | ||||
'rev-parse --verify %s', | 'rev-parse --verify %s', | ||||
$this->getTargetFullRef()); | $this->getTargetFullRef()); | ||||
if ($err) { | if ($err) { | ||||
$this->writeWarn( | |||||
pht('TARGET'), | |||||
pht( | |||||
'No local ref exists for branch "%s" in remote "%s", attempting '. | |||||
'fetch...', | |||||
$this->getTargetOnto(), | |||||
$this->getTargetRemote())); | |||||
$api->execManualLocal( | |||||
'fetch %s %s --', | |||||
$this->getTargetRemote(), | |||||
$this->getTargetOnto()); | |||||
list($err) = $api->execManualLocal( | |||||
'rev-parse --verify %s', | |||||
$this->getTargetFullRef()); | |||||
if ($err) { | |||||
throw new Exception( | throw new Exception( | ||||
pht( | pht( | ||||
'Branch "%s" does not exist in remote "%s".', | 'Branch "%s" does not exist in remote "%s".', | ||||
$this->getTargetOnto(), | $this->getTargetOnto(), | ||||
$this->getTargetRemote())); | $this->getTargetRemote())); | ||||
} | } | ||||
$this->writeInfo( | |||||
pht('FETCHED'), | |||||
pht( | |||||
'Fetched branch "%s" from remote "%s".', | |||||
$this->getTargetOnto(), | |||||
$this->getTargetRemote())); | |||||
} | |||||
list($err, $stdout) = $api->execManualLocal( | list($err, $stdout) = $api->execManualLocal( | ||||
'rev-parse --verify %s', | 'rev-parse --verify %s', | ||||
$this->getSourceRef()); | $this->getSourceRef()); | ||||
if ($err) { | if ($err) { | ||||
throw new Exception( | throw new Exception( | ||||
pht( | pht( | ||||
'Branch "%s" does not exist in the local working copy.', | 'Branch "%s" does not exist in the local working copy.', | ||||
▲ Show 20 Lines • Show All 724 Lines • Show Last 20 Lines |