Changeset View
Changeset View
Standalone View
Standalone View
src/workflow/ArcanistPatchWorkflow.php
| Show First 20 Lines • Show All 708 Lines • ▼ Show 20 Lines | if ($repository_api instanceof ArcanistSubversionAPI) { | ||||
| // NOTE: Git patches may fail if they change the case of a filename | // NOTE: Git patches may fail if they change the case of a filename | ||||
| // (for instance, from 'example.c' to 'Example.c'). As of now, Git | // (for instance, from 'example.c' to 'Example.c'). As of now, Git | ||||
| // can not apply these patches on case-insensitive filesystems and | // can not apply these patches on case-insensitive filesystems and | ||||
| // there is no way to build a patch which works. | // there is no way to build a patch which works. | ||||
| throw new ArcanistUsageException(pht('Unable to apply patch!')); | throw new ArcanistUsageException(pht('Unable to apply patch!')); | ||||
| } | } | ||||
| // in case there were any submodule changes involved | |||||
| $repository_api->execPassthru('submodule update --init --recursive'); | |||||
| if ($this->shouldCommit()) { | if ($this->shouldCommit()) { | ||||
| if ($bundle->getFullAuthor()) { | if ($bundle->getFullAuthor()) { | ||||
| $author_cmd = csprintf('--author=%s', $bundle->getFullAuthor()); | $author_cmd = csprintf('--author=%s', $bundle->getFullAuthor()); | ||||
| } else { | } else { | ||||
| $author_cmd = ''; | $author_cmd = ''; | ||||
| } | } | ||||
| $commit_message = $this->getCommitMessage($bundle); | $commit_message = $this->getCommitMessage($bundle); | ||||
| Show All 21 Lines | if ($repository_api instanceof ArcanistSubversionAPI) { | ||||
| if ($ex) { | if ($ex) { | ||||
| echo phutil_console_format( | echo phutil_console_format( | ||||
| "\n<bg:red>** %s**</bg>\n", | "\n<bg:red>** %s**</bg>\n", | ||||
| pht('Cherry Pick Failed!')); | pht('Cherry Pick Failed!')); | ||||
| throw $ex; | throw $ex; | ||||
| } | } | ||||
| } | } | ||||
| // Synchronize submodule state, since the patch may have made changes | |||||
| // to ".gitmodules". We do this after we finish managing branches so | |||||
| // the behavior is correct under "--nobranch"; see PHI648. | |||||
| $repository_api->execPassthru('submodule update --init --recursive'); | |||||
| echo phutil_console_format( | echo phutil_console_format( | ||||
| "<bg:green>** %s **</bg> %s\n", | "<bg:green>** %s **</bg> %s\n", | ||||
| pht('OKAY'), | pht('OKAY'), | ||||
| pht('Successfully %s patch.', $verb)); | pht('Successfully %s patch.', $verb)); | ||||
| } else if ($repository_api instanceof ArcanistMercurialAPI) { | } else if ($repository_api instanceof ArcanistMercurialAPI) { | ||||
| $future = $repository_api->execFutureLocal('import --no-commit -'); | $future = $repository_api->execFutureLocal('import --no-commit -'); | ||||
| $future->write($bundle->toGitPatch()); | $future->write($bundle->toGitPatch()); | ||||
| ▲ Show 20 Lines • Show All 347 Lines • Show Last 20 Lines | |||||