r64049 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64048‎ | r64049 | r64050 >
Date:00:06, 23 March 2010
Author:tstarling
Status:ok
Tags:
Comment:
* MFT r63764, r63897, r63898, r63899, r63900, r63901, r63902. Most changes are to allow 1.16 to be used as the base for a wmf-deployment branch.
* Release notes for important changes.
Modified paths:
  • /branches/REL1_16/extensions/ExtensionDistributor (modified) (history)
  • /branches/REL1_16/extensions/ExtensionDistributor/svn-invoker.conf.sample (added) (history)
  • /branches/REL1_16/extensions/ExtensionDistributor/svn-invoker.php (modified) (history)
  • /branches/REL1_16/phase3 (modified) (history)
  • /branches/REL1_16/phase3/RELEASE-NOTES (modified) (history)
  • /branches/REL1_16/phase3/includes (modified) (history)
  • /branches/REL1_16/phase3/includes/ChangesList.php (modified) (history)
  • /branches/REL1_16/phase3/includes/ConfEditor.php (modified) (history)
  • /branches/REL1_16/phase3/includes/HTMLForm.php (modified) (history)
  • /branches/REL1_16/phase3/includes/HistoryPage.php (modified) (history)
  • /branches/REL1_16/phase3/includes/LocalisationCache.php (modified) (history)
  • /branches/REL1_16/phase3/includes/OutputPage.php (modified) (history)
  • /branches/REL1_16/phase3/includes/api (modified) (history)
  • /branches/REL1_16/phase3/includes/db/LoadBalancer.php (modified) (history)
  • /branches/REL1_16/phase3/includes/json/Services_JSON.php (modified) (history)
  • /branches/REL1_16/phase3/includes/specials (modified) (history)
  • /branches/REL1_16/phase3/maintenance/cleanupTable.inc (modified) (history)
  • /branches/REL1_16/phase3/maintenance/deleteSelfExternals.php (modified) (history)
  • /branches/REL1_16/phase3/maintenance/dumpInterwiki.php (modified) (history)
  • /branches/REL1_16/phase3/maintenance/lag.php (modified) (history)
  • /branches/REL1_16/phase3/maintenance/moveBatch.php (modified) (history)
  • /branches/REL1_16/phase3/maintenance/namespaceDupes.php (modified) (history)
  • /branches/REL1_16/phase3/maintenance/storage/dumpRev.php (modified) (history)
  • /branches/REL1_16/phase3/maintenance/storage/recompressTracked.php (modified) (history)
  • /branches/REL1_16/phase3/skins/common/jquery.js (modified) (history)
  • /branches/REL1_16/phase3/skins/common/jquery.min.js (modified) (history)

Diff [purge]

Index: branches/REL1_16/extensions/ExtensionDistributor/svn-invoker.conf.sample
@@ -0,0 +1,4 @@
 2+<?php
 3+
 4+$wgExtDistWorkingCopy = '/path/to/mw-working-copy';
 5+
Index: branches/REL1_16/extensions/ExtensionDistributor/svn-invoker.php
@@ -9,7 +9,13 @@
1010 exit( 1 );
1111 }
1212
13 -$wgExtDistWorkingCopy = '/mnt/upload5/private/ExtensionDistributor/mw-snapshot';
 13+$confFile = dirname( __FILE__ ) . '/svn-invoker.conf';
 14+if ( !file_exists( $confFile ) ) {
 15+ echo "Error: please create svn-invoker.conf based on svn-invoker.conf.sample\n";
 16+ exit( 1 );
 17+}
 18+require( $confFile );
 19+
