From 6f806bd12b3735ab427eb80d9a23dc875a945887 Mon Sep 17 00:00:00 2001 From: Joshua Spence Date: Tue, 9 Sep 2014 00:04:25 +1000 Subject: [PATCH] Use `PhutilConsoleProgressBar` for the `repository/reparse.php` script Summary: The output from this script is too verbose... all that I care about is the overall progress. Test Plan: Ran the script on a large repository. ```lang=bash ./scripts/repository/reparse.php --all XYZ --message NOTE: This script will queue tasks to reparse the data. Once the tasks have been queued, you need to run Taskmaster daemons to execute them. QUEUEING TASKS (92,969 Commits): [ ] 0.1% ``` Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: epriestley, Korvin Differential Revision: https://secure.phabricator.com/D10441 --- scripts/repository/reparse.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/repository/reparse.php b/scripts/repository/reparse.php index 258ef28807..c95a7e91b4 100755 --- a/scripts/repository/reparse.php +++ b/scripts/repository/reparse.php @@ -218,6 +218,9 @@ if ($all_from_repo && !$force_local) { echo "QUEUEING TASKS (".number_format(count($commits))." Commits):\n"; } +$progress = new PhutilConsoleProgressBar(); +$progress->setTotal(count($commits)); + $tasks = array(); foreach ($commits as $commit) { $classes = array(); @@ -271,20 +274,18 @@ foreach ($commits as $commit) { $class, $spec, PhabricatorWorker::PRIORITY_IMPORT); - - $commit_name = 'r'.$callsign.$commit->getCommitIdentifier(); - echo " Queued '{$class}' for commit '{$commit_name}'.\n"; } } else { foreach ($classes as $class) { $worker = newv($class, array($spec)); - echo "Running '{$class}'...\n"; $worker->executeTask(); } } + + $progress->update(1); } -echo "\nDone.\n"; +$progress->done(); function usage($message) { echo phutil_console_format(