Changeset View
Changeset View
Standalone View
Standalone View
src/workflow/ArcanistPatchWorkflow.php
Show First 20 Lines • Show All 424 Lines • ▼ Show 20 Lines | public function run() { | ||||
if ($sanity_check) { | if ($sanity_check) { | ||||
$this->requireCleanWorkingCopy(); | $this->requireCleanWorkingCopy(); | ||||
} | } | ||||
$repository_api = $this->getRepositoryAPI(); | $repository_api = $this->getRepositoryAPI(); | ||||
$has_base_revision = $repository_api->hasLocalCommit( | $has_base_revision = $repository_api->hasLocalCommit( | ||||
$bundle->getBaseRevision()); | $bundle->getBaseRevision()); | ||||
if (!$has_base_revision) { | |||||
if ($repository_api instanceof ArcanistGitAPI) { | |||||
echo phutil_console_format( | |||||
"<bg:blue>** %s **</bg> %s\n", | |||||
pht('INFO'), | |||||
pht('Base commit is not in local repository; trying to fetch.')); | |||||
$repository_api->execManualLocal('fetch --quiet --all'); | |||||
$has_base_revision = $repository_api->hasLocalCommit( | |||||
$bundle->getBaseRevision()); | |||||
} | |||||
} | |||||
if ($this->canBranch() && | if ($this->canBranch() && | ||||
($this->shouldBranch() || | ($this->shouldBranch() || | ||||
($this->shouldCommit() && $has_base_revision))) { | ($this->shouldCommit() && $has_base_revision))) { | ||||
if ($repository_api instanceof ArcanistGitAPI) { | if ($repository_api instanceof ArcanistGitAPI) { | ||||
$original_branch = $repository_api->getBranchName(); | $original_branch = $repository_api->getBranchName(); | ||||
} else if ($repository_api instanceof ArcanistMercurialAPI) { | } else if ($repository_api instanceof ArcanistMercurialAPI) { | ||||
$original_branch = $repository_api->getActiveBookmark(); | $original_branch = $repository_api->getActiveBookmark(); | ||||
▲ Show 20 Lines • Show All 666 Lines • Show Last 20 Lines |