Changeset View
Changeset View
Standalone View
Standalone View
src/workflow/ArcanistDiffWorkflow.php
| Show First 20 Lines • Show All 2,389 Lines • ▼ Show 20 Lines | private function checkRevisionOwnership(array $revision) { | ||||
| if ($revision['authorPHID'] == $this->getUserPHID()) { | if ($revision['authorPHID'] == $this->getUserPHID()) { | ||||
| return; | return; | ||||
| } | } | ||||
| $id = $revision['id']; | $id = $revision['id']; | ||||
| $title = $revision['title']; | $title = $revision['title']; | ||||
| throw new ArcanistUsageException( | throw new ArcanistUsageException( | ||||
| "You don't own revision D{$id} '{$title}'. You can only update ". | pht( | ||||
| "revisions you own. You can 'Commandeer' this revision from the web ". | "You don't own revision %s '%s'. You can only update revisions ". | ||||
| "interface if you want to become the owner."); | "you own. You can 'Commandeer' this revision from the web ". | ||||
| "interface if you want to become the owner.", | |||||
| "D{$id}", | |||||
| $title)); | |||||
| } | } | ||||
| /* -( File Uploads )------------------------------------------------------- */ | /* -( File Uploads )------------------------------------------------------- */ | ||||
| private function uploadFilesForChanges(array $changes) { | private function uploadFilesForChanges(array $changes) { | ||||
| assert_instances_of($changes, 'ArcanistDiffChange'); | assert_instances_of($changes, 'ArcanistDiffChange'); | ||||
| ▲ Show 20 Lines • Show All 110 Lines • ▼ Show 20 Lines | foreach ($futures as $key => $future) { | ||||
| $change = $need_upload[$key]['change']; | $change = $need_upload[$key]['change']; | ||||
| $name = $need_upload[$key]['name']; | $name = $need_upload[$key]['name']; | ||||
| try { | try { | ||||
| $phid = $future->resolve(); | $phid = $future->resolve(); | ||||
| $change->setMetadata("{$type}:binary-phid", $phid); | $change->setMetadata("{$type}:binary-phid", $phid); | ||||
| echo pht("Uploaded '%s' (%s).", $name, $type)."\n"; | echo pht("Uploaded '%s' (%s).", $name, $type)."\n"; | ||||
| } catch (Exception $e) { | } catch (Exception $e) { | ||||
| echo "Failed to upload {$type} binary '{$name}'.\n\n"; | echo pht("Failed to upload %s binary '%s'.", $type, $name)."\n\n"; | ||||
| echo $e->getMessage()."\n"; | echo $e->getMessage()."\n"; | ||||
| if (!phutil_console_confirm('Continue?', $default_no = false)) { | if (!phutil_console_confirm(pht('Continue?'), $default_no = false)) { | ||||
| throw new ArcanistUsageException( | throw new ArcanistUsageException( | ||||
| 'Aborted due to file upload failure. You can use --skip-binaries '. | pht( | ||||
| 'to skip binary uploads.'); | 'Aborted due to file upload failure. You can use %s '. | ||||
| 'to skip binary uploads.', | |||||
| '--skip-binaries')); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| echo pht('Upload complete.')."\n"; | echo pht('Upload complete.')."\n"; | ||||
| } | } | ||||
| private function getFileMimeType($data) { | private function getFileMimeType($data) { | ||||
| Show All 10 Lines | |||||