Changeset View
Changeset View
Standalone View
Standalone View
src/workflow/ArcanistDiffWorkflow.php
| Show First 20 Lines • Show All 956 Lines • ▼ Show 20 Lines | protected function generateChanges() { | ||||
| } | } | ||||
| if (count($changes) > 250) { | if (count($changes) > 250) { | ||||
| $message = pht( | $message = pht( | ||||
| 'This diff has a very large number of changes (%s). Differential '. | 'This diff has a very large number of changes (%s). Differential '. | ||||
| 'works best for changes which will receive detailed human review, '. | 'works best for changes which will receive detailed human review, '. | ||||
| 'and not as well for large automated changes or bulk checkins. '. | 'and not as well for large automated changes or bulk checkins. '. | ||||
| 'See %s for information about reviewing big checkins. Continue anyway?', | 'See %s for information about reviewing big checkins. Continue anyway?', | ||||
| new PhutilNumber(count($changes)), | phutil_count($changes), | ||||
| 'https://secure.phabricator.com/book/phabricator/article/'. | 'https://secure.phabricator.com/book/phabricator/article/'. | ||||
| 'differential_large_changes/'); | 'differential_large_changes/'); | ||||
| if (!phutil_console_confirm($message)) { | if (!phutil_console_confirm($message)) { | ||||
| throw new ArcanistUsageException( | throw new ArcanistUsageException( | ||||
| pht('Aborted generation of gigantic diff.')); | pht('Aborted generation of gigantic diff.')); | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 91 Lines • ▼ Show 20 Lines | if ($utf8_problems) { | ||||
| $utf8_warning = | $utf8_warning = | ||||
| sprintf( | sprintf( | ||||
| "%s\n\n%s\n\n %s\n", | "%s\n\n%s\n\n %s\n", | ||||
| pht( | pht( | ||||
| 'This diff includes %s file(s) which are not valid UTF-8 (they '. | 'This diff includes %s file(s) which are not valid UTF-8 (they '. | ||||
| 'contain invalid byte sequences). You can either stop this '. | 'contain invalid byte sequences). You can either stop this '. | ||||
| 'workflow and fix these files, or continue. If you continue, '. | 'workflow and fix these files, or continue. If you continue, '. | ||||
| 'these files will be marked as binary.', | 'these files will be marked as binary.', | ||||
| new PhutilNumber(count($utf8_problems))), | phutil_count($utf8_problems)), | ||||
| pht( | pht( | ||||
| "You can learn more about how Phabricator handles character ". | "You can learn more about how Phabricator handles character ". | ||||
| "encodings (and how to configure encoding settings and detect and ". | "encodings (and how to configure encoding settings and detect and ". | ||||
| "correct encoding problems) by reading 'User Guide: UTF-8 and ". | "correct encoding problems) by reading 'User Guide: UTF-8 and ". | ||||
| "Character Encoding' in the Phabricator documentation."), | "Character Encoding' in the Phabricator documentation."), | ||||
| pht( | pht( | ||||
| '%d AFFECTED FILE(S)', | '%s AFFECTED FILE(S)', | ||||
| count($utf8_problems))); | phutil_count($utf8_problems))); | ||||
| $confirm = pht( | $confirm = pht( | ||||
| 'Do you want to mark these %s file(s) as binary and continue?', | 'Do you want to mark these %s file(s) as binary and continue?', | ||||
| new PhutilNumber(count($utf8_problems))); | phutil_count($utf8_problems)); | ||||
| echo phutil_console_format( | echo phutil_console_format( | ||||
| "**%s**\n", | "**%s**\n", | ||||
| pht('Invalid Content Encoding (Non-UTF8)')); | pht('Invalid Content Encoding (Non-UTF8)')); | ||||
| echo phutil_console_wrap($utf8_warning); | echo phutil_console_wrap($utf8_warning); | ||||
| $file_list = mpull($utf8_problems, 'getCurrentPath'); | $file_list = mpull($utf8_problems, 'getCurrentPath'); | ||||
| $file_list = ' '.implode("\n ", $file_list); | $file_list = ' '.implode("\n ", $file_list); | ||||
| ▲ Show 20 Lines • Show All 1,688 Lines • Show Last 20 Lines | |||||