https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113169

Revision: 113169
Author:   reedy
Date:     2012-03-06 19:21:07 +0000 (Tue, 06 Mar 2012)
Log Message:
-----------
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

Modified Paths:
--------------
    trunk/phase3/maintenance/populateRevisionSha1.php

Modified: trunk/phase3/maintenance/populateRevisionSha1.php
===================================================================
--- trunk/phase3/maintenance/populateRevisionSha1.php   2012-03-06 18:56:12 UTC 
(rev 113168)
+++ trunk/phase3/maintenance/populateRevisionSha1.php   2012-03-06 19:21:07 UTC 
(rev 113169)
@@ -67,7 +67,7 @@
                $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 @@
                }
                return $count;
        }
-       
+
+       /**
+        * @return int
+        */
        protected function doSha1LegacyUpdates() {
                $count = 0;
                $db = $this->getDB( DB_MASTER );
@@ -116,8 +119,16 @@
                        }
                }
                $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 @@
                }
        }
 
+       /**
+        * @param $row
+        * @return bool
+        */
        protected function upgradeLegacyArchiveRow( $row ) {
                $db = $this->getDB( DB_MASTER );
                $rev = Revision::newFromArchiveRow( $row );


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to