@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Remove outdated "rebuild_summaries.php" script

Summary:
Ref T13195. See PHI842. Alternative to D19638.

Instead of doing all the stuff in D19638, //just// remove the `rebuild_summaries.php` script. This script is outdated, copy/pastes the rebuild logic, and doesn't understand unreachable commits.

If we had some use for it it should move to `bin/repository rebuild-summary ...` or similar, but it's not clear there's any use for it. The incremental summary rebuilds seem to work fine as-is.

Test Plan: Grepped for callers or documentation referencing this script, found nothing.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13195

Differential Revision: https://secure.phabricator.com/D19643

-53
-53
scripts/repository/rebuild_summaries.php
··· 1 - #!/usr/bin/env php 2 - <?php 3 - 4 - $root = dirname(dirname(dirname(__FILE__))); 5 - require_once $root.'/scripts/__init_script__.php'; 6 - 7 - $commit = new PhabricatorRepositoryCommit(); 8 - 9 - $conn_w = id(new PhabricatorRepository())->establishConnection('w'); 10 - $sizes = queryfx_all( 11 - $conn_w, 12 - 'SELECT repositoryID, count(*) N FROM %T GROUP BY repositoryID', 13 - $commit->getTableName()); 14 - $sizes = ipull($sizes, 'N', 'repositoryID'); 15 - 16 - $maxes = queryfx_all( 17 - $conn_w, 18 - 'SELECT repositoryID, max(epoch) maxEpoch FROM %T GROUP BY repositoryID', 19 - $commit->getTableName()); 20 - $maxes = ipull($maxes, 'maxEpoch', 'repositoryID'); 21 - 22 - 23 - $repository_ids = array_keys($sizes + $maxes); 24 - 25 - echo pht('Updating %d repositories', count($repository_ids)); 26 - 27 - foreach ($repository_ids as $repository_id) { 28 - $last_commit = queryfx_one( 29 - $conn_w, 30 - 'SELECT id FROM %T WHERE repositoryID = %d AND epoch = %d LIMIT 1', 31 - $commit->getTableName(), 32 - $repository_id, 33 - idx($maxes, $repository_id, 0)); 34 - if ($last_commit) { 35 - $last_commit = $last_commit['id']; 36 - } else { 37 - $last_commit = 0; 38 - } 39 - queryfx( 40 - $conn_w, 41 - 'INSERT INTO %T (repositoryID, lastCommitID, size, epoch) 42 - VALUES (%d, %d, %d, %d) ON DUPLICATE KEY UPDATE 43 - lastCommitID = VALUES(lastCommitID), 44 - size = VALUES(size), 45 - epoch = VALUES(epoch)', 46 - PhabricatorRepository::TABLE_SUMMARY, 47 - $repository_id, 48 - $last_commit, 49 - idx($sizes, $repository_id, 0), 50 - idx($maxes, $repository_id, 0)); 51 - echo '.'; 52 - } 53 - echo "\n".pht('Done.')."\n";