1420 svnExecute();
1521
1622 function svnValidate( $s ) {
Property changes on: branches/REL1_16/extensions/ExtensionDistributor
___________________________________________________________________
Added: svn:mergeinfo
1723 Merged /trunk/extensions/ExtensionDistributor:r63902
Added: svn:ignore
1824 + svn-invoker.conf
Index: branches/REL1_16/phase3/RELEASE-NOTES
@@ -10,40 +10,30 @@
1111
1212 Selected changes since MediaWiki 1.15 that may be of interest:
1313
14 -* Watchlists now have RSS/Atom feeds. RSS feeds generally are now hidden, since
15 - Atom is a better protocol and is supported by virtually all clients.
 14+* Watchlists now have RSS/Atom feeds. RSS feeds generally are now hidden, since Atom is a better protocol and is supported by virtually all clients.
1615
1716 * It's now possible to block users from sending email via Special:Emailuser.
1817
19 -* The maintenance script system was overhauled. Most maintenance scripts now
20 - have a useful help page when you run them with --help.
 18+* The maintenance script system was overhauled. Most maintenance scripts now have a useful help page when you run them with --help.
2119
22 -* AdminSettings.php is no longer required in order to run maintenance scripts.
23 - You can just set $wgDBadminuser and $wgDBadminpassword in your
24 - LocalSettings.php instead.
 20+* AdminSettings.php is no longer required in order to run maintenance scripts. You can just set $wgDBadminuser and $wgDBadminpassword in your LocalSettings.php instead.
2521
26 -* The preferences system was overhauled. Preferences are stored in a more
27 - compact format. Changes to site default preferences will automatically affect
28 - all users who have not chosen a different preference.
 22+* The preferences system was overhauled. Preferences are stored in a more compact format. Changes to site default preferences will automatically affect all users who have not chosen a different preference.
2923
30 -* Support for SQLite was improved. Some broken features were fixed, and it now
31 - has an efficient full-text search.
 24+* Support for SQLite was improved. Some broken features were fixed, and it now has an efficient full-text search.
3225
33 -* The user groups ACL system was improved by allowing rights to be revoked,
34 - instead of just granted.
 26+* The user groups ACL system was improved by allowing rights to be revoked, instead of just granted.
3527
36 -* A new localisation caching system was introduced, which will make MediaWiki
37 - faster for almost everyone, especially when lots of extensions are enabled.
 28+* A new localisation caching system was introduced, which will make MediaWiki faster for almost everyone, especially when lots of extensions are enabled.
3829
39 - By default, this new system makes a lot of database queries. If your database
40 - is particularly slow, or if your system administrator limits your query
41 - count, or if you want to squeeze as much performance as possible out of
42 - Mediawiki, set $wgCacheDirectory to a writable path on the local filesystem.
43 - Make sure you have the DBA extension for PHP installed, this will improve
44 - performance further.
 30+By default, this new system makes a lot of database queries. If your database is particularly slow, or if your system administrator limits your query count, or if you want to squeeze as much performance as possible out of Mediawiki, set $wgCacheDirectory to a writable path on the local filesystem. Make sure you have the DBA extension for PHP installed, this will improve performance further.
4531
4632 === Changes since 1.16 beta 1 ===
 33+
4734 * Fixed errors in maintenance/patchSql.php
 35+* (bug 19627) Fix regression from r57867 where HTMLForm would output
 36+ <element classes="foo bar"> rather than <element class="foo bar">
 37+* Fixed broken "-r" option to maintenance/lag.php
4838
4939 === Configuration changes in 1.16 ===
5040
Property changes on: branches/REL1_16/phase3/maintenance/moveBatch.php
___________________________________________________________________
Modified: svn:mergeinfo
5141 Merged /trunk/phase3/maintenance/moveBatch.php:r63764,63897-63901
Index: branches/REL1_16/phase3/maintenance/dumpInterwiki.php
@@ -14,7 +14,7 @@
1515
1616 $optionsWithArgs = array( "o" );
1717 require_once( dirname(__FILE__) . '/commandLine.inc' );
18 -require( "dumpInterwiki.inc" );
 18+require( dirname(__FILE__)."/dumpInterwiki.inc" );
1919 chdir( $oldCwd );
2020
2121 # Output
Property changes on: branches/REL1_16/phase3/maintenance/cleanupTable.inc
___________________________________________________________________
Modified: svn:mergeinfo
2222 Merged /trunk/phase3/maintenance/cleanupTable.inc:r63764,63897-63901
Index: branches/REL1_16/phase3/maintenance/namespaceDupes.php
@@ -153,20 +153,12 @@
154154 * @param $suffix String Suffix to append to renamed articles
155155 */
156156 private function checkNamespace( $ns, $name, $fix, $suffix = '' ) {
157 - if( $ns == 0 ) {
158 - $header = "Checking interwiki prefix: \"$name\"\n";
159 - } else {
160 - $header = "Checking namespace $ns: \"$name\"\n";
161 - }
162 -
163157 $conflicts = $this->getConflicts( $ns, $name );
164158 $count = count( $conflicts );
165159 if( $count == 0 ) {
166 - $this->output( $header . "... no conflict detected!\n" );
167160 return true;
168161 }
169162
170 - $this->output( $header . "... $count conflicts detected:\n" );
171163 $ok = true;
172164 foreach( $conflicts as $row ) {
173165 $resolvable = $this->reportConflict( $row, $suffix );
Index: branches/REL1_16/phase3/maintenance/lag.php
@@ -18,21 +18,22 @@
1919 public function execute() {
2020 if ( $this->hasOption( 'r' ) ) {
2121 $lb = wfGetLB();
22 - $this->output( 'time ' );
23 - for( $i = 0; $i < $lb->getServerCount(); $i++ ) {
 22+ echo 'time ';
 23+ for( $i = 1; $i < $lb->getServerCount(); $i++ ) {
2424 $hostname = $lb->getServerName( $i );
25 - $this->output( sprintf( "%-12s ", $hostname ) );
 25+ printf( "%-12s ", $hostname );
2626 }
27 - $this->output( "\n" );
 27+ echo "\n";
2828
2929 while( 1 ) {
 30+ $lb->clearLagTimeCache();
3031 $lags = $lb->getLagTimes();
3132 unset( $lags[0] );
32 - $this->output( gmdate( 'H:i:s' ) . ' ' );
 33+ echo gmdate( 'H:i:s' ) . ' ';
3334 foreach( $lags as $i => $lag ) {
34 - $this->output( sprintf( "%-12s " , $lag === false ? 'false' : $lag ) );
 35+ printf( "%-12s " , $lag === false ? 'false' : $lag );
3536 }
36 - $this->output( "\n" );
 37+ echo "\n";
3738 sleep( 5 );
3839 }
3940 } else {
Index: branches/REL1_16/phase3/maintenance/storage/recompressTracked.php
@@ -31,11 +31,13 @@
3232 var $copyOnly = false;
3333 var $isChild = false;
3434 var $slaveId = false;
 35+ var $noCount = false;
3536 var $debugLog, $infoLog, $criticalLog;
3637 var $store;
3738
3839 static $optionsWithArgs = array( 'procs', 'slave-id', 'debug-log', 'info-log', 'critical-log' );
3940 static $cmdLineOptionMap = array(
 41+ 'no-count' => 'noCount',
4042 'procs' => 'numProcs',
4143 'copy-only' => 'copyOnly',
4244 'child' => 'isChild',
@@ -259,12 +261,16 @@
260262 $dbr = wfGetDB( DB_SLAVE );
261263 $i = 0;
262264 $startId = 0;
263 - $numPages = $dbr->selectField( 'blob_tracking',
264 - 'COUNT(DISTINCT bt_page)',
265 - # A condition is required so that this query uses the index
266 - array( 'bt_moved' => 0 ),
267 - __METHOD__
268 - );
 265+ if ( $this->noCount ) {
 266+ $numPages = '[unknown]';
 267+ } else {
 268+ $numPages = $dbr->selectField( 'blob_tracking',
 269+ 'COUNT(DISTINCT bt_page)',
 270+ # A condition is required so that this query uses the index
 271+ array( 'bt_moved' => 0 ),
 272+ __METHOD__
 273+ );
 274+ }
269275 if ( $this->copyOnly ) {
270276 $this->info( "Copying pages..." );
271277 } else {
@@ -310,7 +316,7 @@
311317 if ( $current == $end || $this->numBatches >= $this->reportingInterval ) {
312318 $this->numBatches = 0;
313319 $this->info( "$label: $current / $end" );
314 - wfWaitForSlaves( 5 );
 320+ $this->waitForSlaves();
315321 }
316322 }
317323
@@ -321,12 +327,16 @@
322328 $dbr = wfGetDB( DB_SLAVE );
323329 $startId = 0;
324330 $i = 0;
325 - $numOrphans = $dbr->selectField( 'blob_tracking',
326 - 'COUNT(DISTINCT bt_text_id)',
327 - array( 'bt_moved' => 0, 'bt_page' => 0 ),
328 - __METHOD__ );
329 - if ( !$numOrphans ) {
330 - return;
 331+ if ( $this->noCount ) {
 332+ $numOrphans = '[unknown]';
 333+ } else {
 334+ $numOrphans = $dbr->selectField( 'blob_tracking',
 335+ 'COUNT(DISTINCT bt_text_id)',
 336+ array( 'bt_moved' => 0, 'bt_page' => 0 ),
 337+ __METHOD__ );
 338+ if ( !$numOrphans ) {
 339+ return;
 340+ }
331341 }
332342 if ( $this->copyOnly ) {
333343 $this->info( "Copying orphans..." );
@@ -404,7 +414,7 @@
405415 case 'quit':
406416 return;
407417 }
408 - wfWaitForSlaves( 5 );
 418+ $this->waitForSlaves();
409419 }
410420 }
411421
@@ -469,6 +479,7 @@
470480 $this->debug( "$titleText: committing blob with " . $trx->getSize() . " items" );
471481 $trx->commit();
472482 $trx = new CgzCopyTransaction( $this, $this->pageBlobClass );
 483+ $this->waitForSlaves();
473484 }
474485 }
475486 $startId = $row->bt_text_id;
@@ -545,6 +556,9 @@
546557 $this->debug( 'Incomplete: ' . $res->numRows() . ' rows' );
547558 foreach ( $res as $row ) {
548559 $this->moveTextRow( $row->bt_text_id, $row->bt_new_url );
 560+ if ( $row->bt_text_id % 10 == 0 ) {
 561+ $this->waitForSlaves();
 562+ }
549563 }
550564 $startId = $row->bt_text_id;
551565 }
@@ -604,11 +618,26 @@
605619 $this->debug( "[orphan]: committing blob with " . $trx->getSize() . " rows" );
606620 $trx->commit();
607621 $trx = new CgzCopyTransaction( $this, $this->orphanBlobClass );
 622+ $this->waitForSlaves();
608623 }
609624 }
610625 $this->debug( "[orphan]: committing blob with " . $trx->getSize() . " rows" );
611626 $trx->commit();
612627 }
 628+
 629+ /**
 630+ * Wait for slaves (quietly)
 631+ */
 632+ function waitForSlaves() {
 633+ $lb = wfGetLB();
 634+ while ( true ) {
 635+ list( $host, $maxLag ) = $lb->getMaxLag();
 636+ if ( $maxLag < 2 ) {
 637+ break;
 638+ }
 639+ sleep( 5 );
 640+ }
 641+ }
