Changeset View
Changeset View
Standalone View
Standalone View
src/workflow/ArcanistCommitWorkflow.php
| Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | EOTEXT | ||||
| public function getRevisionID() { | public function getRevisionID() { | ||||
| return $this->revisionID; | return $this->revisionID; | ||||
| } | } | ||||
| public function getArguments() { | public function getArguments() { | ||||
| return array( | return array( | ||||
| 'show' => array( | 'show' => array( | ||||
| 'help' => | 'help' => | ||||
| "Show the command which would be issued, but do not actually ". | 'Show the command which would be issued, but do not actually '. | ||||
| "commit anything." | 'commit anything.' | ||||
| ), | ), | ||||
| 'revision' => array( | 'revision' => array( | ||||
| 'param' => 'revision_id', | 'param' => 'revision_id', | ||||
| 'help' => | 'help' => | ||||
| "Commit a specific revision. If you do not specify a revision, ". | 'Commit a specific revision. If you do not specify a revision, '. | ||||
| "arc will look for committable revisions.", | 'arc will look for committable revisions.', | ||||
| ) | ) | ||||
| ); | ); | ||||
| } | } | ||||
| public function run() { | public function run() { | ||||
| $repository_api = $this->getRepositoryAPI(); | $repository_api = $this->getRepositoryAPI(); | ||||
| if (!($repository_api instanceof ArcanistSubversionAPI)) { | if (!($repository_api instanceof ArcanistSubversionAPI)) { | ||||
| ▲ Show 20 Lines • Show All 170 Lines • ▼ Show 20 Lines | foreach ($commit_paths as $path => $ignored) { | ||||
| $do_not_exist[] = $path; | $do_not_exist[] = $path; | ||||
| unset($commit_paths[$path]); | unset($commit_paths[$path]); | ||||
| } | } | ||||
| if ($do_not_exist) { | if ($do_not_exist) { | ||||
| $prefix = pht( | $prefix = pht( | ||||
| 'Revision includes changes to path(s) that do not exist:', | 'Revision includes changes to path(s) that do not exist:', | ||||
| count($do_not_exist)); | count($do_not_exist)); | ||||
| $prompt = "Commit this revision anyway?"; | $prompt = 'Commit this revision anyway?'; | ||||
| $this->promptFileWarning($prefix, $prompt, $do_not_exist); | $this->promptFileWarning($prefix, $prompt, $do_not_exist); | ||||
| } | } | ||||
| $files = array_keys($commit_paths); | $files = array_keys($commit_paths); | ||||
| $files = ArcanistSubversionAPI::escapeFileNamesForSVN($files); | $files = ArcanistSubversionAPI::escapeFileNamesForSVN($files); | ||||
| if (empty($files)) { | if (empty($files)) { | ||||
| throw new ArcanistUsageException( | throw new ArcanistUsageException( | ||||
| "There is nothing left to commit. None of the modified paths exist."); | 'There is nothing left to commit. None of the modified paths exist.'); | ||||
| } | } | ||||
| return $files; | return $files; | ||||
| } | } | ||||
| protected function promptFileWarning($prefix, $prompt, array $paths) { | protected function promptFileWarning($prefix, $prompt, array $paths) { | ||||
| echo $prefix."\n\n"; | echo $prefix."\n\n"; | ||||
| foreach ($paths as $path) { | foreach ($paths as $path) { | ||||
| ▲ Show 20 Lines • Show All 74 Lines • Show Last 20 Lines | |||||