Changeset View
Changeset View
Standalone View
Standalone View
src/workflow/ArcanistUpgradeWorkflow.php
| Show All 37 Lines | public function runWorkflow() { | ||||
| foreach ($roots as $library => $root) { | foreach ($roots as $library => $root) { | ||||
| $log->writeStatus( | $log->writeStatus( | ||||
| pht('PREPARING'), | pht('PREPARING'), | ||||
| pht( | pht( | ||||
| 'Preparing to upgrade "%s"...', | 'Preparing to upgrade "%s"...', | ||||
| $library)); | $library)); | ||||
| $is_git = false; | |||||
| $working_copy = ArcanistWorkingCopy::newFromWorkingDirectory($root); | $working_copy = ArcanistWorkingCopy::newFromWorkingDirectory($root); | ||||
| if ($working_copy) { | |||||
| $repository_api = $working_copy->newRepositoryAPI(); | $repository_api = $working_copy->getRepositoryAPI(); | ||||
| if ($repository_api instanceof ArcanistGitAPI) { | $is_git = ($repository_api instanceof ArcanistGitAPI); | ||||
| $is_git = true; | |||||
| } | |||||
| } | |||||
| if (!$is_git) { | if (!$is_git) { | ||||
| throw new PhutilArgumentUsageException( | throw new PhutilArgumentUsageException( | ||||
| pht( | pht( | ||||
| 'The "arc upgrade" workflow uses "git pull" to upgrade '. | 'The "arc upgrade" workflow uses "git pull" to upgrade '. | ||||
| 'Arcanist, but the "arcanist/" directory (in "%s") is not a Git '. | 'Arcanist, but the "arcanist/" directory (in "%s") is not a Git '. | ||||
| 'working copy. You must leave "arcanist/" as a Git '. | 'working copy. You must leave "arcanist/" as a Git '. | ||||
| 'working copy to use "arc upgrade".', | 'working copy to use "arc upgrade".', | ||||
| ▲ Show 20 Lines • Show All 76 Lines • Show Last 20 Lines | |||||