Merge "[FileRepo] * Added getReadOnlyReason() function to FileRepo to check read...
authorDemon <chadh@wikimedia.org>
Sat, 24 Mar 2012 15:50:36 +0000 (15:50 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sat, 24 Mar 2012 15:50:37 +0000 (15:50 +0000)
17 files changed:
.gitignore
CREDITS
README
RELEASE-NOTES-1.19
RELEASE-NOTES-1.20
docs/database.txt
includes/ChangeTags.php
includes/Export.php
includes/User.php
includes/db/DatabasePostgres.php
includes/installer/DatabaseInstaller.php
includes/installer/PostgresUpdater.php
includes/profiler/Profiler.php
includes/profiler/ProfilerSimple.php
includes/specials/SpecialRecentchanges.php
includes/specials/SpecialWatchlist.php
tests/selenium/installer/README.txt

index 6688707..943378a 100644 (file)
@@ -19,3 +19,5 @@ cache/*.cdb
 images/[0-9a-f]
 images/temp
 images/thumb
+maintenance/dev/data/
+maintenance/.mweval_history
\ No newline at end of file
diff --git a/CREDITS b/CREDITS
index 54402b0..d0c4623 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -199,4 +199,4 @@ following names for their contribution to the product.
 * Meno25
 * Rotem Liss
 * Shinjiman
-* Translatewiki.net Translators http://translatewiki.net/wiki/Special:ListUsers/translator
+* Translatewiki.net Translators https://translatewiki.net/wiki/Special:ListUsers/translator
diff --git a/README b/README
index 3c3d92d..48cf336 100644 (file)
--- a/README
+++ b/README
@@ -86,8 +86,8 @@ The official website for MediaWiki is located at:
 
        http://www.mediawiki.org/
 
-The code is currently maintained in a Subversion repository at
-svn.wikimedia.org. See http://www.mediawiki.org/wiki/Subversion for details.
+The code is currently maintained in a Git repository at
+gerrit.wikimedia.org. See http://www.mediawiki.org/wiki/Git for details.
 
 Please report bugs and make feature requests in our Bugzilla system:
 
index 7ba2c83..9255909 100644 (file)
@@ -33,6 +33,7 @@ production.
   inside a heading.
 * (bug 34907) Fixed exposure of tokens through load.php that could have facilitated
   CSRF attacks
+* Special:Watchlist no longer sets links to feed when the user is anonymous
 
 === Configuration changes in 1.19 ===
 * Removed SkinTemplateSetupPageCss hook; use BeforePageDisplay instead.
index bef93ee..d4533aa 100644 (file)
@@ -50,6 +50,7 @@ production.
 * (bug 34735) Updated compressOld.php documentation to mention the different
   usages of -s and -n parameters depending on compression type
 * (bug 13896) Rendering of devanagari numbers in automatic '#' number lists
+* (bug 18704) Add an unique CSS class or ID to the tagfilter table row at RecentChanges 
 
 === API changes in 1.20 ===
 * (bug 34316) Add ability to retrieve maximum upload size from MediaWiki API.
index 70815d4..c0a2412 100644 (file)
@@ -8,7 +8,7 @@ By Tim Starling, January 2006.
 For information about the MediaWiki database layout, such as a 
 description of the tables and their contents, please see:
   http://www.mediawiki.org/wiki/Manual:Database_layout
-  http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/maintenance/tables.sql?view=markup
+  https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/core.git;a=blob_plain;f=maintenance/tables.sql;hb=HEAD
 
 
 ------------------------------------------------------------------------
index 63d3732..01b93ad 100644 (file)
@@ -210,7 +210,7 @@ class ChangeTags {
                        return $fullForm ? '' : array();
 
                $data = array( Html::rawElement( 'label', array( 'for' => 'tagfilter' ), wfMsgExt( 'tag-filter', 'parseinline' ) ),
-                       Xml::input( 'tagfilter', 20, $selected ) );
+                       Xml::input( 'tagfilter', 20, $selected ), array( 'class' => 'mw-tagfilter-input' ) );
 
                if ( !$fullForm ) {
                        return $data;
@@ -219,7 +219,7 @@ class ChangeTags {
                $html = implode( '&#160;', $data );
                $html .= "\n" . Xml::element( 'input', array( 'type' => 'submit', 'value' => wfMsg( 'tag-filter-submit' ) ) );
                $html .= "\n" . Html::hidden( 'title', $title->getPrefixedText() );
-               $html = Xml::tags( 'form', array( 'action' => $title->getLocalURL(), 'method' => 'get' ), $html );
+               $html = Xml::tags( 'form', array( 'action' => $title->getLocalURL(), 'class' => 'mw-tagfilter-form', 'method' => 'get' ), $html );
 
                return $html;
        }
index 35a1b5b..82aa946 100644 (file)
@@ -487,12 +487,6 @@ class XmlDumpWriter {
                        }
                }
 
-               if ( $row->rev_sha1 ) {
-                       $out .= "      " . Xml::element('sha1', null, strval( $row->rev_sha1 ) ) . "\n";
-               } else {
-                       $out .= "      <sha1/>\n";
-               }
-
                if ( $row->page_restrictions != '' ) {
                        $out .= '    ' . Xml::element( 'restrictions', array(),
                                strval( $row->page_restrictions ) ) . "\n";
@@ -560,6 +554,12 @@ class XmlDumpWriter {
                                "" ) . "\n";
                }
 
+               if ( $row->rev_sha1 && !( $row->rev_deleted & Revision::DELETED_TEXT ) ) {
+                       $out .= "      " . Xml::element('sha1', null, strval( $row->rev_sha1 ) ) . "\n";
+               } else {
+                       $out .= "      <sha1/>\n";
+               }
+
                wfRunHooks( 'XmlDumpWriterWriteRevision', array( &$this, &$out, $row, $text ) );
 
                $out .= "    </revision>\n";
index 90bef91..566dcc7 100644 (file)
@@ -1517,7 +1517,7 @@ class User {
                        $count = $wgMemc->get( $key );
                        // Already pinged?
                        if( $count ) {
-                               if( $count > $max ) {
+                               if( $count >= $max ) {
                                        wfDebug( __METHOD__ . ": tripped! $key at $count $summary\n" );
                                        if( $wgRateLimitLog ) {
                                                wfSuppressWarnings();
index 6452f54..e2b38f5 100644 (file)
@@ -708,14 +708,19 @@ class DatabasePostgres extends DatabaseBase {
                # Replace reserved words with better ones
                switch( $name ) {
                        case 'user':
-                               return 'mwuser';
+                               return $this->realTableName( 'mwuser', $format );
                        case 'text':
-                               return 'pagecontent';
+                               return $this->realTableName( 'pagecontent', $format );
                        default:
-                               return parent::tableName( $name, $format );
+                               return $this->realTableName( $name, $format );
                }
        }
 
+       /* Don't cheat on installer */
+       function realTableName( $name, $format = 'quoted' ) {
+               return parent::tableName( $name, $format );
+       }
+
        /**
         * Return the next in a sequence, save the value for retrieval via insertId()
         * @return null
@@ -990,7 +995,7 @@ class DatabasePostgres extends DatabaseBase {
                if ( !$schema ) {
                        $schema = $this->getCoreSchema();
                }
-               $table = $this->tableName( $table, 'raw' );
+               $table = $this->realTableName( $table, 'raw' );
                $etable = $this->addQuotes( $table );
                $eschema = $this->addQuotes( $schema );
                $SQL = "SELECT 1 FROM pg_catalog.pg_class c, pg_catalog.pg_namespace n "
index 14604c1..046fa16 100644 (file)
@@ -158,7 +158,7 @@ abstract class DatabaseInstaller {
                }
                $this->db->selectDB( $this->getVar( 'wgDBname' ) );
 
-               if( $this->db->tableExists( 'user', __METHOD__ ) ) {
+               if( $this->db->tableExists( 'archive', __METHOD__ ) ) {
                        $status->warning( 'config-install-tables-exist' );
                        $this->enableLB();
                        return $status;
index d4412cb..6b3cb51 100644 (file)
@@ -27,6 +27,11 @@ class PostgresUpdater extends DatabaseUpdater {
         */
        protected function getCoreUpdateList() {
                return array(
+                       # rename tables 1.7.3
+                       # r15791 Change reserved word table names "user" and "text"
+                       array( 'renameTable', 'user', 'mwuser'),
+                       array( 'renameTable', 'text', 'pagecontent'),
+
                        # new sequences
                        array( 'addSequence', 'logging_log_id_seq'          ),
                        array( 'addSequence', 'page_restrictions_pr_id_seq' ),
@@ -406,7 +411,8 @@ END;
        protected function renameTable( $old, $new ) {
                if ( $this->db->tableExists( $old ) ) {
                        $this->output( "Renaming table $old to $new\n" );
-                       $old = $this->db->addQuotes( $old );
+                       $old = $this->db->realTableName( $old, "quoted" );
+                       $new = $this->db->realTableName( $new, "quoted" );
                        $this->db->query( "ALTER TABLE $old RENAME TO $new" );
                }
        }
index b1ed9b6..f6d8b3a 100644 (file)
@@ -48,14 +48,7 @@ class Profiler {
                        $this->mProfileID = $params['profileID'];
                }
 
-               // Push an entry for the pre-profile setup time onto the stack
-               $initial = $this->getInitialTime();
-               if ( $initial !== null ) {
-                       $this->mWorkStack[] = array( '-total', 0, $initial, 0 );
-                       $this->mStack[] = array( '-setup', 1, $initial, 0, $this->getTime(), 0 );
-               } else {
-                       $this->profileIn( '-total' );
-               }
+               $this->addInitialStack();
        }
 
        /**
@@ -114,6 +107,20 @@ class Profiler {
                }
        }
 
+       /**
+        * Add the inital item in the stack.
+        */
+       protected function addInitialStack() {
+               // Push an entry for the pre-profile setup time onto the stack
+               $initial = $this->getInitialTime();
+               if ( $initial !== null ) {
+                       $this->mWorkStack[] = array( '-total', 0, $initial, 0 );
+                       $this->mStack[] = array( '-setup', 1, $initial, 0, $this->getTime(), 0 );
+               } else {
+                       $this->profileIn( '-total' );
+               }
+       }
+
        /**
         * Called by wfProfieIn()
         *
index 055a0ea..df37363 100644 (file)
@@ -15,32 +15,20 @@ class ProfilerSimple extends Profiler {
        var $zeroEntry = array('cpu'=> 0.0, 'cpu_sq' => 0.0, 'real' => 0.0, 'real_sq' => 0.0, 'count' => 0);
        var $errorEntry;
 
-       function __construct( $params ) {
+       protected function addInitialStack() {
                global $wgRequestTime, $wgRUstart;
-               parent::__construct( $params );
 
                $this->errorEntry = $this->zeroEntry;
                $this->errorEntry['count'] = 1;
 
-               if (!empty($wgRequestTime) && !empty($wgRUstart)) {
-                       # Remove the -total entry from parent::__construct
-                       $this->mWorkStack = array();
+               if ( !empty( $wgRequestTime ) && !empty( $wgRUstart ) ) {
+                       $initialCpu = $this->getCpuTime( $wgRUstart );
+                       $this->mWorkStack[] = array( '-total', 0, $wgRequestTime, $initialCpu );
+                       $this->mWorkStack[] = array( '-setup', 1, $wgRequestTime, $initialCpu );
 
-                       $this->mWorkStack[] = array( '-total', 0, $wgRequestTime,$this->getCpuTime($wgRUstart));
-
-                       $elapsedcpu = $this->getCpuTime() - $this->getCpuTime($wgRUstart);
-                       $elapsedreal = microtime(true) - $wgRequestTime;
-
-                       $entry =& $this->mCollated["-setup"];
-                       if (!is_array($entry)) {
-                               $entry = $this->zeroEntry;
-                               $this->mCollated["-setup"] =& $entry;
-                       }
-                       $entry['cpu'] += $elapsedcpu;
-                       $entry['cpu_sq'] += $elapsedcpu*$elapsedcpu;
-                       $entry['real'] += $elapsedreal;
-                       $entry['real_sq'] += $elapsedreal*$elapsedreal;
-                       $entry['count']++;
+                       $this->profileOut( '-setup' );
+               } else {
+                       $this->profileIn( '-total' );
                }
        }
 
index bfc5248..c05aaad 100644 (file)
@@ -568,14 +568,14 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                $submit = ' ' . Xml::submitbutton( wfMsg( 'allpagessubmit' ) );
 
                $out = Xml::openElement( 'table', array( 'class' => 'mw-recentchanges-table' ) );
-               foreach( $extraOpts as $optionRow ) {
+               foreach( $extraOpts as $name => $optionRow ) {
                        # Add submit button to the last row only
                        ++$count;
-                       $addSubmit = $count === $extraOptsCount ? $submit : '';
+                       $addSubmit = ( $count === $extraOptsCount ) ? $submit : '';
 
                        $out .= Xml::openElement( 'tr' );
                        if( is_array( $optionRow ) ) {
-                               $out .= Xml::tags( 'td', array( 'class' => 'mw-label' ), $optionRow[0] );
+                               $out .= Xml::tags( 'td', array( 'class' => 'mw-label mw-' . $name . '-label' ), $optionRow[0] );
                                $out .= Xml::tags( 'td', array( 'class' => 'mw-input' ), $optionRow[1] . $addSubmit );
                        } else {
                                $out .= Xml::tags( 'td', array( 'class' => 'mw-input', 'colspan' => 2 ), $optionRow . $addSubmit );
index 64a07f1..0c5f11c 100644 (file)
@@ -40,22 +40,10 @@ class SpecialWatchlist extends SpecialPage {
                $user = $this->getUser();
                $output = $this->getOutput();
 
-               // Add feed links
-               $wlToken = $user->getOption( 'watchlisttoken' );
-               if ( !$wlToken ) {
-                       $wlToken = MWCryptRand::generateHex( 40 );
-                       $user->setOption( 'watchlisttoken', $wlToken );
-                       $user->saveSettings();
-               }
-
-               $this->addFeedLinks( array( 'action' => 'feedwatchlist', 'allrev' => 'allrev',
-                                                       'wlowner' => $user->getName(), 'wltoken' => $wlToken ) );
-
-               $output->setRobotPolicy( 'noindex,nofollow' );
-
                # Anons don't get a watchlist
                if( $user->isAnon() ) {
                        $output->setPageTitle( $this->msg( 'watchnologin' ) );
+                       $output->setRobotPolicy( 'noindex,nofollow' );
                        $llink = Linker::linkKnown(
                                SpecialPage::getTitleFor( 'Userlogin' ),
                                $this->msg( 'loginreqlink' )->escaped(),
@@ -66,6 +54,17 @@ class SpecialWatchlist extends SpecialPage {
                        return;
                }
 
+               // Add feed links
+               $wlToken = $user->getOption( 'watchlisttoken' );
+               if ( !$wlToken ) {
+                       $wlToken = MWCryptRand::generateHex( 40 );
+                       $user->setOption( 'watchlisttoken', $wlToken );
+                       $user->saveSettings();
+               }
+
+               $this->addFeedLinks( array( 'action' => 'feedwatchlist', 'allrev' => 'allrev',
+                                                       'wlowner' => $user->getName(), 'wltoken' => $wlToken ) );
+
                $this->setHeaders();
                $this->outputHeader();
 
index 83d1a34..bc880a8 100644 (file)
@@ -1,6 +1,6 @@
 == Details==
 
-Automated Selenium test scripts written for MediaWiki Installer is available at svn.wikimedia.org/svnroot/mediawiki/trunk/phase3/tests/selenium/installer.
+Automated Selenium test scripts written for MediaWiki Installer is available at https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/core.git;a=tree;f=tests/selenium/installer;hb=HEAD.
 Detailed test cases available at http://www.mediawiki.org/wiki/New_installer/Test_plan.
 
 Version : MediaWiki 1.18alpha