mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-15 19:32:40 +01:00
793f185d29
Summary: Ref T13218. This is like `loadOneWhere(...)` but with more dark magic. Get rid of it. Test Plan: - Forced `20130219.commitsummarymig.php` to hit this code and ran it with `bin/storage upgrade --force --apply ...`. - Ran `20130409.commitdrev.php` with `bin/storage upgrade --force --apply ...`. - Called `user.search` to indirectly get primary email information. - Did not test Releeph at all. Reviewers: amckinley Reviewed By: amckinley Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam Maniphest Tasks: T13218 Differential Revision: https://secure.phabricator.com/D19876
31 lines
663 B
PHP
31 lines
663 B
PHP
<?php
|
|
|
|
echo pht('Backfilling commit summaries...')."\n";
|
|
|
|
$table = new PhabricatorRepositoryCommit();
|
|
$conn_w = $table->establishConnection('w');
|
|
$commits = new LiskMigrationIterator($table);
|
|
foreach ($commits as $commit) {
|
|
echo pht('Filling Commit #%d', $commit->getID())."\n";
|
|
|
|
if (strlen($commit->getSummary())) {
|
|
continue;
|
|
}
|
|
|
|
$data = id(new PhabricatorRepositoryCommitData())->loadOneWhere(
|
|
'commitID = %d',
|
|
$commit->getID());
|
|
|
|
if (!$data) {
|
|
continue;
|
|
}
|
|
|
|
queryfx(
|
|
$conn_w,
|
|
'UPDATE %T SET summary = %s WHERE id = %d',
|
|
$commit->getTableName(),
|
|
$data->getSummary(),
|
|
$commit->getID());
|
|
}
|
|
|
|
echo pht('Done.')."\n";
|