r23050 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23049‎ | r23050 | r23051 >
Date:00:01, 18 June 2007
Author:david
Status:old
Tags:
Comment:
Merged revisions 23038-23049 via svnmerge from
svn+ssh://david@svn.wikimedia.org/svnroot/mediawiki/trunk/phase3

........
r23041 | greg | 2007-06-16 19:09:21 -0700 (Sat, 16 Jun 2007) | 2 lines

Add checks for common comma errors.
........
r23043 | yurik | 2007-06-17 01:25:16 -0700 (Sun, 17 Jun 2007) | 2 lines

API: Fixed regression bug 10274: generator=watchlist complains about gwlprop even if it's not set
Thanks to Roan Kattouw
........
r23044 | yurik | 2007-06-17 01:50:35 -0700 (Sun, 17 Jun 2007) | 2 lines

API: Added filter by namespace to links & templates query - bug 10275
Patch by Roan Kattouw with minor mod.
........
r23046 | wegge | 2007-06-17 03:15:36 -0700 (Sun, 17 Jun 2007) | 1 line

Updated translations for da
........
r23047 | rotem | 2007-06-17 07:58:57 -0700 (Sun, 17 Jun 2007) | 1 line

Update.
........
Modified paths:
  • /branches/liquidthreads (modified) (history)
  • /branches/liquidthreads/includes/api/ApiQueryLinks.php (modified) (history)
  • /branches/liquidthreads/includes/api/ApiQueryWatchlist.php (modified) (history)
  • /branches/liquidthreads/languages/messages/MessagesDa.php (modified) (history)
  • /branches/liquidthreads/languages/messages/MessagesHe.php (modified) (history)
  • /branches/liquidthreads/maintenance/language/messages.inc (modified) (history)
  • /branches/liquidthreads/maintenance/postgres/compare_schemas.pl (modified) (history)

Diff [purge]

Index: branches/liquidthreads/maintenance/postgres/compare_schemas.pl
@@ -155,7 +155,7 @@
156156 );
157157 $dtype = qr{($dtype)};
158158 my %new;
159 -my ($infunction,$inview,$inrule) = (0,0,0);
 159+my ($infunction,$inview,$inrule,$lastcomma) = (0,0,0,0);
