Differential D10600 Diff 27430 src/applications/repository/management/PhabricatorRepositoryManagementReparseWorkflow.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/management/PhabricatorRepositoryManagementReparseWorkflow.php
Show First 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | $this | ||||
'name' => 'message', | 'name' => 'message', | ||||
'help' => pht('Reparse commit messages.'), | 'help' => pht('Reparse commit messages.'), | ||||
), | ), | ||||
array( | array( | ||||
'name' => 'change', | 'name' => 'change', | ||||
'help' => pht('Reparse changes.'), | 'help' => pht('Reparse changes.'), | ||||
), | ), | ||||
array( | array( | ||||
'name' => 'cache', | |||||
'help' => 'Reparse cache information', | |||||
), | |||||
array( | |||||
'name' => 'herald', | 'name' => 'herald', | ||||
'help' => pht( | 'help' => pht( | ||||
'Reevaluate Herald rules (may send huge amounts of email!)'), | 'Reevaluate Herald rules (may send huge amounts of email!)'), | ||||
), | ), | ||||
array( | array( | ||||
'name' => 'owners', | 'name' => 'owners', | ||||
'help' => pht( | 'help' => pht( | ||||
'Reevaluate related commits for owners packages (may delete '. | 'Reevaluate related commits for owners packages (may delete '. | ||||
Show All 22 Lines | final class PhabricatorRepositoryManagementReparseWorkflow | ||||
} | } | ||||
public function execute(PhutilArgumentParser $args) { | public function execute(PhutilArgumentParser $args) { | ||||
$console = PhutilConsole::getConsole(); | $console = PhutilConsole::getConsole(); | ||||
$all_from_repo = $args->getArg('all'); | $all_from_repo = $args->getArg('all'); | ||||
$reparse_message = $args->getArg('message'); | $reparse_message = $args->getArg('message'); | ||||
$reparse_change = $args->getArg('change'); | $reparse_change = $args->getArg('change'); | ||||
$reparse_cache = $args->getArg('cache'); | |||||
$reparse_herald = $args->getArg('herald'); | $reparse_herald = $args->getArg('herald'); | ||||
$reparse_owners = $args->getArg('owners'); | $reparse_owners = $args->getArg('owners'); | ||||
$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) { | ||||
throw new PhutilArgumentUsageException( | throw new PhutilArgumentUsageException( | ||||
pht('Specify a commit or repository to reparse.')); | pht('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); | ||||
throw new PhutilArgumentUsageException( | throw new PhutilArgumentUsageException( | ||||
pht( | pht( | ||||
"Specify a commit or repository to reparse, not both:\n". | "Specify a commit or repository to reparse, not both:\n". | ||||
"All from repo: %s\n". | "All from repo: %s\n". | ||||
"Commit(s) to reparse: %s", | "Commit(s) to reparse: %s", | ||||
$all_from_repo, | $all_from_repo, | ||||
$commits)); | $commits)); | ||||
} | } | ||||
if (!$reparse_message && !$reparse_change && !$reparse_herald && | if (!$reparse_message && !$reparse_change && !$reparse_cache && | ||||
!$reparse_owners) { | !$reparse_herald && !$reparse_owners) { | ||||
throw new PhutilArgumentUsageException( | throw new PhutilArgumentUsageException( | ||||
pht('Specify what information to reparse with --message, --change, '. | pht('Specify what information to reparse with --message, --change, '. | ||||
'--herald, and/or --owners')); | '--cache, --herald, 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) { | ||||
throw new PhutilArgumentUsageException( | throw new PhutilArgumentUsageException( | ||||
▲ Show 20 Lines • Show All 129 Lines • ▼ Show 20 Lines | foreach ($commits as $commit) { | ||||
$classes[] = 'PhabricatorRepositorySvnCommitMessageParserWorker'; | $classes[] = 'PhabricatorRepositorySvnCommitMessageParserWorker'; | ||||
} | } | ||||
if ($reparse_change) { | if ($reparse_change) { | ||||
$classes[] = 'PhabricatorRepositorySvnCommitChangeParserWorker'; | $classes[] = 'PhabricatorRepositorySvnCommitChangeParserWorker'; | ||||
} | } | ||||
break; | break; | ||||
} | } | ||||
if ($reparse_cache) { | |||||
$classes[] = 'PhabricatorRepositoryCommitCacheParserWorker'; | |||||
} | |||||
if ($reparse_herald) { | if ($reparse_herald) { | ||||
$classes[] = 'PhabricatorRepositoryCommitHeraldWorker'; | $classes[] = 'PhabricatorRepositoryCommitHeraldWorker'; | ||||
} | } | ||||
if ($reparse_owners) { | if ($reparse_owners) { | ||||
$classes[] = 'PhabricatorRepositoryCommitOwnersWorker'; | $classes[] = 'PhabricatorRepositoryCommitOwnersWorker'; | ||||
} | } | ||||
Show All 31 Lines |