613642 }
614643
615644 /**
Index: branches/REL1_16/phase3/maintenance/storage/dumpRev.php
@@ -62,7 +62,8 @@
6363 $text = gzinflate( $text );
6464 }
6565 if ( in_array( 'object', $flags ) ) {
66 - $text = unserialize( $text );
 66+ $obj = unserialize( $text );
 67+ $text = $obj->getText();
6768 }
6869
6970 if ( is_object( $text ) ) {
Property changes on: branches/REL1_16/phase3/maintenance/deleteSelfExternals.php
___________________________________________________________________
Modified: svn:mergeinfo
7071 Merged /trunk/phase3/maintenance/deleteSelfExternals.php:r63764,63897-63901
Property changes on: branches/REL1_16/phase3/skins/common/jquery.min.js
___________________________________________________________________
Modified: svn:mergeinfo
7172 Merged /trunk/phase3/skins/common/jquery.min.js:r63764,63897-63901
Property changes on: branches/REL1_16/phase3/skins/common/jquery.js
___________________________________________________________________
Modified: svn:mergeinfo
7273 Merged /trunk/phase3/skins/common/jquery.js:r63764,63897-63901
Property changes on: branches/REL1_16/phase3/includes/ChangesList.php
___________________________________________________________________
Modified: svn:mergeinfo
7374 Merged /trunk/phase3/includes/ChangesList.php:r63764,63897-63901
Property changes on: branches/REL1_16/phase3/includes/specials
___________________________________________________________________
Modified: svn:mergeinfo
7475 Merged /trunk/phase3/includes/specials:r63764,63897-63901
Index: branches/REL1_16/phase3/includes/HTMLForm.php
@@ -572,7 +572,7 @@
573573 if( !$hasLeftColumn ) // Avoid strange spacing when no labels exist
574574 $classes[] = 'mw-htmlform-nolabel';
575575 $attribs = array(
576 - 'classes' => implode( ' ', $classes ),
 576+ 'class' => implode( ' ', $classes ),
577577 );
578578 if ( $sectionName )
579579 $attribs['id'] = Sanitizer::escapeId( "mw-htmlform-$sectionName" );
Property changes on: branches/REL1_16/phase3/includes/ConfEditor.php
___________________________________________________________________
Modified: svn:mergeinfo
580580 Merged /trunk/phase3/includes/ConfEditor.php:r63764,63897-63901
Index: branches/REL1_16/phase3/includes/db/LoadBalancer.php
@@ -916,4 +916,11 @@
917917 $this->mLagTimes = $this->getLoadMonitor()->getLagTimes( array_keys( $this->mServers ), $wiki );
918918 return $this->mLagTimes;
919919 }
 920+
 921+ /**
 922+ * Clear the cache for getLagTimes
 923+ */
 924+ function clearLagTimeCache() {
 925+ $this->mLagTimes = null;
 926+ }
