Revert r114067, r114071, r114075, r114079, r114081, r114082, r114084, r114086, r11408...
[lhc/web/wiklou.git] / maintenance / updateCollation.php
index 7e8a7ee..6160a30 100644 (file)
@@ -43,7 +43,7 @@ using the page title and cl_sortkey_prefix.  If everything's collation is
 up-to-date, it will do nothing.
 TEXT;
 
-               $this->addOption( 'force', 'Run on all rows, even if the collation is ' . 
+               $this->addOption( 'force', 'Run on all rows, even if the collation is ' .
                        'supposed to be up-to-date.' );
                $this->addOption( 'previous-collation', 'Set the previous value of ' .
                        '$wgCategoryCollation here to speed up this script, especially if your ' .
@@ -104,14 +104,14 @@ TEXT;
                        );
                        $this->output( " processing..." );
 
-                       $dbw->begin();
+                       $dbw->begin( __METHOD__ );
                        foreach ( $res as $row ) {
                                $title = Title::newFromRow( $row );
                                if ( !$row->cl_collation ) {
                                        # This is an old-style row, so the sortkey needs to be
                                        # converted.
                                        if ( $row->cl_sortkey == $title->getText()
-                                       || $row->cl_sortkey == $title->getPrefixedText() ) {
+                                               || $row->cl_sortkey == $title->getPrefixedText() ) {
                                                $prefix = '';
                                        } else {
                                                # Custom sortkey, use it as a prefix
@@ -143,19 +143,19 @@ TEXT;
                                        __METHOD__
                                );
                        }
-                       $dbw->commit();
+                       $dbw->commit( __METHOD__ );
 
                        if ( $force && $row ) {
                                $encFrom = $dbw->addQuotes( $row->cl_from );
                                $encTo = $dbw->addQuotes( $row->cl_to );
-                               $batchConds = array( 
+                               $batchConds = array(
                                        "(cl_from = $encFrom AND cl_to > $encTo) " .
                                        " OR cl_from > $encFrom" );
                        }
 
                        $count += $res->numRows();
                        $this->output( "$count done.\n" );
-                       
+
                        if ( ++$batchCount % self::SYNC_INTERVAL == 0 ) {
                                $this->output( "Waiting for slaves ... " );
                                wfWaitForSlaves();