Changeset View
Changeset View
Standalone View
Standalone View
scripts/repository/reparse.php
| Show First 20 Lines • Show All 97 Lines • ▼ Show 20 Lines | |||||
| $reparse_owners = $args->getArg('owners'); | $reparse_owners = $args->getArg('owners'); | ||||
| $reparse_harbormaster = $args->getArg('harbormaster'); | $reparse_harbormaster = $args->getArg('harbormaster'); | ||||
| $reparse_what = $args->getArg('revision'); | $reparse_what = $args->getArg('revision'); | ||||
| $force = $args->getArg('force'); | $force = $args->getArg('force'); | ||||
| $force_local = $args->getArg('force-local'); | $force_local = $args->getArg('force-local'); | ||||
| $min_date = $args->getArg('min-date'); | $min_date = $args->getArg('min-date'); | ||||
| if (!$all_from_repo && !$reparse_what) { | if (!$all_from_repo && !$reparse_what) { | ||||
| usage("Specify a commit or repository to reparse."); | usage('Specify a commit or repository to reparse.'); | ||||
| } | } | ||||
| if ($all_from_repo && $reparse_what) { | if ($all_from_repo && $reparse_what) { | ||||
| $commits = implode(', ', $reparse_what); | $commits = implode(', ', $reparse_what); | ||||
| usage( | usage( | ||||
| "Specify a commit or repository to reparse, not both:\n". | "Specify a commit or repository to reparse, not both:\n". | ||||
| "All from repo: ".$all_from_repo."\n". | "All from repo: ".$all_from_repo."\n". | ||||
| "Commit(s) to reparse: ".$commits); | "Commit(s) to reparse: ".$commits); | ||||
| } | } | ||||
| if (!$reparse_message && !$reparse_change && !$reparse_herald && | if (!$reparse_message && !$reparse_change && !$reparse_herald && | ||||
| !$reparse_owners && !$reparse_harbormaster) { | !$reparse_owners && !$reparse_harbormaster) { | ||||
| usage("Specify what information to reparse with --message, --change, ". | usage('Specify what information to reparse with --message, --change, '. | ||||
| "--herald, --harbormaster, and/or --owners"); | '--herald, --harbormaster, and/or --owners'); | ||||
| } | } | ||||
| $min_timestamp = false; | $min_timestamp = false; | ||||
| if ($min_date) { | if ($min_date) { | ||||
| $min_timestamp = strtotime($min_date); | $min_timestamp = strtotime($min_date); | ||||
| if (!$all_from_repo) { | if (!$all_from_repo) { | ||||
| usage( | usage( | ||||
| "You must use --all if you specify --min-date\n". | "You must use --all if you specify --min-date\n". | ||||
| "e.g.\n". | "e.g.\n". | ||||
| " ./reparse.php --all TEST --owners --min-date yesterday"); | " ./reparse.php --all TEST --owners --min-date yesterday"); | ||||
| } | } | ||||
| // previous to PHP 5.1.0 you would compare with -1, instead of false | // previous to PHP 5.1.0 you would compare with -1, instead of false | ||||
| if (false === $min_timestamp) { | if (false === $min_timestamp) { | ||||
| usage( | usage( | ||||
| "Supplied --min-date is not valid\n". | "Supplied --min-date is not valid\n". | ||||
| "Supplied value: '".$min_date."'\n". | "Supplied value: '".$min_date."'\n". | ||||
| $min_date_usage_examples); | $min_date_usage_examples); | ||||
| } | } | ||||
| } | } | ||||
| if ($reparse_owners && !$force) { | if ($reparse_owners && !$force) { | ||||
| echo phutil_console_wrap( | echo phutil_console_wrap( | ||||
| "You are about to recreate the relationship entries between the commits ". | 'You are about to recreate the relationship entries between the commits '. | ||||
| "and the packages they touch. This might delete some existing ". | 'and the packages they touch. This might delete some existing '. | ||||
| "relationship entries for some old commits."); | 'relationship entries for some old commits.'); | ||||
| if (!phutil_console_confirm('Are you ready to continue?')) { | if (!phutil_console_confirm('Are you ready to continue?')) { | ||||
| echo "Cancelled.\n"; | echo "Cancelled.\n"; | ||||
| exit(1); | exit(1); | ||||
| } | } | ||||
| } | } | ||||
| $commits = array(); | $commits = array(); | ||||
| ▲ Show 20 Lines • Show All 136 Lines • Show Last 20 Lines | |||||