920927 }
Property changes on: branches/REL1_16/phase3/includes/api
___________________________________________________________________
Modified: svn:mergeinfo
921928 Merged /trunk/phase3/includes/api:r63764,63897-63901
Property changes on: branches/REL1_16/phase3/includes/HistoryPage.php
___________________________________________________________________
Modified: svn:mergeinfo
922929 Merged /trunk/phase3/includes/HistoryPage.php:r63764,63897-63901
Property changes on: branches/REL1_16/phase3/includes/LocalisationCache.php
___________________________________________________________________
Modified: svn:mergeinfo
923930 Merged /trunk/phase3/includes/LocalisationCache.php:r63764,63897-63901
Property changes on: branches/REL1_16/phase3/includes/json/Services_JSON.php
___________________________________________________________________
Modified: svn:mergeinfo
924931 Merged /trunk/phase3/includes/json/Services_JSON.php:r63764,63897-63901
Property changes on: branches/REL1_16/phase3/includes/OutputPage.php
___________________________________________________________________
Modified: svn:mergeinfo
925932 Merged /trunk/phase3/includes/OutputPage.php:r63764,63897-63901
Property changes on: branches/REL1_16/phase3/includes
___________________________________________________________________
Modified: svn:mergeinfo
926933 Merged /trunk/phase3/includes:r63764,63897-63901
Property changes on: branches/REL1_16/phase3
___________________________________________________________________
Modified: svn:mergeinfo
927934 Merged /trunk/phase3:r63764,63897-63901

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r63764(bug 19627) Fix regression from r57867 where HTMLForm would output <element c...catrope08:11, 15 March 2010
r63897* Fixed complete breakage of "lag.php -r" due to spurious line-endings introd...tstarling05:23, 18 March 2010
r63898* Quieter, more frequent slave waits...tstarling05:32, 18 March 2010
r63899Fixed object type unserialization. Based on WMF working copy patch, tested th...tstarling05:34, 18 March 2010
r63900Fixed inappropriate include_path dependency. From WMF working copy hack.tstarling05:38, 18 March 2010
r63901Don't send hundreds of lines of useless progress messages to stdout.tstarling05:42, 18 March 2010
r63902Fix for incorrect hard-coded path name in standalone script. To eliminate WMF...tstarling05:54, 18 March 2010

Status & tagging log