160160 seek $newfh, 0, 0;
161161 while (<$newfh>) {
162162 next if /^\s*\-\-/ or /^\s*$/;
@@ -190,11 +190,19 @@
191191 if (/^CREATE TABLE "?(\w+)"? \($/) {
192192 $table = $1;
193193 $new{$table}{name}=$table;
 194+ $lastcomma = 1;
194195 }
195196 elsif (/^\);$/) {
 197+ if ($lastcomma) {
 198+ warn "Stray comma before line $.\n";
 199+ }
196200 }
197 - elsif (/^ (\w+) +$dtype/) {
 201+ elsif (/^ (\w+) +$dtype.*?(,?)(?: --.*)?$/) {
198202 $new{$table}{column}{$1} = $2;
 203+ if (!$lastcomma) {
 204+ print "Missing comma before line $. of $new\n";
 205+ }
 206+ $lastcomma = $3 ? 1 : 0;
199207 }
200208 else {
201209 die "Cannot parse line $. of $new:\n$_\n";
Index: branches/liquidthreads/maintenance/language/messages.inc
@@ -1021,6 +1021,7 @@
10221022 'specialloguserlabel',
10231023 'speciallogtitlelabel',
10241024 'log',
 1025+ 'all-logs-page',
10251026 'log-search-legend',
10261027 'log-search-submit',
10271028 'alllogstext',
Index: branches/liquidthreads/includes/api/ApiQueryLinks.php
@@ -73,6 +73,8 @@
7474 if ($this->getPageSet()->getGoodTitleCount() == 0)
7575 return; // nothing to do
7676
 77+ $params = $this->extractRequestParams();
 78+
7779 $this->addFields(array (
7880 $this->prefix . '_from pl_from',
7981 $this->prefix . '_namespace pl_namespace',
@@ -81,6 +83,7 @@
8284
8385 $this->addTables($this->table);
8486 $this->addWhereFld($this->prefix . '_from', array_keys($this->getPageSet()->getGoodTitles()));
 87+ $this->addWhereFld($this->prefix . '_namespace', $params['namespace']);
8588 $this->addOption('ORDER BY', str_replace('pl_', $this->prefix . '_', 'pl_from, pl_namespace, pl_title'));
8689
8790 $db = $this->getDB();
@@ -131,6 +134,23 @@
132135 $data);
133136 }
134137
 138+ protected function getAllowedParams()
 139+ {
 140+ return array(
 141+ 'namespace' => array(
 142+ ApiBase :: PARAM_TYPE => 'namespace',
 143+ ApiBase :: PARAM_ISMULTI => true
 144+ )
 145+ );
 146+ }
 147+
 148+ protected function getParamDescription()
 149+ {
 150+ return array(
 151+ 'namespace' => "Show {$this->description}s in this namespace(s) only"
 152+ );
 153+ }
 154+
135155 protected function getDescription() {
136156 return "Returns all {$this->description}s from the given page(s)";
137157 }
@@ -140,7 +160,9 @@
141161 "Get {$this->description}s from the [[Main Page]]:",
142162 " api.php?action=query&prop={$this->getModuleName()}&titles=Main%20Page",
143163 "Get information about the {$this->description} pages in the [[Main Page]]:",
144 - " api.php?action=query&generator={$this->getModuleName()}&titles=Main%20Page&prop=info"
 164+ " api.php?action=query&generator={$this->getModuleName()}&titles=Main%20Page&prop=info",
 165+ "Get {$this->description}s from the Main Page in the User and Template namespaces:",
 166+ " api.php?action=query&prop={$this->getModuleName()}&titles=Main%20Page&{$this->prefix}namespace=2|10"
145167 );
146168 }
147169
Index: branches/liquidthreads/includes/api/ApiQueryWatchlist.php
@@ -62,9 +62,7 @@
6363 $allrev = $start = $end = $namespace = $dir = $limit = $prop = null;
6464 extract($this->extractRequestParams());
6565
66 - if (!is_null($prop)) {
67 - if (!is_null($resultPageSet))
68 - $this->dieUsage($this->encodeParamName('prop') . ' parameter may not be used in a generator', 'params');
 66+ if (!is_null($prop) && is_null($resultPageSet)) {
6967
7068 $prop = array_flip($prop);
7169
Index: branches/liquidthreads/languages/messages/MessagesHe.php
@@ -1242,6 +1242,7 @@
12431243 'specialloguserlabel' => 'משתמש:',
12441244 'speciallogtitlelabel' => 'כותרת:',
12451245 'log' => 'יומנים',
 1246+'all-logs-page' => 'כל היומנים',
12461247 'log-search-legend' => 'חיפוש יומנים',
12471248 'log-search-submit' => 'עבור',
12481249 'alllogstext' => 'תצוגה משולבת של כל סוגי היומנים הזמינים ב{{grammar:תחילית|{{SITENAME}}}}.
Index: branches/liquidthreads/languages/messages/MessagesDa.php
@@ -701,7 +701,7 @@
702702
703703 # History pages
704704 'revhistory' => 'Versionshistorik',
705 -'viewpagelogs' => 'Vis logs for denne side',
 705+'viewpagelogs' => 'Vis loglister for denne side',
706706 'nohistory' => 'Der er ingen versionshistorik for denne side.',
707707 'revnotfound' => 'Versionen er ikke fundet',
708708 'revnotfoundtext' => 'Den gamle version af den side du spurgte efter kan
@@ -1224,7 +1224,8 @@
12251225 # Special:Log
12261226 'specialloguserlabel' => 'Bruger:',
12271227 'speciallogtitlelabel' => 'Titel:',
1228 -'log' => 'Logs',
 1228+'log' => 'Loglister',
 1229+'all-logs-page' => 'Alle loglister',
12291230 'log-search-legend' => 'Gennemsøg logs',
12301231 'log-search-submit' => 'Søg',
12311232 'alllogstext' => 'Samlet visning af oplægningslog, sletningslog, blokeringslog, bureaukratlog og listen over beskyttede sider. Du kan sortere i visningen ved at vælge type, brugernavn og/eller en udvalgt side.',
Property changes on: branches/liquidthreads
___________________________________________________________________
Modified: svnmerge-integrated
12321233 - /trunk/phase3:1-23037
12331234 + /trunk/phase3:1-23049

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r23041Add checks for common comma errors.greg02:09, 17 June 2007
r23043API: Fixed regression bug 10274: generator=watchlist complains about gwlprop ...yurik08:25, 17 June 2007
r23044API: Added filter by namespace to links & templates query - bug 10275...yurik08:50, 17 June 2007
r23046Updated translations for dawegge10:15, 17 June 2007
r23047Update.rotem14:58, 17 June 2007

Status & tagging log