From 3a8e088540075355e1c5d1e59115a5f80808387b Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Tue, 6 Mar 2012 19:21:07 +0000 Subject: [PATCH] Minor followup to r111795, make doSha1LegacyUpdates return it's count value so it can be added to the count of archive rows Don't return true in doSha1Updates(), return 0 if table is empty --- maintenance/populateRevisionSha1.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/maintenance/populateRevisionSha1.php b/maintenance/populateRevisionSha1.php index e829848c31..6125fc0831 100644 --- a/maintenance/populateRevisionSha1.php +++ b/maintenance/populateRevisionSha1.php @@ -67,7 +67,7 @@ class PopulateRevisionSha1 extends LoggedUpdateMaintenance { $end = $db->selectField( $table, "MAX($idCol)", false, __METHOD__ ); if ( !$start || !$end ) { $this->output( "...$table table seems to be empty.\n" ); - return true; + return 0; } $count = 0; @@ -95,7 +95,10 @@ class PopulateRevisionSha1 extends LoggedUpdateMaintenance { } return $count; } - + + /** + * @return int + */ protected function doSha1LegacyUpdates() { $count = 0; $db = $this->getDB( DB_MASTER ); @@ -116,8 +119,16 @@ class PopulateRevisionSha1 extends LoggedUpdateMaintenance { } } $db->commit( __METHOD__ ); + return $count; } + /** + * @param $row + * @param $table + * @param $idCol + * @param $prefix + * @return bool + */ protected function upgradeRow( $row, $table, $idCol, $prefix ) { $db = $this->getDB( DB_MASTER ); if ( $table === 'archive' ) { @@ -140,6 +151,10 @@ class PopulateRevisionSha1 extends LoggedUpdateMaintenance { } } + /** + * @param $row + * @return bool + */ protected function upgradeLegacyArchiveRow( $row ) { $db = $this->getDB( DB_MASTER ); $rev = Revision::newFromArchiveRow( $row ); -- 2.20.1