Changeset View
Changeset View
Standalone View
Standalone View
src/workflow/ArcanistDiffWorkflow.php
| Show First 20 Lines • Show All 107 Lines • ▼ Show 20 Lines | $arguments = array( | ||||
| 'supports' => array( | 'supports' => array( | ||||
| 'git', | 'git', | ||||
| // TODO: Support mercurial. | // TODO: Support mercurial. | ||||
| ), | ), | ||||
| 'short' => 'C', | 'short' => 'C', | ||||
| 'param' => 'commit', | 'param' => 'commit', | ||||
| 'help' => pht('Read revision information from a specific commit.'), | 'help' => pht('Read revision information from a specific commit.'), | ||||
| 'conflicts' => array( | 'conflicts' => array( | ||||
| 'preview' => null, | 'only' => null, | ||||
| 'update' => null, | 'update' => null, | ||||
| ), | ), | ||||
| ), | ), | ||||
| 'edit' => array( | 'edit' => array( | ||||
| 'supports' => array( | 'supports' => array( | ||||
| 'git', | 'git', | ||||
| 'hg', | 'hg', | ||||
| ), | ), | ||||
| ▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | $arguments = array( | ||||
| ), | ), | ||||
| 'create' => array( | 'create' => array( | ||||
| 'help' => pht('Always create a new revision.'), | 'help' => pht('Always create a new revision.'), | ||||
| 'conflicts' => array( | 'conflicts' => array( | ||||
| 'edit' => pht( | 'edit' => pht( | ||||
| '%s can not be used with %s.', | '%s can not be used with %s.', | ||||
| '--create', | '--create', | ||||
| '--edit'), | '--edit'), | ||||
| 'preview' => pht( | 'only' => pht( | ||||
| '%s can not be used with %s.', | '%s can not be used with %s.', | ||||
| '--create', | '--create', | ||||
| '--preview'), | '--only'), | ||||
| 'update' => pht( | 'update' => pht( | ||||
| '%s can not be used with %s.', | '%s can not be used with %s.', | ||||
| '--create', | '--create', | ||||
| '--update'), | '--update'), | ||||
| ), | ), | ||||
| ), | ), | ||||
| 'update' => array( | 'update' => array( | ||||
| 'param' => 'revision_id', | 'param' => 'revision_id', | ||||
| 'help' => pht('Always update a specific revision.'), | 'help' => pht('Always update a specific revision.'), | ||||
| ), | ), | ||||
| 'nounit' => array( | 'nounit' => array( | ||||
| 'help' => pht('Do not run unit tests.'), | 'help' => pht('Do not run unit tests.'), | ||||
| ), | ), | ||||
| 'nolint' => array( | 'nolint' => array( | ||||
| 'help' => pht('Do not run lint.'), | 'help' => pht('Do not run lint.'), | ||||
| 'conflicts' => array( | 'conflicts' => array( | ||||
| 'lintall' => pht('%s suppresses lint.', '--nolint'), | 'lintall' => pht('%s suppresses lint.', '--nolint'), | ||||
| 'advice' => pht('%s suppresses lint.', '--nolint'), | 'advice' => pht('%s suppresses lint.', '--nolint'), | ||||
| 'apply-patches' => pht('%s suppresses lint.', '--nolint'), | 'apply-patches' => pht('%s suppresses lint.', '--nolint'), | ||||
| 'never-apply-patches' => pht('%s suppresses lint.', '--nolint'), | 'never-apply-patches' => pht('%s suppresses lint.', '--nolint'), | ||||
| ), | ), | ||||
| ), | ), | ||||
| 'preview' => array( | 'only' => array( | ||||
| 'help' => pht( | 'help' => pht( | ||||
| 'Instead of creating or updating a revision, only create a diff, '. | 'Instead of creating or updating a revision, only create a diff, '. | ||||
| 'which you may later attach to a revision. This still runs lint '. | 'which you may later attach to a revision.'), | ||||
| 'unit tests.'), | |||||
| 'conflicts' => array( | 'conflicts' => array( | ||||
| 'edit' => pht('%s does affect revisions.', '--preview'), | 'edit' => pht('%s does affect revisions.', '--only'), | ||||
| 'message' => pht('%s does not update any revision.', '--preview'), | 'message' => pht('%s does not update any revision.', '--only'), | ||||
| ), | ), | ||||
| ), | ), | ||||
| 'encoding' => array( | 'encoding' => array( | ||||
| 'param' => 'encoding', | 'param' => 'encoding', | ||||
| 'help' => pht( | 'help' => pht( | ||||
| 'Attempt to convert non UTF-8 hunks into specified encoding.'), | 'Attempt to convert non UTF-8 hunks into specified encoding.'), | ||||
| ), | ), | ||||
| 'allow-untracked' => array( | 'allow-untracked' => array( | ||||
| ▲ Show 20 Lines • Show All 96 Lines • ▼ Show 20 Lines | $arguments = array( | ||||
| 'revision, update some fields from the local commit message.'), | 'revision, update some fields from the local commit message.'), | ||||
| 'supports' => array( | 'supports' => array( | ||||
| 'hg', | 'hg', | ||||
| 'git', | 'git', | ||||
| ), | ), | ||||
| 'conflicts' => array( | 'conflicts' => array( | ||||
| 'use-commit-message' => true, | 'use-commit-message' => true, | ||||
| 'update' => true, | 'update' => true, | ||||
| 'preview' => true, | 'only' => true, | ||||
| 'raw' => true, | 'raw' => true, | ||||
| 'raw-command' => true, | 'raw-command' => true, | ||||
| 'message-file' => true, | 'message-file' => true, | ||||
| ), | ), | ||||
| ), | ), | ||||
| 'reviewers' => array( | 'reviewers' => array( | ||||
| 'param' => 'usernames', | 'param' => 'usernames', | ||||
| 'help' => pht('When creating a revision, add reviewers.'), | 'help' => pht('When creating a revision, add reviewers.'), | ||||
| 'conflicts' => array( | 'conflicts' => array( | ||||
| 'preview' => true, | 'only' => true, | ||||
| 'update' => true, | 'update' => true, | ||||
| ), | ), | ||||
| ), | ), | ||||
| 'cc' => array( | 'cc' => array( | ||||
| 'param' => 'usernames', | 'param' => 'usernames', | ||||
| 'help' => pht('When creating a revision, add CCs.'), | 'help' => pht('When creating a revision, add CCs.'), | ||||
| 'conflicts' => array( | 'conflicts' => array( | ||||
| 'preview' => true, | 'only' => true, | ||||
| 'update' => true, | 'update' => true, | ||||
| ), | ), | ||||
| ), | ), | ||||
| 'skip-binaries' => array( | 'skip-binaries' => array( | ||||
| 'help' => pht('Do not upload binaries (like images).'), | 'help' => pht('Do not upload binaries (like images).'), | ||||
| ), | ), | ||||
| 'skip-staging' => array( | 'skip-staging' => array( | ||||
| 'help' => pht('Do not copy changes to the staging area.'), | 'help' => pht('Do not copy changes to the staging area.'), | ||||
| ▲ Show 20 Lines • Show All 381 Lines • ▼ Show 20 Lines | protected function shouldOnlyCreateDiff() { | ||||
| if ($this->getArgument('use-commit-message')) { | if ($this->getArgument('use-commit-message')) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| if ($this->isRawDiffSource()) { | if ($this->isRawDiffSource()) { | ||||
| return true; | return true; | ||||
| } | } | ||||
| return $this->getArgument('preview'); | return $this->getArgument('only'); | ||||
| } | } | ||||
| private function generateAffectedPaths() { | private function generateAffectedPaths() { | ||||
| if ($this->isRawDiffSource()) { | if ($this->isRawDiffSource()) { | ||||
| return array(); | return array(); | ||||
| } | } | ||||
| $repository_api = $this->getRepositoryAPI(); | $repository_api = $this->getRepositoryAPI(); | ||||
| ▲ Show 20 Lines • Show All 643 Lines • ▼ Show 20 Lines | |||||
| /* -( Commit and Update Messages )----------------------------------------- */ | /* -( Commit and Update Messages )----------------------------------------- */ | ||||
| /** | /** | ||||
| * @task message | * @task message | ||||
| */ | */ | ||||
| private function buildCommitMessage() { | private function buildCommitMessage() { | ||||
| if ($this->getArgument('preview')) { | if ($this->getArgument('only')) { | ||||
| return null; | return null; | ||||
| } | } | ||||
| $is_create = $this->getArgument('create'); | $is_create = $this->getArgument('create'); | ||||
| $is_update = $this->getArgument('update'); | $is_update = $this->getArgument('update'); | ||||
| $is_raw = $this->isRawDiffSource(); | $is_raw = $this->isRawDiffSource(); | ||||
| $is_message = $this->getArgument('use-commit-message'); | $is_message = $this->getArgument('use-commit-message'); | ||||
| $is_verbatim = $this->getArgument('verbatim'); | $is_verbatim = $this->getArgument('verbatim'); | ||||
| ▲ Show 20 Lines • Show All 1,493 Lines • Show Last 20 Lines | |||||