Add Related Commits for Owners

Summary:
For each commit, find the affected packages, and provide a way to
search by package.

Test Plan:
create commits that touch and don't touch two packages, and verify
that they display correctly in all the UI pages.

Reviewers: epriestley, blair, nh, tuomaspelkonen

Reviewed By: epriestley

CC: benmathews, aran, epriestley, btrahan, jungejason, mpodobnik, prithvi

Maniphest Tasks: T83

Differential Revision: 1208
This commit is contained in:
jungejason
2011-12-14 00:53:25 -08:00
parent d739d8ccd5
commit c13b7da290
18 changed files with 524 additions and 32 deletions

View File

@@ -26,7 +26,9 @@ $is_all = false;
$reparse_message = false;
$reparse_change = false;
$reparse_herald = false;
$reparse_owners = false;
$reparse_what = false;
$force = false;
$args = array_slice($argv, 1);
foreach ($args as $arg) {
@@ -47,6 +49,12 @@ foreach ($args as $arg) {
case 'herald':
$reparse_herald = true;
break;
case 'owners':
$reparse_owners = true;
break;
case 'force':
$force = true;
break;
case 'trace':
PhutilServiceProfiler::installEchoListener();
break;
@@ -67,9 +75,21 @@ foreach ($args as $arg) {
if (!$reparse_what) {
usage("Specify a commit or repository to reparse.");
}
if (!$reparse_message && !$reparse_change && !$reparse_herald) {
usage("Specify what information to reparse with --message, --change, and/or ".
"--herald.");
if (!$reparse_message && !$reparse_change && !$reparse_herald &&
!$reparse_owners) {
usage("Specify what information to reparse with --message, --change, ".
"--herald, and/or --owners");
}
if ($reparse_owners && !$force) {
echo phutil_console_wrap(
"You are about to recreate the relationship entries between the commits ".
"and the packages they touch. This might delete some existing ".
"relationship entries for some old commits.");
if (!phutil_console_confirm('Are you ready to continue?')) {
echo "Cancelled.\n";
exit(1);
}
}
$commits = array();
@@ -157,6 +177,10 @@ foreach ($commits as $commit) {
$classes[] = 'PhabricatorRepositoryCommitHeraldWorker';
}
if ($reparse_owners) {
$classes[] = 'PhabricatorRepositoryCommitOwnersWorker';
}
$spec = array(
'commitID' => $commit->getID(),
'only' => true,
@@ -194,7 +218,7 @@ function help() {
$help = <<<EOHELP
**SUMMARY**
**reparse.php** __what__ __which_parts__ [--trace]
**reparse.php** __what__ __which_parts__ [--trace] [--force]
Rerun the Diffusion parser on specific commits and repositories. Mostly
useful for debugging changes to Diffusion.
@@ -221,6 +245,11 @@ function help() {
__--herald__
Reevaluate Herald rules (may send huge amounts of email!)
__--owners__
Reevaluate related commits for owners packages (may delete existing
relationship entries between your package and some old commits!)
__--force__: act noninteractively, without prompting
__--trace__: run with debug tracing
__--help__: show this help