[MediaWiki-commits] [Gerrit] Remove wikimania2005 whitelist from InitialiseSettings.php - change (operations/mediawiki-config)

2013-09-11 Thread TTO (Code Review)
TTO has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83776


Change subject: Remove wikimania2005 whitelist from InitialiseSettings.php
..

Remove wikimania2005 whitelist from InitialiseSettings.php

I can access e.g. http://wikimania2005.wikimedia.org/wiki/Broadcasting despite
it not being on the whitelist, so obviously wgWhitelistRead is having no effect
for this wiki.

Since the content is obsolete, I don't think there is any point trying to fix
this wiki. This commit just removes the long whitelist from InitialiseSettings.

Bug: 53909
Change-Id: I1859d47b3aca60df3c6276bf80a8fb47469a09a4
---
M wmf-config/InitialiseSettings.php
1 file changed, 1 insertion(+), 188 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/76/83776/1

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 2acd14b..c651743 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -3758,193 +3758,6 @@
 'wgWhitelistRead' = array(
'private' = array( 'Main Page', 'Special:Userlogin', 
'Special:Userlogout' ),
'grantswiki' = array( 'Main Page', 'Special:Userlogin', 
'Special:Userlogout' ),
-   'wikimania2005wiki' = array( 'Main Page', 'Special:Userlogin', 
'Special:Userlogout', // back compat
-   '-',
-   'MediaWiki:Wikimania.js',
-   'MediaWiki:Wikimania.css',
-   'Image:Citymap frankfurt.png',
-   'Accomodation',
-   'Accommodation',
-   'Remote participation',
-   'Competitions',
-   'Accommodation/Ar',
-   'Accueil',
-   'Activités',
-   'Alloggio',
-   'Alvoko por kontribuoj',
-   'Anreise',
-   'Artikelen gevraagd',
-   'Begleitprogramm',
-   'Calendar',
-   'Call for Papers',
-   'Call for papers',
-   'Call for papers/de',
-   'Call for papers/fr',
-   'Competencias',
-   'Competities',
-   'Competitions',
-   'Competizioni',
-   'Compétitions',
-   'Conferencistas',
-   'Contact',
-   'Contact/fr',
-   'Contact/nl',
-   'Contactos',
-   'Contatti',
-   'Coordinators',
-   'Demandu aliĝilon',
-   'Eventi sociali',
-   'Eventoj',
-   'Eventos sociales',
-   'Fun and Games',
-   'Gazetara servo',
-   'Gvidiloj',
-   'Hacking Days',
-   'Hacking Days/ar',
-   'Hacking Days/de',
-   'Hacking Days/eo',
-   'Hacking Days/es',
-   'Hacking Days/fr',
-   'Hacking Days/it',
-   'Hacking Days/nl',
-   'Hacking Days/pl',
-   'Hackings Days-It',
-   'Hackings Days/it',
-   'Hauptseite',
-   'Hoofdpagina',
-   'Hospedaje',
-   'Hébergement',
-   'Intervenants',
-   'Konferencejo',
-   'Konkursoj',
-   'Konkursy',
-   'Kontakt',
-   'Kontaktoj',
-   'Kontakty',
-   'Lieu',
-   'Localidad',
-   'Locatie',
-   'Location',
-   'Location/ar',
-   'Logxado',
-   'Lokatie',
-   'Loĝejoj',
-   'Luogo',
-   'Main Page',
-   'Mecenatoj',
-   'Miejsce konferencji',
-   'Noclegi',
-   'Oproep voor Inzendingen',
-   'Oratori',
-   'Pagina principale',
-   'Patrocinantes',
-   'Pers',
-   'Portada',
-   'Prasa',
-   'Prelegontoj',
-   'Prensa',
-   'Press',
-   'Presse/de',
-   'Presse/fr',
-   'Program',
-   'Programa',
-   'Programm',
-   'Programm/de',
-   'Programma',
-   'Programma/nl',
-   'Programme',
-   'Programme/fr',
-   'Programo',
-   'Redner',
-   'Richiesta di documenti',
-   'Social events',
-   'Sociale activiteiten',
-   'Solicitud de trabajos',
-   'Speakers',
-   'Speakers/ar',
-   'Special thanks',
-   'Sponsor/It',
-   'Sponsoren',
-   'Sponsors',
-   'Sponsors/fr',
-   'Sponsors/nl',
-   'Sponsorzy',
-   'Spotkania towarzyskie',
-   'Sprekers',
-   'Stampa',
-   

[MediaWiki-commits] [Gerrit] Reuse duplicate code in LinkTitles - change (mediawiki...Wikibase)

2013-09-11 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has submitted this change and it was merged.

Change subject: Reuse duplicate code in LinkTitles
..


Reuse duplicate code in LinkTitles

Change-Id: I3b76d7889c6588fcffad6404cc503033a6ed94ff
---
M repo/includes/api/LinkTitles.php
1 file changed, 8 insertions(+), 17 deletions(-)

Approvals:
  Jeroen De Dauw: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/repo/includes/api/LinkTitles.php b/repo/includes/api/LinkTitles.php
index 90ca0d8..dffe79b 100644
--- a/repo/includes/api/LinkTitles.php
+++ b/repo/includes/api/LinkTitles.php
@@ -48,34 +48,19 @@
$params = $this-extractRequestParams();
$this-validateParameters( $params );
 
-   $user = $this-getUser();
$sites = $this-getSiteLinkTargetSites();
 
-   // Get all parts for the from-link
// Site is already tested through allowed params ;)
$fromSite = $sites-getSite( $params['fromsite'] );
-   // This must be tested now
$fromPage = $fromSite-normalizePageName( $params['fromtitle'] 
);
-
-   if ( $fromPage === false ) {
-   wfProfileOut( __METHOD__ );
-   $this-dieUsage( 'The external client site did not 
provide page information for the from page' , 'no-external-page' );
-   }
-
-   // This is used for testing purposes later
+   $this-validatePage( $fromPage, 'from' );
$fromId = 
StoreFactory::getStore()-newSiteLinkCache()-getItemIdForLink( 
$params['fromsite'], $fromPage );
 
-   // Get all part for the to-link
// Site is already tested through allowed params ;)
$toSite = $sites-getSite( $params['tosite'] );
// This must be tested now
$toPage = $toSite-normalizePageName( $params['totitle'] );
-
-   if ( $toPage === false ) {
-   wfProfileOut( __METHOD__ );
-   $this-dieUsage( 'The external client site did not 
provide page information for the to page' , 'no-external-page' );
-   }
-   // This is used for testing purposes later
+   $this-validatePage( $toPage, 'to' );
$toId = 
StoreFactory::getStore()-newSiteLinkCache()-getItemIdForLink( 
$params['tosite'], $toPage );
 
$return = array();
@@ -277,4 +262,10 @@
);
}
 
+   private function validatePage( $page, $label ) {
+   if ( $page === false ) {
+   $this-dieUsage( The external client site did not 
provide page information for the {$label} page , 'no-external-page' );
+   }
+   }
+
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/82596
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I3b76d7889c6588fcffad6404cc503033a6ed94ff
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Addshore addshorew...@gmail.com
Gerrit-Reviewer: Jeroen De Dauw jeroended...@gmail.com
Gerrit-Reviewer: Nikerabbit niklas.laxst...@gmail.com
Gerrit-Reviewer: Siebrand siebr...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Stop using deprecated contentfactory singleton - change (mediawiki...Wikibase)

2013-09-11 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has submitted this change and it was merged.

Change subject: Stop using deprecated contentfactory singleton
..


Stop using deprecated contentfactory singleton

Change-Id: I85adf70899789b6f48cae92ea36e57a351081a77
---
M repo/tests/phpunit/includes/api/CreateClaimTest.php
M repo/tests/phpunit/includes/api/EditPageTest.php
2 files changed, 5 insertions(+), 4 deletions(-)

Approvals:
  Jeroen De Dauw: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/repo/tests/phpunit/includes/api/CreateClaimTest.php 
b/repo/tests/phpunit/includes/api/CreateClaimTest.php
index eba5a7b..ac9bc4b 100644
--- a/repo/tests/phpunit/includes/api/CreateClaimTest.php
+++ b/repo/tests/phpunit/includes/api/CreateClaimTest.php
@@ -82,7 +82,7 @@
 
$this-assertEquals( 'value', $claim['mainsnak']['snaktype'] );
 
-   $entityContent = 
\Wikibase\EntityContentFactory::singleton()-getFromId( $entity-getId() );
+   $entityContent = 
WikibaseRepo::getDefaultInstance()-getEntityContentFactory()-getFromId( 
$entity-getId() );
 
$claims = new \Wikibase\Claims( 
$entityContent-getEntity()-getClaims() );
 
@@ -226,7 +226,7 @@
$this-assertEquals( $errorCode, $e-getCodeString(), 
'Invalid request raised correct error' );
}
 
-   $entityContent = 
\Wikibase\EntityContentFactory::singleton()-getFromId( $entity-getId() );
+   $entityContent = 
WikibaseRepo::getDefaultInstance()-getEntityContentFactory()-getFromId( 
$entity-getId() );
 
$this-assertFalse( $entityContent-getEntity()-hasClaims() );
}
@@ -280,7 +280,7 @@
 
$this-assertNotEquals( $firstGuid, $secondGuid );
 
-   $entityContent = 
\Wikibase\EntityContentFactory::singleton()-getFromId( $entity-getId() );
+   $entityContent = 
WikibaseRepo::getDefaultInstance()-getEntityContentFactory()-getFromId( 
$entity-getId() );
 
$claims = new \Wikibase\Claims( 
$entityContent-getEntity()-getClaims() );
 
diff --git a/repo/tests/phpunit/includes/api/EditPageTest.php 
b/repo/tests/phpunit/includes/api/EditPageTest.php
index 7ac88e6..5719f1f 100644
--- a/repo/tests/phpunit/includes/api/EditPageTest.php
+++ b/repo/tests/phpunit/includes/api/EditPageTest.php
@@ -2,6 +2,7 @@
 
 namespace Wikibase\Test\Api;
 use ApiTestCase;
+use Wikibase\Repo\WikibaseRepo;
 
 /**
  * Tests for blocking of direct editing.
@@ -80,7 +81,7 @@
global $wgContentHandlerUseDB;
 
$id = new \Wikibase\EntityId( \Wikibase\Item::ENTITY_TYPE, 
1234567 );
-   $page = 
\Wikibase\EntityContentFactory::singleton()-getWikiPageForId( $id );
+   $page = 
WikibaseRepo::getDefaultInstance()-getEntityContentFactory()-getWikiPageForId(
 $id );
 
$text = hallo welt;
 

-- 
To view, visit https://gerrit.wikimedia.org/r/82597
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I85adf70899789b6f48cae92ea36e57a351081a77
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Addshore addshorew...@gmail.com
Gerrit-Reviewer: Jeroen De Dauw jeroended...@gmail.com
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] StatsD: only report medians to Ganglia - change (operations/puppet)

2013-09-11 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83777


Change subject: StatsD: only report medians to Ganglia
..

StatsD: only report medians to Ganglia

This patch prevents aggregate figures that aren't median from being reported to
Ganglia. We do care about the other aggregate figures, but they will remain
available in Graphite, and are not vital for rendering the Navigation Timing
view on Ganglia (whereas the medians are).

Change-Id: I7078bf230198f71b11babdd89b331190a8e895bf
---
M manifests/misc/graphite.pp
M modules/statsd/manifests/init.pp
2 files changed, 10 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/77/83777/1

diff --git a/manifests/misc/graphite.pp b/manifests/misc/graphite.pp
index 3a2afb5..90c43f1 100644
--- a/manifests/misc/graphite.pp
+++ b/manifests/misc/graphite.pp
@@ -132,6 +132,11 @@
 notify = Service['navtiming'],
 }
 
+file { '/usr/local/share/statsd/mediansOnlyFilter.js':
+contents = 'exports.filter = function ( m ) { return /median$/.test( 
m.name )  m; };',
+before   = Service['statsd'],
+}
+
 file { '/etc/init/navtiming.conf':
 content = template('graphite/modules/navtiming.conf.erb'),
 notify  = Service['navtiming'],
@@ -147,6 +152,7 @@
 graphite_port = 2003,
 settings  = {
 flushInterval= 5 * 60 * 1000,  # 5 min.
+gangliaFilters   = [ 
'/usr/local/share/statsd/mediansOnlyFilter.js' ],
 address  = $statsd_host,
 percentThreshold = [ 95 ],
 # Show frequency distribution of client-side latency times.
diff --git a/modules/statsd/manifests/init.pp b/modules/statsd/manifests/init.pp
index 678820a..db397ca 100644
--- a/modules/statsd/manifests/init.pp
+++ b/modules/statsd/manifests/init.pp
@@ -57,6 +57,10 @@
 require = Package['statsd'],
 }
 
+file { '/usr/local/share/statsd':
+ensure = directory,
+}
+
 service { 'statsd':
 ensure   = running,
 provider = upstart,

-- 
To view, visit https://gerrit.wikimedia.org/r/83777
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7078bf230198f71b11babdd89b331190a8e895bf
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh o...@wikimedia.org

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Let ClaimsSerializer implements Unserializer - change (mediawiki...Wikibase)

2013-09-11 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Let ClaimsSerializer implements Unserializer
..


Let ClaimsSerializer implements Unserializer

This allows unserialisation from claims as json objects to
Wikibase\Claims

Change-Id: I51f86d8cb0326d5e6fbfacb1289adce37ed0bf87
---
M lib/includes/serializers/ClaimsSerializer.php
M lib/includes/serializers/SerializerFactory.php
2 files changed, 21 insertions(+), 1 deletion(-)

Approvals:
  Jeroen De Dauw: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/lib/includes/serializers/ClaimsSerializer.php 
b/lib/includes/serializers/ClaimsSerializer.php
index 9400851..1d56331 100644
--- a/lib/includes/serializers/ClaimsSerializer.php
+++ b/lib/includes/serializers/ClaimsSerializer.php
@@ -2,6 +2,7 @@
 
 namespace Wikibase\Lib\Serializers;
 use MWException;
+use Wikibase\Claims;
 
 /**
  * Serializer for lists of claims.
@@ -29,7 +30,7 @@
  * @licence GNU GPL v2+
  * @author Jeroen De Dauw  jeroended...@gmail.com 
  */
-class ClaimsSerializer extends SerializerObject {
+class ClaimsSerializer extends SerializerObject implements Unserializer {
 
/**
 * @see ApiSerializer::getSerialized
@@ -52,4 +53,21 @@
return $serializer-getSerialized( $claims );
}
 
+   /**
+* @see Unserializer::newFromSerialization
+*
+* @since 0.5
+*
+* @param mixed $serialization
+*
+* @return Claims
+* @throws MWException
+*/
+   public function newFromSerialization( array $serialization ) {
+   $claimSerializer = new ClaimSerializer( $this-options );
+   $unserializer = new ByPropertyListUnserializer( 
$claimSerializer );
+
+   return new Claims( $unserializer-newFromSerialization( 
$serialization ) );
+   }
+
 }
\ No newline at end of file
diff --git a/lib/includes/serializers/SerializerFactory.php 
b/lib/includes/serializers/SerializerFactory.php
index 4c24074..2260cf7 100644
--- a/lib/includes/serializers/SerializerFactory.php
+++ b/lib/includes/serializers/SerializerFactory.php
@@ -86,6 +86,8 @@
return new ReferenceSerializer( $options );
case 'Wikibase\Claim':
return new ClaimSerializer( $options );
+   case 'Wikibase\Claims':
+   return new ClaimsSerializer( $options );
}
 
throw new OutOfBoundsException( '' . $className . ' has no 
associated unserializer' );

-- 
To view, visit https://gerrit.wikimedia.org/r/82096
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I51f86d8cb0326d5e6fbfacb1289adce37ed0bf87
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Umherirrender umherirrender_de...@web.de
Gerrit-Reviewer: Jeroen De Dauw jeroended...@gmail.com
Gerrit-Reviewer: Umherirrender umherirrender_de...@web.de
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] StatsD: only report medians to Ganglia - change (operations/puppet)

2013-09-11 Thread ArielGlenn (Code Review)
ArielGlenn has submitted this change and it was merged.

Change subject: StatsD: only report medians to Ganglia
..


StatsD: only report medians to Ganglia

This patch prevents aggregate figures that aren't median from being reported to
Ganglia. We do care about the other aggregate figures, but they will remain
available in Graphite, and are not vital for rendering the Navigation Timing
view on Ganglia (whereas the medians are).

Change-Id: I7078bf230198f71b11babdd89b331190a8e895bf
---
M manifests/misc/graphite.pp
M modules/statsd/manifests/init.pp
2 files changed, 10 insertions(+), 0 deletions(-)

Approvals:
  ArielGlenn: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/manifests/misc/graphite.pp b/manifests/misc/graphite.pp
index 3a2afb5..90c43f1 100644
--- a/manifests/misc/graphite.pp
+++ b/manifests/misc/graphite.pp
@@ -132,6 +132,11 @@
 notify = Service['navtiming'],
 }
 
+file { '/usr/local/share/statsd/mediansOnlyFilter.js':
+contents = 'exports.filter = function ( m ) { return /median$/.test( 
m.name )  m; };',
+before   = Service['statsd'],
+}
+
 file { '/etc/init/navtiming.conf':
 content = template('graphite/modules/navtiming.conf.erb'),
 notify  = Service['navtiming'],
@@ -147,6 +152,7 @@
 graphite_port = 2003,
 settings  = {
 flushInterval= 5 * 60 * 1000,  # 5 min.
+gangliaFilters   = [ 
'/usr/local/share/statsd/mediansOnlyFilter.js' ],
 address  = $statsd_host,
 percentThreshold = [ 95 ],
 # Show frequency distribution of client-side latency times.
diff --git a/modules/statsd/manifests/init.pp b/modules/statsd/manifests/init.pp
index 678820a..db397ca 100644
--- a/modules/statsd/manifests/init.pp
+++ b/modules/statsd/manifests/init.pp
@@ -57,6 +57,10 @@
 require = Package['statsd'],
 }
 
+file { '/usr/local/share/statsd':
+ensure = directory,
+}
+
 service { 'statsd':
 ensure   = running,
 provider = upstart,

-- 
To view, visit https://gerrit.wikimedia.org/r/83777
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7078bf230198f71b11babdd89b331190a8e895bf
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh o...@wikimedia.org
Gerrit-Reviewer: ArielGlenn ar...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Fix typo in misc/graphite.pp ('content', not 'contents') - change (operations/puppet)

2013-09-11 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83778


Change subject: Fix typo in misc/graphite.pp ('content', not 'contents')
..

Fix typo in misc/graphite.pp ('content', not 'contents')

Typo introduced in I7078bf230.

Change-Id: I6a1d9e0574c5b51b1af89f9b1dfc5cdf6630e7b5
---
M manifests/misc/graphite.pp
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/78/83778/1

diff --git a/manifests/misc/graphite.pp b/manifests/misc/graphite.pp
index 90c43f1..f1ff857 100644
--- a/manifests/misc/graphite.pp
+++ b/manifests/misc/graphite.pp
@@ -133,8 +133,8 @@
 }
 
 file { '/usr/local/share/statsd/mediansOnlyFilter.js':
-contents = 'exports.filter = function ( m ) { return /median$/.test( 
m.name )  m; };',
-before   = Service['statsd'],
+content = 'exports.filter = function ( m ) { return /median$/.test( 
m.name )  m; };',
+before  = Service['statsd'],
 }
 
 file { '/etc/init/navtiming.conf':

-- 
To view, visit https://gerrit.wikimedia.org/r/83778
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6a1d9e0574c5b51b1af89f9b1dfc5cdf6630e7b5
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh o...@wikimedia.org

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Allow import from enwikisource to bnwikisource - change (operations/mediawiki-config)

2013-09-11 Thread TTO (Code Review)
TTO has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83779


Change subject: Allow import from enwikisource to bnwikisource
..

Allow import from enwikisource to bnwikisource

Bug: 53943
Change-Id: I9df35b7bc953069cb151445415ea0b2708e4252a
---
M wmf-config/InitialiseSettings.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/79/83779/1

diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index 2acd14b..53ae63b 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -8707,7 +8707,7 @@
'bewikimedia' = array( 'meta' ),
'bnwiki' = array ( 'en' ), # Bug 34791
'brwikimedia' = array( 'pt', 'meta', 'pt:w', 'pt:wikt', 'pt:s', 
'pt:n', 'pt:q', 'pt:b', 'pt:v', 'commons' ),
-   'bnwikisource' = array( 'OldWikisource', 'w' ),
+   'bnwikisource' = array( 'OldWikisource', 'w', 'en' ),
'cawikibooks' = array( 'w', 's', ),
'cawikinews' = array( 'w', 'wikt', 'q', 'b', 's', 'v', 'fr', 'en', 
'de', 'es', 'pt', 'it', 'commons', 'meta', 'eo' ),
'cawikiquote' =  array( 'ca' ),

-- 
To view, visit https://gerrit.wikimedia.org/r/83779
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9df35b7bc953069cb151445415ea0b2708e4252a
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: TTO at.li...@live.com.au

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Fix typo in misc/graphite.pp ('content', not 'contents') - change (operations/puppet)

2013-09-11 Thread ArielGlenn (Code Review)
ArielGlenn has submitted this change and it was merged.

Change subject: Fix typo in misc/graphite.pp ('content', not 'contents')
..


Fix typo in misc/graphite.pp ('content', not 'contents')

Typo introduced in I7078bf230.

Change-Id: I6a1d9e0574c5b51b1af89f9b1dfc5cdf6630e7b5
---
M manifests/misc/graphite.pp
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  ArielGlenn: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/manifests/misc/graphite.pp b/manifests/misc/graphite.pp
index 90c43f1..f1ff857 100644
--- a/manifests/misc/graphite.pp
+++ b/manifests/misc/graphite.pp
@@ -133,8 +133,8 @@
 }
 
 file { '/usr/local/share/statsd/mediansOnlyFilter.js':
-contents = 'exports.filter = function ( m ) { return /median$/.test( 
m.name )  m; };',
-before   = Service['statsd'],
+content = 'exports.filter = function ( m ) { return /median$/.test( 
m.name )  m; };',
+before  = Service['statsd'],
 }
 
 file { '/etc/init/navtiming.conf':

-- 
To view, visit https://gerrit.wikimedia.org/r/83778
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I6a1d9e0574c5b51b1af89f9b1dfc5cdf6630e7b5
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh o...@wikimedia.org
Gerrit-Reviewer: ArielGlenn ar...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Support coordinate and entityidvalue in autossummaries - change (mediawiki...Wikibase)

2013-09-11 Thread Tobias Gritschacher (Code Review)
Tobias Gritschacher has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83780


Change subject: Support coordinate and entityidvalue in autossummaries
..

Support coordinate and entityidvalue in autossummaries

- this affects all API modules using ChangeOpMainSnak
- this is a fix for deployment only
- coordinates were just left blank in the summaries till now
- also the entityid were not shown anymore due to the changes in the
  EntityId class
- on master this should be fixed using formatters

Bug: 54005
Change-Id: Ib6df76009157b867e051f8d3fea822636bf850e9
---
M repo/includes/changeop/ChangeOpMainSnak.php
1 file changed, 20 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/80/83780/1

diff --git a/repo/includes/changeop/ChangeOpMainSnak.php 
b/repo/includes/changeop/ChangeOpMainSnak.php
index 247e5a1..f387759 100644
--- a/repo/includes/changeop/ChangeOpMainSnak.php
+++ b/repo/includes/changeop/ChangeOpMainSnak.php
@@ -5,6 +5,7 @@
 use InvalidArgumentException;
 use Wikibase\Snak;
 use Wikibase\Lib\EntityIdFormatter;
+use Wikibase\DataModel\Entity\EntityIdValue;
 
 /**
  * Class for mainsnak change operation
@@ -179,12 +180,25 @@
protected function getClaimSummaryArgs( Snak $mainSnak ) {
$propertyId = $this-idFormatter-format( 
$mainSnak-getPropertyId() );
 
-   //TODO: use formatters here!
-   if ( $mainSnak instanceof PropertyValueSnak ) {
-   $value = $mainSnak-getDataValue();
-   } else {
-   $value = $mainSnak-getType();
-   }
+if ( $mainSnak instanceof PropertyValueSnak ) {
+$value = $mainSnak-getDataValue();
+
+// TODO: we should use value formatters here!
+if ( $value instanceof EntityIdValue ) {
+$value = $value-getEntityId();
+} elseif ( $value instanceof TimeValue ) {
+$value = $value-getTime();
+} elseif ( $value instanceof GlobeCoordinateValue ) {
+$value = $value-getLatitude() . ', ' . $value-getLongitude();
+} elseif ( is_string( $value-getValue() ) ) {
+$value = $value-getValue();
+} else {
+//type not supported;
+$value = ;
+}
+} else {
+$value = $mainSnak-getType(); // todo handle no values in general 
way (needed elsewhere)
+}
 
$args = array( $propertyId = array( $value ) );
return array( $args );

-- 
To view, visit https://gerrit.wikimedia.org/r/83780
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib6df76009157b867e051f8d3fea822636bf850e9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: mw1.22-wmf16
Gerrit-Owner: Tobias Gritschacher tobias.gritschac...@wikimedia.de

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Match changes in Wikibase QueryEngine - change (mediawiki...WikibaseQuery)

2013-09-11 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Match changes in Wikibase QueryEngine
..


Match changes in Wikibase QueryEngine

Change-Id: Ice93e116587896d5d2c82f9943b0aab27685cacf
---
M WikibaseQuery.php
M src/Wikibase/Query/DIC/Builders/QueryInterfaceBuilder.php
M src/Wikibase/Query/DIC/Builders/QueryStoreBuilder.php
3 files changed, 30 insertions(+), 10 deletions(-)

Approvals:
  Aude: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/WikibaseQuery.php b/WikibaseQuery.php
index 9197f1e..63f02d2 100644
--- a/WikibaseQuery.php
+++ b/WikibaseQuery.php
@@ -128,7 +128,10 @@
 
$dependencyManager-registerBuilder(
'queryStore',
-   new \Wikibase\Query\DIC\Builders\QueryStoreBuilder()
+   new \Wikibase\Query\DIC\Builders\QueryStoreBuilder(
+   DB_SLAVE,
+   $GLOBALS['wgDBtype']
+   )
);
 
$dependencyManager-registerBuilder(
diff --git a/src/Wikibase/Query/DIC/Builders/QueryInterfaceBuilder.php 
b/src/Wikibase/Query/DIC/Builders/QueryInterfaceBuilder.php
index e2f0f3d..40f622e 100644
--- a/src/Wikibase/Query/DIC/Builders/QueryInterfaceBuilder.php
+++ b/src/Wikibase/Query/DIC/Builders/QueryInterfaceBuilder.php
@@ -3,8 +3,8 @@
 namespace Wikibase\Query\DIC\Builders;
 
 use Wikibase\Database\LazyDBConnectionProvider;
-use Wikibase\Database\MediaWiki\MWQueryInterfaceBuilder;
-use Wikibase\Database\QueryInterface;
+use Wikibase\Database\MediaWiki\MediaWikiQueryInterface;
+use Wikibase\Database\QueryInterface\QueryInterface;
 use Wikibase\Query\DIC\DependencyBuilder;
 use Wikibase\Query\DIC\DependencyManager;
 
@@ -39,12 +39,7 @@
 * @return QueryInterface
 */
public function buildObject( DependencyManager $dependencyManager ) {
-   $connectionProvider = $this-newConnectionProvider();
-
-   $qiBuilder = new MWQueryInterfaceBuilder();
-   $queryInterface = $qiBuilder-setConnection( 
$connectionProvider )-getQueryInterface();
-
-   return $queryInterface;
+   return new MediaWikiQueryInterface( 
$this-newConnectionProvider() );
}
 
protected function newConnectionProvider() {
diff --git a/src/Wikibase/Query/DIC/Builders/QueryStoreBuilder.php 
b/src/Wikibase/Query/DIC/Builders/QueryStoreBuilder.php
index ee0d6eb..2658735 100644
--- a/src/Wikibase/Query/DIC/Builders/QueryStoreBuilder.php
+++ b/src/Wikibase/Query/DIC/Builders/QueryStoreBuilder.php
@@ -2,6 +2,8 @@
 
 namespace Wikibase\Query\DIC\Builders;
 
+use Wikibase\Database\LazyDBConnectionProvider;
+use Wikibase\Database\MediaWiki\MWTableBuilderBuilder;
 use Wikibase\Query\ByPropertyValueEntityFinder;
 use Wikibase\Query\DIC\DependencyBuilder;
 use Wikibase\Query\DIC\DependencyManager;
@@ -21,6 +23,18 @@
  * @author Jeroen De Dauw  jeroended...@gmail.com 
  */
 class QueryStoreBuilder extends DependencyBuilder {
+
+   protected $connectionId;
+   protected $dbType;
+
+   /**
+* @param int $connectionId ie DB_MASTER, DB_SLAVE
+* @param string $dbType ie mysql, sqlite
+*/
+   public function __construct( $connectionId, $dbType ) {
+   $this-connectionId = $connectionId;
+   $this-dbType = $dbType;
+   }
 
/**
 * @see DependencyBuilder::buildObject
@@ -46,10 +60,18 @@
 
$config-setPropertyDataValueTypeLookup( $dvtLookup );
 
+   $tbBuilder = new MWTableBuilderBuilder();
+   $tbBuilder-setConnection( $this-newConnectionProvider() );
+
return new Store(
$config,
-   $dependencyManager-newObject( 'slaveQueryInterface' )
+   $dependencyManager-newObject( 'slaveQueryInterface' ),
+   $tbBuilder-getTableBuilder()
);
}
 
+   protected function newConnectionProvider() {
+   return new LazyDBConnectionProvider( $this-connectionId );
+   }
+
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/83629
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ice93e116587896d5d2c82f9943b0aab27685cacf
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseQuery
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com
Gerrit-Reviewer: Addshore addshorew...@gmail.com
Gerrit-Reviewer: Aude aude.w...@gmail.com
Gerrit-Reviewer: Tobias Gritschacher tobias.gritschac...@wikimedia.de
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Added getClaimGuidParser and initial usage - change (mediawiki...Wikibase)

2013-09-11 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83781


Change subject: Added getClaimGuidParser and initial usage
..

Added getClaimGuidParser and initial usage

Change-Id: I5718b339dead1058402979023dae060db9b125dd
---
M lib/includes/parsers/EntityIdParser.php
M repo/includes/WikibaseRepo.php
M repo/includes/api/GetClaims.php
3 files changed, 39 insertions(+), 22 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/81/83781/1

diff --git a/lib/includes/parsers/EntityIdParser.php 
b/lib/includes/parsers/EntityIdParser.php
index 0f3a114..47e7834 100644
--- a/lib/includes/parsers/EntityIdParser.php
+++ b/lib/includes/parsers/EntityIdParser.php
@@ -12,6 +12,8 @@
 /**
  * Parser that parses entity id strings into EntityId objects.
  *
+ * TODO: this should be turned into a proper adapter using a DataModel 
EntityIdParser
+ *
  * @since 0.4
  *
  * @file
diff --git a/repo/includes/WikibaseRepo.php b/repo/includes/WikibaseRepo.php
index a7a4ef6..1b52bb1 100644
--- a/repo/includes/WikibaseRepo.php
+++ b/repo/includes/WikibaseRepo.php
@@ -6,6 +6,9 @@
 use DataValues\DataValueFactory;
 use ValueFormatters\FormatterOptions;
 use ValueParsers\ParserOptions;
+use Wikibase\DataModel\Claim\ClaimGuidParser;
+use Wikibase\DataModel\Entity\BasicEntityIdParser;
+use Wikibase\DataModel\Entity\DispatchingEntityIdParser;
 use Wikibase\EntityContentFactory;
 use Wikibase\EntityLookup;
 use Wikibase\LanguageFallbackChainFactory;
@@ -258,6 +261,21 @@
}
 
/**
+* @since 0.5
+*
+* @return ClaimGuidParser
+*/
+   public function getClaimGuidParser() {
+   $idBuilders = BasicEntityIdParser::getBuilders();
+
+   // TODO: extensions need to be able to add builders.
+
+   $parser = new DispatchingEntityIdParser( $idBuilders );
+
+   return new ClaimGuidParser( $parser );
+   }
+
+   /**
 * @since 0.4
 *
 * @return EntityIdFormatter
diff --git a/repo/includes/api/GetClaims.php b/repo/includes/api/GetClaims.php
index 140cf86..e00c3d8 100644
--- a/repo/includes/api/GetClaims.php
+++ b/repo/includes/api/GetClaims.php
@@ -3,14 +3,13 @@
 namespace Wikibase\Api;
 
 use ApiBase;
-use MWException;
+use Wikibase\DataModel\Claim\ClaimGuidParser;
 use Wikibase\DataModel\Entity\EntityId;
 use Wikibase\Lib\ClaimGuidValidator;
 use Wikibase\Lib\Serializers\ClaimSerializer;
 use Wikibase\Lib\Serializers\SerializerFactory;
 use Wikibase\Entity;
 use Wikibase\EntityContentFactory;
-use Wikibase\Property;
 use Wikibase\Claims;
 use Wikibase\Claim;
 use Wikibase\Repo\WikibaseRepo;
@@ -191,35 +190,33 @@
 * Second element is either null or a claim GUID
 */
protected function getIdentifiers( $params ) {
+   if ( isset( $params['claim'] ) ) {
+   $claimGuid = $params['claim'];
+   $entityId = $this-getEntityIdFromClaimGuid( 
$params['claim'] );
 
-   $claimGuid = null;
-
-   // @todo handle the settings in a more generalized way for all 
the api modules
-   $settings = WikibaseRepo::getDefaultInstance()-getSettings();
-   $claimGuidValidator = new ClaimGuidValidator();
-
-   if ( isset( $params['claim'] )  
$claimGuidValidator-validateFormat( $params['claim'] ) === false ) {
-   $this-dieUsage( 'Invalid claim guid' , 'invalid-guid' 
);
-   }
-
-   if ( isset( $params['entity'] )  isset( $params['claim'] ) ) {
-   $entityId = Entity::getIdFromClaimGuid( 
$params['claim'] );
-
-   if ( $entityId !== $params['entity'] ) {
+   if( isset( $params['entity'] )  $entityId !== 
$params['entity'] ) {
$this-dieUsage( 'If both entity id and claim 
key are provided they need to point to the same entity', 'param-illegal' );
}
-   }
-   else if ( isset( $params['entity'] ) ) {
+   } else {
+   $claimGuid = null;
$entityId = $params['entity'];
-   }
-   else {
-   $entityId = Entity::getIdFromClaimGuid( 
$params['claim'] );
-   $claimGuid = $params['claim'];
}
 
return array( $entityId, $claimGuid );
}
 
+   protected function getEntityIdFromClaimGuid( $claimGuid ) {
+   $claimGuidValidator = new ClaimGuidValidator();
+
+   if ( $claimGuidValidator-validateFormat( $claimGuid ) === 
false ) {
+   $this-dieUsage( 'Invalid claim guid' , 'invalid-guid' 
);
+   }
+
+   $claimGuidParser = 
WikibaseRepo::getDefaultInstance()-getClaimGuidParser();
+
+ 

[MediaWiki-commits] [Gerrit] make getEntityIdForClaim use ClaimGuidParser - change (mediawiki...Wikibase)

2013-09-11 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83782


Change subject: make getEntityIdForClaim use ClaimGuidParser
..

make getEntityIdForClaim use ClaimGuidParser

Change-Id: I4733cfd29e46eef891e36d44d08b75a4a1f96973
---
M repo/includes/ClaimSaver.php
1 file changed, 5 insertions(+), 20 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/82/83782/1

diff --git a/repo/includes/ClaimSaver.php b/repo/includes/ClaimSaver.php
index 9d7e469..d66ff0e 100644
--- a/repo/includes/ClaimSaver.php
+++ b/repo/includes/ClaimSaver.php
@@ -7,6 +7,7 @@
 use Status;
 use ValueParsers\ParseException;
 use Wikibase\Claims;
+use Wikibase\DataModel\Claim\ClaimGuidParsingException;
 use Wikibase\ExceptionWithCode;
 use Wikibase\Repo\WikibaseRepo;
 
@@ -99,30 +100,14 @@
 * @throws ExceptionWithCode
 */
protected function getEntityIdForClaim( Claim $claim ) {
-   $guid = $claim-getGuid();
-
-   if ( $guid === null ) {
-   throw new ExceptionWithCode( 'The ID of the claim needs 
to be set', 'setclaim-no-guid' );
-   }
-
try {
-   $entityId = Entity::getIdFromClaimGuid( $guid );
+   $parser = 
WikibaseRepo::getDefaultInstance()-getClaimGuidParser();
+   return $parser-parse( $claim-getGuid() 
)-getEntityId();
}
-   catch ( MWException $exception ) {
+   catch( ClaimGuidParsingException $exception ) {
+   //todo fix the error code below to be 'invalid-guid'
throw new ExceptionWithCode( $exception-getMessage(), 
'setclaim-invalid-guid' );
}
-
-   $idParser = 
WikibaseRepo::getDefaultInstance()-getEntityIdParser();
-
-   try {
-   $entityId = $idParser-parse( $entityId );
-   }
-   catch ( ParseException $parseException ) {
-   throw new ExceptionWithCode( 
$parseException-getMessage(), 'setclaim-invalid-guid' );
-   }
-
-   assert( $entityId instanceof EntityId );
-   return $entityId;
}
 
/**

-- 
To view, visit https://gerrit.wikimedia.org/r/83782
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4733cfd29e46eef891e36d44d08b75a4a1f96973
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Added getClaimGuidParser and initial usage - change (mediawiki...Wikibase)

2013-09-11 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Added getClaimGuidParser and initial usage
..


Added getClaimGuidParser and initial usage

Change-Id: I5718b339dead1058402979023dae060db9b125dd
---
M lib/includes/parsers/EntityIdParser.php
M repo/includes/WikibaseRepo.php
M repo/includes/api/GetClaims.php
3 files changed, 39 insertions(+), 22 deletions(-)

Approvals:
  Addshore: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/lib/includes/parsers/EntityIdParser.php 
b/lib/includes/parsers/EntityIdParser.php
index 0f3a114..47e7834 100644
--- a/lib/includes/parsers/EntityIdParser.php
+++ b/lib/includes/parsers/EntityIdParser.php
@@ -12,6 +12,8 @@
 /**
  * Parser that parses entity id strings into EntityId objects.
  *
+ * TODO: this should be turned into a proper adapter using a DataModel 
EntityIdParser
+ *
  * @since 0.4
  *
  * @file
diff --git a/repo/includes/WikibaseRepo.php b/repo/includes/WikibaseRepo.php
index a7a4ef6..1b52bb1 100644
--- a/repo/includes/WikibaseRepo.php
+++ b/repo/includes/WikibaseRepo.php
@@ -6,6 +6,9 @@
 use DataValues\DataValueFactory;
 use ValueFormatters\FormatterOptions;
 use ValueParsers\ParserOptions;
+use Wikibase\DataModel\Claim\ClaimGuidParser;
+use Wikibase\DataModel\Entity\BasicEntityIdParser;
+use Wikibase\DataModel\Entity\DispatchingEntityIdParser;
 use Wikibase\EntityContentFactory;
 use Wikibase\EntityLookup;
 use Wikibase\LanguageFallbackChainFactory;
@@ -258,6 +261,21 @@
}
 
/**
+* @since 0.5
+*
+* @return ClaimGuidParser
+*/
+   public function getClaimGuidParser() {
+   $idBuilders = BasicEntityIdParser::getBuilders();
+
+   // TODO: extensions need to be able to add builders.
+
+   $parser = new DispatchingEntityIdParser( $idBuilders );
+
+   return new ClaimGuidParser( $parser );
+   }
+
+   /**
 * @since 0.4
 *
 * @return EntityIdFormatter
diff --git a/repo/includes/api/GetClaims.php b/repo/includes/api/GetClaims.php
index 140cf86..e00c3d8 100644
--- a/repo/includes/api/GetClaims.php
+++ b/repo/includes/api/GetClaims.php
@@ -3,14 +3,13 @@
 namespace Wikibase\Api;
 
 use ApiBase;
-use MWException;
+use Wikibase\DataModel\Claim\ClaimGuidParser;
 use Wikibase\DataModel\Entity\EntityId;
 use Wikibase\Lib\ClaimGuidValidator;
 use Wikibase\Lib\Serializers\ClaimSerializer;
 use Wikibase\Lib\Serializers\SerializerFactory;
 use Wikibase\Entity;
 use Wikibase\EntityContentFactory;
-use Wikibase\Property;
 use Wikibase\Claims;
 use Wikibase\Claim;
 use Wikibase\Repo\WikibaseRepo;
@@ -191,35 +190,33 @@
 * Second element is either null or a claim GUID
 */
protected function getIdentifiers( $params ) {
+   if ( isset( $params['claim'] ) ) {
+   $claimGuid = $params['claim'];
+   $entityId = $this-getEntityIdFromClaimGuid( 
$params['claim'] );
 
-   $claimGuid = null;
-
-   // @todo handle the settings in a more generalized way for all 
the api modules
-   $settings = WikibaseRepo::getDefaultInstance()-getSettings();
-   $claimGuidValidator = new ClaimGuidValidator();
-
-   if ( isset( $params['claim'] )  
$claimGuidValidator-validateFormat( $params['claim'] ) === false ) {
-   $this-dieUsage( 'Invalid claim guid' , 'invalid-guid' 
);
-   }
-
-   if ( isset( $params['entity'] )  isset( $params['claim'] ) ) {
-   $entityId = Entity::getIdFromClaimGuid( 
$params['claim'] );
-
-   if ( $entityId !== $params['entity'] ) {
+   if( isset( $params['entity'] )  $entityId !== 
$params['entity'] ) {
$this-dieUsage( 'If both entity id and claim 
key are provided they need to point to the same entity', 'param-illegal' );
}
-   }
-   else if ( isset( $params['entity'] ) ) {
+   } else {
+   $claimGuid = null;
$entityId = $params['entity'];
-   }
-   else {
-   $entityId = Entity::getIdFromClaimGuid( 
$params['claim'] );
-   $claimGuid = $params['claim'];
}
 
return array( $entityId, $claimGuid );
}
 
+   protected function getEntityIdFromClaimGuid( $claimGuid ) {
+   $claimGuidValidator = new ClaimGuidValidator();
+
+   if ( $claimGuidValidator-validateFormat( $claimGuid ) === 
false ) {
+   $this-dieUsage( 'Invalid claim guid' , 'invalid-guid' 
);
+   }
+
+   $claimGuidParser = 
WikibaseRepo::getDefaultInstance()-getClaimGuidParser();
+
+   return $claimGuidParser-parse( $claimGuid 

[MediaWiki-commits] [Gerrit] set valid protocol for 'client', remove 'repo' from family f... - change (pywikibot/compat)

2013-09-11 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: set valid protocol for 'client', remove 'repo' from family 
file, wikidata-test-repo.wikimedia.de is no longer availlable remove overriding 
defaults, they are no longer needed.
..


set valid protocol for 'client',
remove 'repo' from family file,
wikidata-test-repo.wikimedia.de is no longer availlable
remove overriding defaults, they are no longer needed.

Change-Id: I48ec1463d1b6bf87519e741f301b0d3a72aa9b51
---
M families/wikidata_family.py
1 file changed, 6 insertions(+), 20 deletions(-)

Approvals:
  Ladsgroup: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/families/wikidata_family.py b/families/wikidata_family.py
index bf7bbe0..ac801d4 100644
--- a/families/wikidata_family.py
+++ b/families/wikidata_family.py
@@ -13,20 +13,11 @@
 self.name = 'wikidata'
 self.langs = {
 'wikidata': 'www.wikidata.org',
-'repo': 'wikidata-test-repo.wikimedia.de',
 'client': 'wikidata-test-client.wikimedia.de',
 'test': 'test.wikidata.org',
 }
 
 # Override defaults
-self.namespaces[0]['repo'] = [u'', u'Item']
-self.namespaces[1]['repo'] = [u'Talk', u'Item talk']
-del(self.namespaces[828]['_default'])
-del(self.namespaces[829]['_default'])
-self.namespaces[828]['test'] = u'Module'
-self.namespaces[829]['test'] = u'Module talk'
-self.namespaces[828]['wikidata'] = u'Module'
-self.namespaces[829]['wikidata'] = u'Module talk'
 
 # Most namespaces are inherited from family.Family.
 # Translation used on all wikis for the different namespaces.
@@ -35,18 +26,10 @@
 self.namespaces[4] = {
 '_default': [u'Wikidata', u'WD', 'Project'],
 'client': u'Test Wikipedia',
-'repo': u'Testwiki',
 }
 self.namespaces[5] = {
 '_default': [u'Wikidata talk', u'WT', 'Project talk'],
 'client': u'Test Wikipedia talk',
-'repo': u'Testwiki talk',
-}
-self.namespaces[102] = {
-'repo': u'Property',
-}
-self.namespaces[103] = {
-'repo': u'Property talk',
 }
 self.namespaces[120] = {
 'test': u'Property',
@@ -65,12 +48,10 @@
 'wikidata': u'Query talk',
 }
 self.namespaces[1198] = {
-'repo': u'Translations',
 'test': u'Translations',
 'wikidata': u'Translations',
 }
 self.namespaces[1199] = {
-'repo': u'Translations talk',
 'test': u'Translations talk',
 'wikidata': u'Translations talk',
 }
@@ -93,4 +74,9 @@
 elif code == 'test':
 return ('test', 'wikidata')
 else:
-return ('repo', 'wikidata')
+return (None, None)
+
+def protocol(self, code):
+if code == 'client':
+return 'http'
+return super(Family, self).protocol(code)

-- 
To view, visit https://gerrit.wikimedia.org/r/83359
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I48ec1463d1b6bf87519e741f301b0d3a72aa9b51
Gerrit-PatchSet: 4
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Xqt i...@gno.de
Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com
Gerrit-Reviewer: Legoktm legoktm.wikipe...@gmail.com
Gerrit-Reviewer: Xqt i...@gno.de
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] make getEntityIdForClaim use ClaimGuidParser - change (mediawiki...Wikibase)

2013-09-11 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: make getEntityIdForClaim use ClaimGuidParser
..


make getEntityIdForClaim use ClaimGuidParser

Change-Id: I4733cfd29e46eef891e36d44d08b75a4a1f96973
---
M repo/includes/ClaimSaver.php
1 file changed, 5 insertions(+), 20 deletions(-)

Approvals:
  Addshore: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/repo/includes/ClaimSaver.php b/repo/includes/ClaimSaver.php
index 9d7e469..d66ff0e 100644
--- a/repo/includes/ClaimSaver.php
+++ b/repo/includes/ClaimSaver.php
@@ -7,6 +7,7 @@
 use Status;
 use ValueParsers\ParseException;
 use Wikibase\Claims;
+use Wikibase\DataModel\Claim\ClaimGuidParsingException;
 use Wikibase\ExceptionWithCode;
 use Wikibase\Repo\WikibaseRepo;
 
@@ -99,30 +100,14 @@
 * @throws ExceptionWithCode
 */
protected function getEntityIdForClaim( Claim $claim ) {
-   $guid = $claim-getGuid();
-
-   if ( $guid === null ) {
-   throw new ExceptionWithCode( 'The ID of the claim needs 
to be set', 'setclaim-no-guid' );
-   }
-
try {
-   $entityId = Entity::getIdFromClaimGuid( $guid );
+   $parser = 
WikibaseRepo::getDefaultInstance()-getClaimGuidParser();
+   return $parser-parse( $claim-getGuid() 
)-getEntityId();
}
-   catch ( MWException $exception ) {
+   catch( ClaimGuidParsingException $exception ) {
+   //todo fix the error code below to be 'invalid-guid'
throw new ExceptionWithCode( $exception-getMessage(), 
'setclaim-invalid-guid' );
}
-
-   $idParser = 
WikibaseRepo::getDefaultInstance()-getEntityIdParser();
-
-   try {
-   $entityId = $idParser-parse( $entityId );
-   }
-   catch ( ParseException $parseException ) {
-   throw new ExceptionWithCode( 
$parseException-getMessage(), 'setclaim-invalid-guid' );
-   }
-
-   assert( $entityId instanceof EntityId );
-   return $entityId;
}
 
/**

-- 
To view, visit https://gerrit.wikimedia.org/r/83782
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I4733cfd29e46eef891e36d44d08b75a4a1f96973
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com
Gerrit-Reviewer: Addshore addshorew...@gmail.com
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Fixed compilation on Linux by moving constants to .cpp - change (operations...incremental)

2013-09-11 Thread Petr Onderka (Code Review)
Petr Onderka has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83789


Change subject: Fixed compilation on Linux by moving constants to .cpp
..

Fixed compilation on Linux by moving constants to .cpp

Change-Id: I76cec79142f3b2a85e36b8e61c8a780dc061dd66
---
M DumpObjects/FileHeader.cpp
M DumpObjects/FileHeader.h
2 files changed, 6 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/dumps/incremental 
refs/changes/89/83789/1

diff --git a/DumpObjects/FileHeader.cpp b/DumpObjects/FileHeader.cpp
index d41a6e2..5973f26 100644
--- a/DumpObjects/FileHeader.cpp
+++ b/DumpObjects/FileHeader.cpp
@@ -4,6 +4,8 @@
 #include ../DumpException.h
 
 const std::string FileHeader::MagicNumber = MWID;
+const std::uint8_t FileHeader::FileFormatVersion = 1;
+const std::uint8_t FileHeader::FileDataVersion = 1;
 
 FileHeader::FileHeader(
 DumpKind kind,
@@ -84,4 +86,4 @@
 
 FileHeader::FileHeader(std::weak_ptrWritableDump dump)
 : DumpObject(dump), FileEnd(Length()), PageIdIndexRoot(0), 
RevisionIdIndexRoot(0), TextGroupIdIndexRoot(0), ModelFormatIndexRoot(0), 
FreeSpaceIndexRoot(0), SiteInfo(0)
-{}
\ No newline at end of file
+{}
diff --git a/DumpObjects/FileHeader.h b/DumpObjects/FileHeader.h
index 8edfc20..137c524 100644
--- a/DumpObjects/FileHeader.h
+++ b/DumpObjects/FileHeader.h
@@ -21,8 +21,8 @@
 void WriteInternal();
 public:
 static const std::string MagicNumber;
-static const std::uint8_t FileFormatVersion = 1;
-static const std::uint8_t FileDataVersion = 1;
+static const std::uint8_t FileFormatVersion;
+static const std::uint8_t FileDataVersion;
 
 static FileHeader Read(ReadableDump const dump);
 
@@ -40,4 +40,4 @@
 Offset SiteInfo;
 
 FileHeader(std::weak_ptrWritableDump dump = 
std::weak_ptrWritableDump());
-};
\ No newline at end of file
+};

-- 
To view, visit https://gerrit.wikimedia.org/r/83789
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I76cec79142f3b2a85e36b8e61c8a780dc061dd66
Gerrit-PatchSet: 1
Gerrit-Project: operations/dumps/incremental
Gerrit-Branch: gsoc
Gerrit-Owner: Petr Onderka gsv...@gmail.com

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Removed check for trailing zero in decompressed string - change (operations...incremental)

2013-09-11 Thread Petr Onderka (Code Review)
Petr Onderka has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83788


Change subject: Removed check for trailing zero in decompressed string
..

Removed check for trailing zero in decompressed string

With compressed groups, missing trailing zero is problematic.
On the other hand, added trailing zero is now okay.

Change-Id: Ia368b7ef2a198ee327029704e0a19f5b4ae7f84f
---
M SevenZip.cpp
1 file changed, 0 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/dumps/incremental 
refs/changes/88/83788/1

diff --git a/SevenZip.cpp b/SevenZip.cpp
index 04a403f..b9fe86f 100644
--- a/SevenZip.cpp
+++ b/SevenZip.cpp
@@ -63,10 +63,5 @@
 
 std::string decompressedString = outputStdStream.str();
 
-// LZMA decompression seems to sometimes introduce trailing 0 byte
-// this takes care of that
-if (!decompressedString.empty()  decompressedString.back() == '\0')
-decompressedString.pop_back();
-
 return decompressedString;
 }
\ No newline at end of file

-- 
To view, visit https://gerrit.wikimedia.org/r/83788
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia368b7ef2a198ee327029704e0a19f5b4ae7f84f
Gerrit-PatchSet: 1
Gerrit-Project: operations/dumps/incremental
Gerrit-Branch: gsoc
Gerrit-Owner: Petr Onderka gsv...@gmail.com

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Write page after its revisions - change (operations...incremental)

2013-09-11 Thread Petr Onderka (Code Review)
Petr Onderka has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83784


Change subject: Write page after its revisions
..

Write page after its revisions

This is necessary when creating big dumps from XML.
Without this, all revisions of a page have to be kept in memory,
including their texts.
A downside is that this will increase seeking when reading.

Change-Id: Ib6ea9fe67671df7a5686f6a4e441ab95ff6dba01
---
M DumpObjects/DumpPage.cpp
M DumpObjects/DumpPage.h
M DumpWriters/DumpWriter.cpp
M DumpWriters/DumpWriter.h
4 files changed, 36 insertions(+), 50 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/dumps/incremental 
refs/changes/84/83784/1

diff --git a/DumpObjects/DumpPage.cpp b/DumpObjects/DumpPage.cpp
index 1d074be..b5e695b 100644
--- a/DumpObjects/DumpPage.cpp
+++ b/DumpObjects/DumpPage.cpp
@@ -40,35 +40,28 @@
 void DumpPage::Write()
 {
 if (wasLoaded  originalPage == page)
-{
-if (diffWriter != nullptr)
-diffWriter-StartExistingPage(page.PageId);
-
 return;
-}
 
 DumpObject::Write();
 }
 
-void DumpPage::Write(DiffWriter *diffWriter)
+void DumpPage::WriteDiff(DiffWriter diffWriter)
 {
-this-diffWriter = diffWriter;
-Write();
-this-diffWriter = nullptr;
+if (wasLoaded)
+{
+if (originalPage == page)
+diffWriter.StartExistingPage(page.PageId);
+else
+diffWriter.StartExistingPage(originalPage, page);
+}
+else
+diffWriter.StartNewPage(page);
 }
 
 void DumpPage::WriteInternal()
 {
 WriteValue((uint8_t)DumpObjectKind::Page);
 WriteCore(*stream, page, true);
-
-if (diffWriter != nullptr)
-{
-if (wasLoaded)
-diffWriter-StartExistingPage(originalPage, page);
-else
-diffWriter-StartNewPage(page);
-}
 }
 
 void DumpPage::UpdateIndex(Offset offset, bool overwrite)
@@ -87,13 +80,13 @@
 }
 
 DumpPage::DumpPage(weak_ptrWritableDump dump, uint32_t pageId)
-: DumpObject(dump), page(), diffWriter()
+: DumpObject(dump), page()
 {
 Load(pageId);
 }
 
 DumpPage::DumpPage(weak_ptrWritableDump dump, Offset offset)
-: DumpObject(dump), page(), diffWriter()
+: DumpObject(dump), page()
 {
 auto dumpRef = dump.lock();
 
diff --git a/DumpObjects/DumpPage.h b/DumpObjects/DumpPage.h
index 4c230bf..3d1e16d 100644
--- a/DumpObjects/DumpPage.h
+++ b/DumpObjects/DumpPage.h
@@ -11,8 +11,6 @@
 Page originalPage;
 bool wasLoaded;
 
-DiffWriter *diffWriter;
-
 void Load(std::uint32_t pageId);
 static Page Read(std::shared_ptrWritableDump dump, Offset offset);
 protected:
@@ -25,7 +23,7 @@
 DumpPage(std::weak_ptrWritableDump dump, Offset offset);
 
 virtual void Write() override;
-void Write(DiffWriter *diffWriter);
+void WriteDiff(DiffWriter diffWriter);
 virtual std::uint32_t NewLength() override;
 
 static Page ReadCore(std::istream stream, bool includeRevisionIds);
diff --git a/DumpWriters/DumpWriter.cpp b/DumpWriters/DumpWriter.cpp
index 96cfa67..d1423fe 100644
--- a/DumpWriters/DumpWriter.cpp
+++ b/DumpWriters/DumpWriter.cpp
@@ -31,39 +31,38 @@
 oldPage = this-page-page;
 this-page-page = *page;
 unset(unvisitedPageIds, pageId);
+
+if (diffWriter != nullptr)
+this-page-WriteDiff(*diffWriter);
 }
 
 void DumpWriter::AddRevision(const std::shared_ptrconst Revision revision)
 {
 page-page.RevisionIds.insert(revision-RevisionId);
-revisions.push_back(revision);
+
+DumpRevision dumpRevision(dump, revision-RevisionId, false);
+dumpRevision.revision = *revision;
+
+if (diffWriter != nullptr)
+{
+bool isNew;
+std::uint8_t modelFormatId = dumpRevision.GetModelFormatId(isNew);
+
+if (isNew)
+diffWriter-NewModelFormat(modelFormatId, 
dumpRevision.revision.Model, dumpRevision.revision.Format);
+}
+
+bool newRevision = !contains(oldPage.RevisionIds, revision-RevisionId);
+
+if (newRevision)
+newRevisionIds.insert(revision-RevisionId);
+
+dumpRevision.Write(diffWriter.get(), newRevision);
 }
 
 void DumpWriter::EndPage()
 {
-page-Write(diffWriter.get());
-
-for (auto revision : revisions)
-{
-DumpRevision dumpRevision(dump, revision-RevisionId, false);
-dumpRevision.revision = *revision;
-
-if (diffWriter != nullptr)
-{
-bool isNew;
-std::uint8_t modelFormatId = dumpRevision.GetModelFormatId(isNew);
-
-if (isNew)
-diffWriter-NewModelFormat(modelFormatId, 
dumpRevision.revision.Model, dumpRevision.revision.Format);
-}
-
-bool newRevision = !contains(oldPage.RevisionIds, 
revision-RevisionId);
-
-if (newRevision)
-newRevisionIds.insert(revision-RevisionId);
-
-dumpRevision.Write(diffWriter.get(), newRevision);
-}
+page-Write();
 
 auto 

[MediaWiki-commits] [Gerrit] Don't save namespace as part of title - change (operations...incremental)

2013-09-11 Thread Petr Onderka (Code Review)
Petr Onderka has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83785


Change subject: Don't save namespace as part of title
..

Don't save namespace as part of title

Change-Id: I794c19db9e36d11d6d05e3bbd7f6f3fe26fb8b0a
---
M DumpWriters/ArticlesWriterWrapper.cpp
M DumpWriters/ArticlesWriterWrapper.h
M DumpWriters/CompositeWriter.cpp
M DumpWriters/CompositeWriter.h
M DumpWriters/DumpWriter.cpp
M DumpWriters/DumpWriter.h
M DumpWriters/IDumpWriter.h
M DumpWriters/WriterWrapper.cpp
M DumpWriters/WriterWrapper.h
M XmlInput/XmlPageProcessor.cpp
M XmlWriter.cpp
11 files changed, 43 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/dumps/incremental 
refs/changes/85/83785/1

diff --git a/DumpWriters/ArticlesWriterWrapper.cpp 
b/DumpWriters/ArticlesWriterWrapper.cpp
index a17c385..4554784 100644
--- a/DumpWriters/ArticlesWriterWrapper.cpp
+++ b/DumpWriters/ArticlesWriterWrapper.cpp
@@ -3,12 +3,12 @@
 
 const std::int16_t UserNamespace = 2;
 
-void ArticlesWriterWrapper::StartPage(const std::shared_ptrconst Page page)
+void ArticlesWriterWrapper::StartPage(const std::shared_ptrconst Page page, 
bool titleWithNamespace)
 {
 pageInlcuded = page-Namespace % 2 == 0  page-Namespace != 
UserNamespace;
 
 if (pageInlcuded)
-wrapped-StartPage(page);
+wrapped-StartPage(page, titleWithNamespace);
 }
 
 void ArticlesWriterWrapper::AddRevision(const std::shared_ptrconst Revision 
revision)
diff --git a/DumpWriters/ArticlesWriterWrapper.h 
b/DumpWriters/ArticlesWriterWrapper.h
index 366f11e..fd7c99b 100644
--- a/DumpWriters/ArticlesWriterWrapper.h
+++ b/DumpWriters/ArticlesWriterWrapper.h
@@ -11,7 +11,7 @@
 : WriterWrapper(std::move(wrapped)), pageInlcuded(false)
 {}
 
-virtual void StartPage(const std::shared_ptrconst Page page) override;
+virtual void StartPage(const std::shared_ptrconst Page page, bool 
titleWithNamespace) override;
 virtual void AddRevision(const std::shared_ptrconst Revision revision) 
override;
 virtual void EndPage() override;
 virtual void SetDumpKind(DumpKind dumpKind) override;
diff --git a/DumpWriters/CompositeWriter.cpp b/DumpWriters/CompositeWriter.cpp
index c93dde4..ad75049 100644
--- a/DumpWriters/CompositeWriter.cpp
+++ b/DumpWriters/CompositeWriter.cpp
@@ -1,10 +1,10 @@
 #include CompositeWriter.h
 #include ../DumpException.h
 
-void CompositeWriter::StartPage(const std::shared_ptrconst Page page)
+void CompositeWriter::StartPage(const std::shared_ptrconst Page page, bool 
titleWithNamespace)
 {
 for (auto writer : writers)
-writer-StartPage(page);
+writer-StartPage(page, titleWithNamespace);
 }
 
 void CompositeWriter::AddRevision(const std::shared_ptrconst Revision 
revision)
diff --git a/DumpWriters/CompositeWriter.h b/DumpWriters/CompositeWriter.h
index 5352e80..8966f52 100644
--- a/DumpWriters/CompositeWriter.h
+++ b/DumpWriters/CompositeWriter.h
@@ -15,7 +15,7 @@
 : writers(std::move(writers)), getTextFunction(getTextFunction)
 {}
 
-virtual void StartPage(const std::shared_ptrconst Page page) override;
+virtual void StartPage(const std::shared_ptrconst Page page, bool 
titleWithNamespace) override;
 virtual void AddRevision(const std::shared_ptrconst Revision revision) 
override;
 virtual void EndPage() override;
 virtual void SetSiteInfo(const std::shared_ptrconst SiteInfo siteInfo) 
override;
diff --git a/DumpWriters/DumpWriter.cpp b/DumpWriters/DumpWriter.cpp
index d1423fe..6183c4c 100644
--- a/DumpWriters/DumpWriter.cpp
+++ b/DumpWriters/DumpWriter.cpp
@@ -5,6 +5,21 @@
 #include ../Indexes/Index.h
 #include ../format.h
 
+void DumpWriter::RemoveNamespace(Page page)
+{
+std::string namespapceName = 
dump-siteInfo-siteInfo.Namespaces.at(page.Namespace).second;
+
+if (namespapceName.empty())
+return;
+
+namespapceName.append(:);
+
+if (page.Title.substr(0, namespapceName.length()) != namespapceName)
+throw DumpException();
+
+page.Title.erase(0, namespapceName.length());
+}
+
 DumpWriter::DumpWriter(std::shared_ptrWritableDump dump, bool withText, 
std::unique_ptrDiffWriter diffWriter)
 : dump(dump), withText(withText), diffWriter(std::move(diffWriter))
 {
@@ -24,12 +39,17 @@
 diffWriter-SetSiteInfo(*siteInfo, dump-fileHeader.Kind);
 }
 
-void DumpWriter::StartPage(const std::shared_ptrconst Page page)
+void DumpWriter::StartPage(const std::shared_ptrconst Page page, bool 
titleWithNamespace)
 {
 std::uint32_t pageId = page-PageId;
+
 this-page = std::unique_ptrDumpPage(new DumpPage(dump, pageId));
 oldPage = this-page-page;
 this-page-page = *page;
+
+if (titleWithNamespace)
+RemoveNamespace(this-page-page);
+
 unset(unvisitedPageIds, pageId);
 
 if (diffWriter != nullptr)
diff --git a/DumpWriters/DumpWriter.h b/DumpWriters/DumpWriter.h
index 233f9ea..a1fee36 100644
--- 

[MediaWiki-commits] [Gerrit] Fix comments early, so that check for no changes works right - change (operations...incremental)

2013-09-11 Thread Petr Onderka (Code Review)
Petr Onderka has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83786


Change subject: Fix comments early, so that check for no changes works right
..

Fix comments early, so that check for no changes works right

+ handle another case of overlong comment

Change-Id: Id6424a9e44ba1351396bb7ba994899c088742cb3
---
M DumpObjects/DumpTraits.h
M DumpWriters/DumpWriter.cpp
M DumpWriters/DumpWriter.h
3 files changed, 22 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/dumps/incremental 
refs/changes/86/83786/1

diff --git a/DumpObjects/DumpTraits.h b/DumpObjects/DumpTraits.h
index ba7f3cf..45a686e 100644
--- a/DumpObjects/DumpTraits.h
+++ b/DumpObjects/DumpTraits.h
@@ -219,17 +219,7 @@
 
 if (length  255)
 {
-// invalid UTF-8 at the end of a string is represented as U+FFFD
-// this can get string over 255 bytes, so that character needs to 
be removed
-
-string replacementChar = \xEF\xBF\xBD; // UTF-8 encoded U+FFFD 
REPLACEMENT CHARACTER
-if (value.substr(value.length() - 3) == replacementChar)
-{
-string fixedValue = value.substr(0, value.length() - 3);
-Write(stream, fixedValue);
-}
-else
-throw DumpException();
+throw DumpException();
 }
 else
 {
diff --git a/DumpWriters/DumpWriter.cpp b/DumpWriters/DumpWriter.cpp
index 6183c4c..4d899e9 100644
--- a/DumpWriters/DumpWriter.cpp
+++ b/DumpWriters/DumpWriter.cpp
@@ -20,6 +20,24 @@
 page.Title.erase(0, namespapceName.length());
 }
 
+void DumpWriter::NormalizeComment(Revision revision)
+{
+std::string comment = revision.Comment;
+if (comment.length()  255)
+{
+// invalid UTF-8 at the end of a string is represented as U+FFFD
+// this can get string over 255 bytes, so that character needs to be 
removed
+
+std::string replacementChar = \xEF\xBF\xBD; // UTF-8 encoded U+FFFD 
REPLACEMENT CHARACTER
+if (comment.substr(comment.length() - 3) == replacementChar)
+comment.erase(comment.length() - 3, 3);
+else if (comment.substr(comment.length() - 6) == replacementChar + 
...)
+comment.pop_back();
+else
+throw DumpException();
+}
+}
+
 DumpWriter::DumpWriter(std::shared_ptrWritableDump dump, bool withText, 
std::unique_ptrDiffWriter diffWriter)
 : dump(dump), withText(withText), diffWriter(std::move(diffWriter))
 {
@@ -63,6 +81,8 @@
 DumpRevision dumpRevision(dump, revision-RevisionId, false);
 dumpRevision.revision = *revision;
 
+NormalizeComment(dumpRevision.revision);
+
 if (diffWriter != nullptr)
 {
 bool isNew;
diff --git a/DumpWriters/DumpWriter.h b/DumpWriters/DumpWriter.h
index a1fee36..2d99090 100644
--- a/DumpWriters/DumpWriter.h
+++ b/DumpWriters/DumpWriter.h
@@ -20,6 +20,7 @@
 bool withText;
 
 void RemoveNamespace(Page page);
+void NormalizeComment(Revision revision);
 public:
 DumpWriter(std::shared_ptrWritableDump dump, bool withText, 
std::unique_ptrDiffWriter diffWriter = nullptr);
 

-- 
To view, visit https://gerrit.wikimedia.org/r/83786
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id6424a9e44ba1351396bb7ba994899c088742cb3
Gerrit-PatchSet: 1
Gerrit-Project: operations/dumps/incremental
Gerrit-Branch: gsoc
Gerrit-Owner: Petr Onderka gsv...@gmail.com

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Fixed memory issues - change (operations...incremental)

2013-09-11 Thread Petr Onderka (Code Review)
Petr Onderka has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83783


Change subject: Fixed memory issues
..

Fixed memory issues

- clearing index cache periodically, so that it doesn't grow too much
- fixed memory leaks
- less copying

Change-Id: I1483a2f4855a7faa751dd8ed7ee050b17a0c7204
---
M DumpObjects/DumpObject.h
M Indexes/Index.h
M Indexes/Index.tpp
M Indexes/IndexInnerNode.h
M Indexes/IndexInnerNode.tpp
M Indexes/IndexLeafNode.h
M Indexes/IndexLeafNode.tpp
M Indexes/IndexNode.h
M Indexes/Iterators/IndexNodeIterator.h
M XmlUtils.cpp
10 files changed, 47 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/dumps/incremental 
refs/changes/83/83783/1

diff --git a/DumpObjects/DumpObject.h b/DumpObjects/DumpObject.h
index ef21805..3efc910 100644
--- a/DumpObjects/DumpObject.h
+++ b/DumpObjects/DumpObject.h
@@ -16,18 +16,20 @@
 virtual void WriteInternal() = 0;
 
 templatetypename T
-void WriteValue(const T value);
+void WriteValue(const T value);
 public:
 templatetypename T
-static void WriteValue(std::ostream stream, const T value);
+static void WriteValue(std::ostream stream, const T value);
 
 templatetypename T
 static void ReadValue(std::istream stream, T value);
 
 templatetypename T
-static std::uint32_t ValueSize(const T value);
+static std::uint32_t ValueSize(const T value);
 
 virtual std::uint32_t NewLength() = 0;
+
+virtual ~DumpObjectBase() {}
 };
 
 class DumpObject : public DumpObjectBase
@@ -47,13 +49,13 @@
 };
 
 templatetypename T
-void DumpObjectBase::WriteValue(const T value)
+void DumpObjectBase::WriteValue(const T value)
 {
 WriteValue(*stream, value);
 }
 
 templatetypename T
-void DumpObjectBase::WriteValue(std::ostream stream, const T value)
+void DumpObjectBase::WriteValue(std::ostream stream, const T value)
 {
 DumpTraitsT::Write(stream, value);
 }
@@ -65,7 +67,7 @@
 }
 
 templatetypename T
-uint32_t DumpObjectBase::ValueSize(const T value)
+uint32_t DumpObjectBase::ValueSize(const T value)
 {
 return DumpTraitsT::DumpSize(value);
 }
\ No newline at end of file
diff --git a/Indexes/Index.h b/Indexes/Index.h
index 24e822c..ac77ddb 100644
--- a/Indexes/Index.h
+++ b/Indexes/Index.h
@@ -17,6 +17,8 @@
 std::weak_ptrWritableDump dump;
 std::weak_ptrOffset fileHeaderOffset;
 
+int recentChanges;
+
 void AfterAdd();
 public:
 Index(std::weak_ptrWritableDump dump, std::weak_ptrOffset 
fileHeaderOffset, bool delaySave = false);
diff --git a/Indexes/Index.tpp b/Indexes/Index.tpp
index 294d755..7ba38d5 100644
--- a/Indexes/Index.tpp
+++ b/Indexes/Index.tpp
@@ -7,7 +7,7 @@
 
 templatetypename TKey, typename TValue
 IndexTKey, TValue::Index(std::weak_ptrWritableDump dump, 
std::weak_ptrOffset fileHeaderOffset, bool delaySave)
-: dump(dump), fileHeaderOffset(fileHeaderOffset)
+: dump(dump), fileHeaderOffset(fileHeaderOffset), recentChanges(0)
 {
 auto offset = fileHeaderOffset.lock();
 
@@ -63,6 +63,14 @@
 
 rootNodeUnsaved = false;
 }
+
+recentChanges++;
+
+if (recentChanges = 10)
+{
+rootNode-ClearCached();
+recentChanges = 0;
+}
 }
 
 templatetypename TKey, typename TValue
diff --git a/Indexes/IndexInnerNode.h b/Indexes/IndexInnerNode.h
index 3b039bc..5ccc1e1 100644
--- a/Indexes/IndexInnerNode.h
+++ b/Indexes/IndexInnerNode.h
@@ -41,6 +41,8 @@
 virtual std::uint32_t RealLength() override;
 virtual SplitResult Split() override;
 
+virtual void ClearCached() override;
+
 virtual std::unique_ptrIndexNodeIteratorTKey, TValue begin() override;
 virtual std::unique_ptrIndexNodeIteratorTKey, TValue end() override;
 };
diff --git a/Indexes/IndexInnerNode.tpp b/Indexes/IndexInnerNode.tpp
index b6607c1..0890b2a 100644
--- a/Indexes/IndexInnerNode.tpp
+++ b/Indexes/IndexInnerNode.tpp
@@ -152,6 +152,8 @@
 templatetypename TKey, typename TValue
 void IndexInnerNodeTKey, TValue::Write()
 {
+// TODO: don't do anything when there are no changes
+
 IndexNodeTKey, TValue::Write();
 
 for (auto cachedChild : cachedChildren)
@@ -217,6 +219,17 @@
 }
 
 templatetypename TKey, typename TValue
+void IndexInnerNodeTKey, TValue::ClearCached()
+{
+Write();
+
+for (unsigned i = 0; i  cachedChildren.size(); i++)
+{
+cachedChildren.at(i) = nullptr;
+}
+}
+
+templatetypename TKey, typename TValue
 std::unique_ptrIndexNodeIteratorTKey, TValue IndexInnerNodeTKey, 
TValue::begin()
 {
 return std::unique_ptrIndexNodeIteratorTKey, TValue(new 
IndexInnerIteratorTKey, TValue(this, true));
diff --git a/Indexes/IndexLeafNode.h b/Indexes/IndexLeafNode.h
index 1598488..ad069ac 100644
--- a/Indexes/IndexLeafNode.h
+++ b/Indexes/IndexLeafNode.h
@@ -32,6 +32,8 @@
 virtual std::uint32_t RealLength() override;
 virtual SplitResult Split() override;
 
+virtual void ClearCached() override;
+
 

[MediaWiki-commits] [Gerrit] Fixed memory issues - change (operations...incremental)

2013-09-11 Thread Petr Onderka (Code Review)
Petr Onderka has submitted this change and it was merged.

Change subject: Fixed memory issues
..


Fixed memory issues

- clearing index cache periodically, so that it doesn't grow too much
- fixed memory leaks
- less copying

Change-Id: I1483a2f4855a7faa751dd8ed7ee050b17a0c7204
---
M DumpObjects/DumpObject.h
M Indexes/Index.h
M Indexes/Index.tpp
M Indexes/IndexInnerNode.h
M Indexes/IndexInnerNode.tpp
M Indexes/IndexLeafNode.h
M Indexes/IndexLeafNode.tpp
M Indexes/IndexNode.h
M Indexes/Iterators/IndexNodeIterator.h
M XmlUtils.cpp
10 files changed, 47 insertions(+), 10 deletions(-)

Approvals:
  Petr Onderka: Verified; Looks good to me, approved



diff --git a/DumpObjects/DumpObject.h b/DumpObjects/DumpObject.h
index ef21805..3efc910 100644
--- a/DumpObjects/DumpObject.h
+++ b/DumpObjects/DumpObject.h
@@ -16,18 +16,20 @@
 virtual void WriteInternal() = 0;
 
 templatetypename T
-void WriteValue(const T value);
+void WriteValue(const T value);
 public:
 templatetypename T
-static void WriteValue(std::ostream stream, const T value);
+static void WriteValue(std::ostream stream, const T value);
 
 templatetypename T
 static void ReadValue(std::istream stream, T value);
 
 templatetypename T
-static std::uint32_t ValueSize(const T value);
+static std::uint32_t ValueSize(const T value);
 
 virtual std::uint32_t NewLength() = 0;
+
+virtual ~DumpObjectBase() {}
 };
 
 class DumpObject : public DumpObjectBase
@@ -47,13 +49,13 @@
 };
 
 templatetypename T
-void DumpObjectBase::WriteValue(const T value)
+void DumpObjectBase::WriteValue(const T value)
 {
 WriteValue(*stream, value);
 }
 
 templatetypename T
-void DumpObjectBase::WriteValue(std::ostream stream, const T value)
+void DumpObjectBase::WriteValue(std::ostream stream, const T value)
 {
 DumpTraitsT::Write(stream, value);
 }
@@ -65,7 +67,7 @@
 }
 
 templatetypename T
-uint32_t DumpObjectBase::ValueSize(const T value)
+uint32_t DumpObjectBase::ValueSize(const T value)
 {
 return DumpTraitsT::DumpSize(value);
 }
\ No newline at end of file
diff --git a/Indexes/Index.h b/Indexes/Index.h
index 24e822c..ac77ddb 100644
--- a/Indexes/Index.h
+++ b/Indexes/Index.h
@@ -17,6 +17,8 @@
 std::weak_ptrWritableDump dump;
 std::weak_ptrOffset fileHeaderOffset;
 
+int recentChanges;
+
 void AfterAdd();
 public:
 Index(std::weak_ptrWritableDump dump, std::weak_ptrOffset 
fileHeaderOffset, bool delaySave = false);
diff --git a/Indexes/Index.tpp b/Indexes/Index.tpp
index 294d755..7ba38d5 100644
--- a/Indexes/Index.tpp
+++ b/Indexes/Index.tpp
@@ -7,7 +7,7 @@
 
 templatetypename TKey, typename TValue
 IndexTKey, TValue::Index(std::weak_ptrWritableDump dump, 
std::weak_ptrOffset fileHeaderOffset, bool delaySave)
-: dump(dump), fileHeaderOffset(fileHeaderOffset)
+: dump(dump), fileHeaderOffset(fileHeaderOffset), recentChanges(0)
 {
 auto offset = fileHeaderOffset.lock();
 
@@ -63,6 +63,14 @@
 
 rootNodeUnsaved = false;
 }
+
+recentChanges++;
+
+if (recentChanges = 10)
+{
+rootNode-ClearCached();
+recentChanges = 0;
+}
 }
 
 templatetypename TKey, typename TValue
diff --git a/Indexes/IndexInnerNode.h b/Indexes/IndexInnerNode.h
index 3b039bc..5ccc1e1 100644
--- a/Indexes/IndexInnerNode.h
+++ b/Indexes/IndexInnerNode.h
@@ -41,6 +41,8 @@
 virtual std::uint32_t RealLength() override;
 virtual SplitResult Split() override;
 
+virtual void ClearCached() override;
+
 virtual std::unique_ptrIndexNodeIteratorTKey, TValue begin() override;
 virtual std::unique_ptrIndexNodeIteratorTKey, TValue end() override;
 };
diff --git a/Indexes/IndexInnerNode.tpp b/Indexes/IndexInnerNode.tpp
index b6607c1..0890b2a 100644
--- a/Indexes/IndexInnerNode.tpp
+++ b/Indexes/IndexInnerNode.tpp
@@ -152,6 +152,8 @@
 templatetypename TKey, typename TValue
 void IndexInnerNodeTKey, TValue::Write()
 {
+// TODO: don't do anything when there are no changes
+
 IndexNodeTKey, TValue::Write();
 
 for (auto cachedChild : cachedChildren)
@@ -217,6 +219,17 @@
 }
 
 templatetypename TKey, typename TValue
+void IndexInnerNodeTKey, TValue::ClearCached()
+{
+Write();
+
+for (unsigned i = 0; i  cachedChildren.size(); i++)
+{
+cachedChildren.at(i) = nullptr;
+}
+}
+
+templatetypename TKey, typename TValue
 std::unique_ptrIndexNodeIteratorTKey, TValue IndexInnerNodeTKey, 
TValue::begin()
 {
 return std::unique_ptrIndexNodeIteratorTKey, TValue(new 
IndexInnerIteratorTKey, TValue(this, true));
diff --git a/Indexes/IndexLeafNode.h b/Indexes/IndexLeafNode.h
index 1598488..ad069ac 100644
--- a/Indexes/IndexLeafNode.h
+++ b/Indexes/IndexLeafNode.h
@@ -32,6 +32,8 @@
 virtual std::uint32_t RealLength() override;
 virtual SplitResult Split() override;
 
+virtual void ClearCached() override;
+
 virtual unique_ptrIndexNodeIteratorTKey, TValue begin() 

[MediaWiki-commits] [Gerrit] Write page after its revisions - change (operations...incremental)

2013-09-11 Thread Petr Onderka (Code Review)
Petr Onderka has submitted this change and it was merged.

Change subject: Write page after its revisions
..


Write page after its revisions

This is necessary when creating big dumps from XML.
Without this, all revisions of a page have to be kept in memory,
including their texts.
A downside is that this will increase seeking when reading.

Change-Id: Ib6ea9fe67671df7a5686f6a4e441ab95ff6dba01
---
M DumpObjects/DumpPage.cpp
M DumpObjects/DumpPage.h
M DumpWriters/DumpWriter.cpp
M DumpWriters/DumpWriter.h
4 files changed, 36 insertions(+), 50 deletions(-)

Approvals:
  Petr Onderka: Verified; Looks good to me, approved



diff --git a/DumpObjects/DumpPage.cpp b/DumpObjects/DumpPage.cpp
index 1d074be..b5e695b 100644
--- a/DumpObjects/DumpPage.cpp
+++ b/DumpObjects/DumpPage.cpp
@@ -40,35 +40,28 @@
 void DumpPage::Write()
 {
 if (wasLoaded  originalPage == page)
-{
-if (diffWriter != nullptr)
-diffWriter-StartExistingPage(page.PageId);
-
 return;
-}
 
 DumpObject::Write();
 }
 
-void DumpPage::Write(DiffWriter *diffWriter)
+void DumpPage::WriteDiff(DiffWriter diffWriter)
 {
-this-diffWriter = diffWriter;
-Write();
-this-diffWriter = nullptr;
+if (wasLoaded)
+{
+if (originalPage == page)
+diffWriter.StartExistingPage(page.PageId);
+else
+diffWriter.StartExistingPage(originalPage, page);
+}
+else
+diffWriter.StartNewPage(page);
 }
 
 void DumpPage::WriteInternal()
 {
 WriteValue((uint8_t)DumpObjectKind::Page);
 WriteCore(*stream, page, true);
-
-if (diffWriter != nullptr)
-{
-if (wasLoaded)
-diffWriter-StartExistingPage(originalPage, page);
-else
-diffWriter-StartNewPage(page);
-}
 }
 
 void DumpPage::UpdateIndex(Offset offset, bool overwrite)
@@ -87,13 +80,13 @@
 }
 
 DumpPage::DumpPage(weak_ptrWritableDump dump, uint32_t pageId)
-: DumpObject(dump), page(), diffWriter()
+: DumpObject(dump), page()
 {
 Load(pageId);
 }
 
 DumpPage::DumpPage(weak_ptrWritableDump dump, Offset offset)
-: DumpObject(dump), page(), diffWriter()
+: DumpObject(dump), page()
 {
 auto dumpRef = dump.lock();
 
diff --git a/DumpObjects/DumpPage.h b/DumpObjects/DumpPage.h
index 4c230bf..3d1e16d 100644
--- a/DumpObjects/DumpPage.h
+++ b/DumpObjects/DumpPage.h
@@ -11,8 +11,6 @@
 Page originalPage;
 bool wasLoaded;
 
-DiffWriter *diffWriter;
-
 void Load(std::uint32_t pageId);
 static Page Read(std::shared_ptrWritableDump dump, Offset offset);
 protected:
@@ -25,7 +23,7 @@
 DumpPage(std::weak_ptrWritableDump dump, Offset offset);
 
 virtual void Write() override;
-void Write(DiffWriter *diffWriter);
+void WriteDiff(DiffWriter diffWriter);
 virtual std::uint32_t NewLength() override;
 
 static Page ReadCore(std::istream stream, bool includeRevisionIds);
diff --git a/DumpWriters/DumpWriter.cpp b/DumpWriters/DumpWriter.cpp
index 96cfa67..d1423fe 100644
--- a/DumpWriters/DumpWriter.cpp
+++ b/DumpWriters/DumpWriter.cpp
@@ -31,39 +31,38 @@
 oldPage = this-page-page;
 this-page-page = *page;
 unset(unvisitedPageIds, pageId);
+
+if (diffWriter != nullptr)
+this-page-WriteDiff(*diffWriter);
 }
 
 void DumpWriter::AddRevision(const std::shared_ptrconst Revision revision)
 {
 page-page.RevisionIds.insert(revision-RevisionId);
-revisions.push_back(revision);
+
+DumpRevision dumpRevision(dump, revision-RevisionId, false);
+dumpRevision.revision = *revision;
+
+if (diffWriter != nullptr)
+{
+bool isNew;
+std::uint8_t modelFormatId = dumpRevision.GetModelFormatId(isNew);
+
+if (isNew)
+diffWriter-NewModelFormat(modelFormatId, 
dumpRevision.revision.Model, dumpRevision.revision.Format);
+}
+
+bool newRevision = !contains(oldPage.RevisionIds, revision-RevisionId);
+
+if (newRevision)
+newRevisionIds.insert(revision-RevisionId);
+
+dumpRevision.Write(diffWriter.get(), newRevision);
 }
 
 void DumpWriter::EndPage()
 {
-page-Write(diffWriter.get());
-
-for (auto revision : revisions)
-{
-DumpRevision dumpRevision(dump, revision-RevisionId, false);
-dumpRevision.revision = *revision;
-
-if (diffWriter != nullptr)
-{
-bool isNew;
-std::uint8_t modelFormatId = dumpRevision.GetModelFormatId(isNew);
-
-if (isNew)
-diffWriter-NewModelFormat(modelFormatId, 
dumpRevision.revision.Model, dumpRevision.revision.Format);
-}
-
-bool newRevision = !contains(oldPage.RevisionIds, 
revision-RevisionId);
-
-if (newRevision)
-newRevisionIds.insert(revision-RevisionId);
-
-dumpRevision.Write(diffWriter.get(), newRevision);
-}
+page-Write();
 
 auto deletedRevisionIds = except(oldPage.RevisionIds, 

[MediaWiki-commits] [Gerrit] Don't save namespace as part of title - change (operations...incremental)

2013-09-11 Thread Petr Onderka (Code Review)
Petr Onderka has submitted this change and it was merged.

Change subject: Don't save namespace as part of title
..


Don't save namespace as part of title

Change-Id: I794c19db9e36d11d6d05e3bbd7f6f3fe26fb8b0a
---
M DumpWriters/ArticlesWriterWrapper.cpp
M DumpWriters/ArticlesWriterWrapper.h
M DumpWriters/CompositeWriter.cpp
M DumpWriters/CompositeWriter.h
M DumpWriters/DumpWriter.cpp
M DumpWriters/DumpWriter.h
M DumpWriters/IDumpWriter.h
M DumpWriters/WriterWrapper.cpp
M DumpWriters/WriterWrapper.h
M XmlInput/XmlPageProcessor.cpp
M XmlWriter.cpp
11 files changed, 43 insertions(+), 14 deletions(-)

Approvals:
  Petr Onderka: Verified; Looks good to me, approved



diff --git a/DumpWriters/ArticlesWriterWrapper.cpp 
b/DumpWriters/ArticlesWriterWrapper.cpp
index a17c385..4554784 100644
--- a/DumpWriters/ArticlesWriterWrapper.cpp
+++ b/DumpWriters/ArticlesWriterWrapper.cpp
@@ -3,12 +3,12 @@
 
 const std::int16_t UserNamespace = 2;
 
-void ArticlesWriterWrapper::StartPage(const std::shared_ptrconst Page page)
+void ArticlesWriterWrapper::StartPage(const std::shared_ptrconst Page page, 
bool titleWithNamespace)
 {
 pageInlcuded = page-Namespace % 2 == 0  page-Namespace != 
UserNamespace;
 
 if (pageInlcuded)
-wrapped-StartPage(page);
+wrapped-StartPage(page, titleWithNamespace);
 }
 
 void ArticlesWriterWrapper::AddRevision(const std::shared_ptrconst Revision 
revision)
diff --git a/DumpWriters/ArticlesWriterWrapper.h 
b/DumpWriters/ArticlesWriterWrapper.h
index 366f11e..fd7c99b 100644
--- a/DumpWriters/ArticlesWriterWrapper.h
+++ b/DumpWriters/ArticlesWriterWrapper.h
@@ -11,7 +11,7 @@
 : WriterWrapper(std::move(wrapped)), pageInlcuded(false)
 {}
 
-virtual void StartPage(const std::shared_ptrconst Page page) override;
+virtual void StartPage(const std::shared_ptrconst Page page, bool 
titleWithNamespace) override;
 virtual void AddRevision(const std::shared_ptrconst Revision revision) 
override;
 virtual void EndPage() override;
 virtual void SetDumpKind(DumpKind dumpKind) override;
diff --git a/DumpWriters/CompositeWriter.cpp b/DumpWriters/CompositeWriter.cpp
index c93dde4..ad75049 100644
--- a/DumpWriters/CompositeWriter.cpp
+++ b/DumpWriters/CompositeWriter.cpp
@@ -1,10 +1,10 @@
 #include CompositeWriter.h
 #include ../DumpException.h
 
-void CompositeWriter::StartPage(const std::shared_ptrconst Page page)
+void CompositeWriter::StartPage(const std::shared_ptrconst Page page, bool 
titleWithNamespace)
 {
 for (auto writer : writers)
-writer-StartPage(page);
+writer-StartPage(page, titleWithNamespace);
 }
 
 void CompositeWriter::AddRevision(const std::shared_ptrconst Revision 
revision)
diff --git a/DumpWriters/CompositeWriter.h b/DumpWriters/CompositeWriter.h
index 5352e80..8966f52 100644
--- a/DumpWriters/CompositeWriter.h
+++ b/DumpWriters/CompositeWriter.h
@@ -15,7 +15,7 @@
 : writers(std::move(writers)), getTextFunction(getTextFunction)
 {}
 
-virtual void StartPage(const std::shared_ptrconst Page page) override;
+virtual void StartPage(const std::shared_ptrconst Page page, bool 
titleWithNamespace) override;
 virtual void AddRevision(const std::shared_ptrconst Revision revision) 
override;
 virtual void EndPage() override;
 virtual void SetSiteInfo(const std::shared_ptrconst SiteInfo siteInfo) 
override;
diff --git a/DumpWriters/DumpWriter.cpp b/DumpWriters/DumpWriter.cpp
index d1423fe..6183c4c 100644
--- a/DumpWriters/DumpWriter.cpp
+++ b/DumpWriters/DumpWriter.cpp
@@ -5,6 +5,21 @@
 #include ../Indexes/Index.h
 #include ../format.h
 
+void DumpWriter::RemoveNamespace(Page page)
+{
+std::string namespapceName = 
dump-siteInfo-siteInfo.Namespaces.at(page.Namespace).second;
+
+if (namespapceName.empty())
+return;
+
+namespapceName.append(:);
+
+if (page.Title.substr(0, namespapceName.length()) != namespapceName)
+throw DumpException();
+
+page.Title.erase(0, namespapceName.length());
+}
+
 DumpWriter::DumpWriter(std::shared_ptrWritableDump dump, bool withText, 
std::unique_ptrDiffWriter diffWriter)
 : dump(dump), withText(withText), diffWriter(std::move(diffWriter))
 {
@@ -24,12 +39,17 @@
 diffWriter-SetSiteInfo(*siteInfo, dump-fileHeader.Kind);
 }
 
-void DumpWriter::StartPage(const std::shared_ptrconst Page page)
+void DumpWriter::StartPage(const std::shared_ptrconst Page page, bool 
titleWithNamespace)
 {
 std::uint32_t pageId = page-PageId;
+
 this-page = std::unique_ptrDumpPage(new DumpPage(dump, pageId));
 oldPage = this-page-page;
 this-page-page = *page;
+
+if (titleWithNamespace)
+RemoveNamespace(this-page-page);
+
 unset(unvisitedPageIds, pageId);
 
 if (diffWriter != nullptr)
diff --git a/DumpWriters/DumpWriter.h b/DumpWriters/DumpWriter.h
index 233f9ea..a1fee36 100644
--- a/DumpWriters/DumpWriter.h
+++ b/DumpWriters/DumpWriter.h
@@ 

[MediaWiki-commits] [Gerrit] Removed check for trailing zero in decompressed string - change (operations...incremental)

2013-09-11 Thread Petr Onderka (Code Review)
Petr Onderka has submitted this change and it was merged.

Change subject: Removed check for trailing zero in decompressed string
..


Removed check for trailing zero in decompressed string

With compressed groups, missing trailing zero is problematic.
On the other hand, added trailing zero is now okay.

Change-Id: Ia368b7ef2a198ee327029704e0a19f5b4ae7f84f
---
M SevenZip.cpp
1 file changed, 0 insertions(+), 5 deletions(-)

Approvals:
  Petr Onderka: Verified; Looks good to me, approved



diff --git a/SevenZip.cpp b/SevenZip.cpp
index 04a403f..b9fe86f 100644
--- a/SevenZip.cpp
+++ b/SevenZip.cpp
@@ -63,10 +63,5 @@
 
 std::string decompressedString = outputStdStream.str();
 
-// LZMA decompression seems to sometimes introduce trailing 0 byte
-// this takes care of that
-if (!decompressedString.empty()  decompressedString.back() == '\0')
-decompressedString.pop_back();
-
 return decompressedString;
 }
\ No newline at end of file

-- 
To view, visit https://gerrit.wikimedia.org/r/83788
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia368b7ef2a198ee327029704e0a19f5b4ae7f84f
Gerrit-PatchSet: 1
Gerrit-Project: operations/dumps/incremental
Gerrit-Branch: gsoc
Gerrit-Owner: Petr Onderka gsv...@gmail.com
Gerrit-Reviewer: Petr Onderka gsv...@gmail.com

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Fix comments early, so that check for no changes works right - change (operations...incremental)

2013-09-11 Thread Petr Onderka (Code Review)
Petr Onderka has submitted this change and it was merged.

Change subject: Fix comments early, so that check for no changes works right
..


Fix comments early, so that check for no changes works right

+ handle another case of overlong comment

Change-Id: Id6424a9e44ba1351396bb7ba994899c088742cb3
---
M DumpObjects/DumpTraits.h
M DumpWriters/DumpWriter.cpp
M DumpWriters/DumpWriter.h
3 files changed, 22 insertions(+), 11 deletions(-)

Approvals:
  Petr Onderka: Verified; Looks good to me, approved



diff --git a/DumpObjects/DumpTraits.h b/DumpObjects/DumpTraits.h
index ba7f3cf..45a686e 100644
--- a/DumpObjects/DumpTraits.h
+++ b/DumpObjects/DumpTraits.h
@@ -219,17 +219,7 @@
 
 if (length  255)
 {
-// invalid UTF-8 at the end of a string is represented as U+FFFD
-// this can get string over 255 bytes, so that character needs to 
be removed
-
-string replacementChar = \xEF\xBF\xBD; // UTF-8 encoded U+FFFD 
REPLACEMENT CHARACTER
-if (value.substr(value.length() - 3) == replacementChar)
-{
-string fixedValue = value.substr(0, value.length() - 3);
-Write(stream, fixedValue);
-}
-else
-throw DumpException();
+throw DumpException();
 }
 else
 {
diff --git a/DumpWriters/DumpWriter.cpp b/DumpWriters/DumpWriter.cpp
index 6183c4c..4d899e9 100644
--- a/DumpWriters/DumpWriter.cpp
+++ b/DumpWriters/DumpWriter.cpp
@@ -20,6 +20,24 @@
 page.Title.erase(0, namespapceName.length());
 }
 
+void DumpWriter::NormalizeComment(Revision revision)
+{
+std::string comment = revision.Comment;
+if (comment.length()  255)
+{
+// invalid UTF-8 at the end of a string is represented as U+FFFD
+// this can get string over 255 bytes, so that character needs to be 
removed
+
+std::string replacementChar = \xEF\xBF\xBD; // UTF-8 encoded U+FFFD 
REPLACEMENT CHARACTER
+if (comment.substr(comment.length() - 3) == replacementChar)
+comment.erase(comment.length() - 3, 3);
+else if (comment.substr(comment.length() - 6) == replacementChar + 
...)
+comment.pop_back();
+else
+throw DumpException();
+}
+}
+
 DumpWriter::DumpWriter(std::shared_ptrWritableDump dump, bool withText, 
std::unique_ptrDiffWriter diffWriter)
 : dump(dump), withText(withText), diffWriter(std::move(diffWriter))
 {
@@ -63,6 +81,8 @@
 DumpRevision dumpRevision(dump, revision-RevisionId, false);
 dumpRevision.revision = *revision;
 
+NormalizeComment(dumpRevision.revision);
+
 if (diffWriter != nullptr)
 {
 bool isNew;
diff --git a/DumpWriters/DumpWriter.h b/DumpWriters/DumpWriter.h
index a1fee36..2d99090 100644
--- a/DumpWriters/DumpWriter.h
+++ b/DumpWriters/DumpWriter.h
@@ -20,6 +20,7 @@
 bool withText;
 
 void RemoveNamespace(Page page);
+void NormalizeComment(Revision revision);
 public:
 DumpWriter(std::shared_ptrWritableDump dump, bool withText, 
std::unique_ptrDiffWriter diffWriter = nullptr);
 

-- 
To view, visit https://gerrit.wikimedia.org/r/83786
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Id6424a9e44ba1351396bb7ba994899c088742cb3
Gerrit-PatchSet: 1
Gerrit-Project: operations/dumps/incremental
Gerrit-Branch: gsoc
Gerrit-Owner: Petr Onderka gsv...@gmail.com
Gerrit-Reviewer: Petr Onderka gsv...@gmail.com

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Fixed compilation on Linux by moving constants to .cpp - change (operations...incremental)

2013-09-11 Thread Petr Onderka (Code Review)
Petr Onderka has submitted this change and it was merged.

Change subject: Fixed compilation on Linux by moving constants to .cpp
..


Fixed compilation on Linux by moving constants to .cpp

Change-Id: I76cec79142f3b2a85e36b8e61c8a780dc061dd66
---
M DumpObjects/FileHeader.cpp
M DumpObjects/FileHeader.h
2 files changed, 6 insertions(+), 4 deletions(-)

Approvals:
  Petr Onderka: Verified; Looks good to me, approved



diff --git a/DumpObjects/FileHeader.cpp b/DumpObjects/FileHeader.cpp
index d41a6e2..5973f26 100644
--- a/DumpObjects/FileHeader.cpp
+++ b/DumpObjects/FileHeader.cpp
@@ -4,6 +4,8 @@
 #include ../DumpException.h
 
 const std::string FileHeader::MagicNumber = MWID;
+const std::uint8_t FileHeader::FileFormatVersion = 1;
+const std::uint8_t FileHeader::FileDataVersion = 1;
 
 FileHeader::FileHeader(
 DumpKind kind,
@@ -84,4 +86,4 @@
 
 FileHeader::FileHeader(std::weak_ptrWritableDump dump)
 : DumpObject(dump), FileEnd(Length()), PageIdIndexRoot(0), 
RevisionIdIndexRoot(0), TextGroupIdIndexRoot(0), ModelFormatIndexRoot(0), 
FreeSpaceIndexRoot(0), SiteInfo(0)
-{}
\ No newline at end of file
+{}
diff --git a/DumpObjects/FileHeader.h b/DumpObjects/FileHeader.h
index 8edfc20..137c524 100644
--- a/DumpObjects/FileHeader.h
+++ b/DumpObjects/FileHeader.h
@@ -21,8 +21,8 @@
 void WriteInternal();
 public:
 static const std::string MagicNumber;
-static const std::uint8_t FileFormatVersion = 1;
-static const std::uint8_t FileDataVersion = 1;
+static const std::uint8_t FileFormatVersion;
+static const std::uint8_t FileDataVersion;
 
 static FileHeader Read(ReadableDump const dump);
 
@@ -40,4 +40,4 @@
 Offset SiteInfo;
 
 FileHeader(std::weak_ptrWritableDump dump = 
std::weak_ptrWritableDump());
-};
\ No newline at end of file
+};

-- 
To view, visit https://gerrit.wikimedia.org/r/83789
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I76cec79142f3b2a85e36b8e61c8a780dc061dd66
Gerrit-PatchSet: 1
Gerrit-Project: operations/dumps/incremental
Gerrit-Branch: gsoc
Gerrit-Owner: Petr Onderka gsv...@gmail.com
Gerrit-Reviewer: Petr Onderka gsv...@gmail.com

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Support multiple browsers when running cucumber tests locally - change (mediawiki...Wikibase)

2013-09-11 Thread Tobias Gritschacher (Code Review)
Tobias Gritschacher has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83790


Change subject: Support multiple browsers when running cucumber tests locally
..

Support multiple browsers when running cucumber tests locally

Change-Id: I9efe246daa69aa38a6c2212a3f5ff7ebbc01b9ec
---
M selenium_cuc/features/support/env.rb
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/90/83790/1

diff --git a/selenium_cuc/features/support/env.rb 
b/selenium_cuc/features/support/env.rb
index 65eba32..507db0d 100644
--- a/selenium_cuc/features/support/env.rb
+++ b/selenium_cuc/features/support/env.rb
@@ -71,8 +71,9 @@
 
 
 def local_browser(language)
+  browsers = YAML.load_file('config/browsers.yml')
   if ENV['BROWSER_LABEL']
-browser_label = ENV['BROWSER_LABEL'].to_sym
+browser_label = browsers[ENV['BROWSER_LABEL']]['name'].to_sym
   else
 browser_label = :firefox
   end

-- 
To view, visit https://gerrit.wikimedia.org/r/83790
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9efe246daa69aa38a6c2212a3f5ff7ebbc01b9ec
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Tobias Gritschacher tobias.gritschac...@wikimedia.de

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Support multiple browsers when running cucumber tests locally - change (mediawiki...Wikibase)

2013-09-11 Thread Tobias Gritschacher (Code Review)
Tobias Gritschacher has submitted this change and it was merged.

Change subject: Support multiple browsers when running cucumber tests locally
..


Support multiple browsers when running cucumber tests locally

Change-Id: I9efe246daa69aa38a6c2212a3f5ff7ebbc01b9ec
---
M selenium_cuc/features/support/env.rb
1 file changed, 2 insertions(+), 1 deletion(-)

Approvals:
  Tobias Gritschacher: Verified; Looks good to me, approved



diff --git a/selenium_cuc/features/support/env.rb 
b/selenium_cuc/features/support/env.rb
index 65eba32..507db0d 100644
--- a/selenium_cuc/features/support/env.rb
+++ b/selenium_cuc/features/support/env.rb
@@ -71,8 +71,9 @@
 
 
 def local_browser(language)
+  browsers = YAML.load_file('config/browsers.yml')
   if ENV['BROWSER_LABEL']
-browser_label = ENV['BROWSER_LABEL'].to_sym
+browser_label = browsers[ENV['BROWSER_LABEL']]['name'].to_sym
   else
 browser_label = :firefox
   end

-- 
To view, visit https://gerrit.wikimedia.org/r/83790
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I9efe246daa69aa38a6c2212a3f5ff7ebbc01b9ec
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Tobias Gritschacher tobias.gritschac...@wikimedia.de
Gerrit-Reviewer: Tobias Gritschacher tobias.gritschac...@wikimedia.de
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] update namespaces aliases, enable wikidata for wikivoyage (u... - change (pywikibot/compat)

2013-09-11 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: update namespaces aliases, enable wikidata for wikivoyage 
(update from core)
..


update namespaces aliases,
enable wikidata for wikivoyage (update from core)

Change-Id: I701623d4a4a3eab0ae730330b9c38dbea5572e7d
---
M families/wikivoyage_family.py
1 file changed, 7 insertions(+), 0 deletions(-)

Approvals:
  Ladsgroup: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/families/wikivoyage_family.py b/families/wikivoyage_family.py
index bb92917..c0a159e 100644
--- a/families/wikivoyage_family.py
+++ b/families/wikivoyage_family.py
@@ -20,6 +20,10 @@
for lang in self.languages_by_size])
 
 # Override defaults
+self.namespaces[2]['de'] = [u'Benutzer', u'BN', u'Benutzerin']
+self.namespaces[3]['de'] = [u'Benutzer Diskussion', u'BD', 
u'Benutzerin Diskussion']
+self.namespaces[12]['de'] = [u'Hilfe', u'H']
+self.namespaces[13]['de'] = [u'Hilfe Diskussion', u'HD']
 self.namespaces[2]['fr'] = [u'Utilisateur']
 self.namespaces[3]['fr'] = [u'Discussion utilisateur', u'Discussion 
Utilisateur']
 self.namespaces[2]['pl'] = [u'Użytkownik', u'Użytkowniczka']
@@ -118,3 +122,6 @@
 
 # Global bot allowed languages on 
http://meta.wikimedia.org/wiki/Bot_policy/Implementation#Current_implementation
 self.cross_allowed = ['es', 'ru', ]
+
+def shared_data_repository(self, code, transcluded=False):
+return ('wikidata', 'wikidata')

-- 
To view, visit https://gerrit.wikimedia.org/r/83362
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I701623d4a4a3eab0ae730330b9c38dbea5572e7d
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Xqt i...@gno.de
Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com
Gerrit-Reviewer: Legoktm legoktm.wikipe...@gmail.com
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] PEP8 changes from core - change (pywikibot/compat)

2013-09-11 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: PEP8 changes from core
..


PEP8 changes from core

Change-Id: I2e52ca27eea56a2fb42844e5bc928b95945f65e6
---
M families/anarchopedia_family.py
M families/battlestarwiki_family.py
M families/commons_family.py
M families/fon_family.py
M families/gentoo_family.py
M families/i18n_family.py
M families/incubator_family.py
M families/lockwiki_family.py
M families/lyricwiki_family.py
M families/mediawiki_family.py
M families/meta_family.py
M families/oldwikivoyage_family.py
M families/omegawiki_family.py
M families/osm_family.py
M families/southernapproach_family.py
M families/species_family.py
M families/strategy_family.py
M families/test_family.py
M families/vikidia_family.py
M families/wikia_family.py
M families/wikitech_family.py
M families/wowwiki_family.py
22 files changed, 33 insertions(+), 27 deletions(-)

Approvals:
  Ladsgroup: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/families/anarchopedia_family.py b/families/anarchopedia_family.py
index ee473f0..773efba 100644
--- a/families/anarchopedia_family.py
+++ b/families/anarchopedia_family.py
@@ -3,8 +3,8 @@
 
 import family
 
-# The Anarchopedia family
 
+# The Anarchopedia family
 class Family(family.Family):
 def __init__(self):
 family.Family.__init__(self)
diff --git a/families/battlestarwiki_family.py 
b/families/battlestarwiki_family.py
index 84ec33b..46f601d 100644
--- a/families/battlestarwiki_family.py
+++ b/families/battlestarwiki_family.py
@@ -3,9 +3,9 @@
 
 import family
 
+
 # The Battlestar Wiki family, a set of Battlestar wikis.
 # http://battlestarwiki.org/
-
 class Family(family.Family):
 def __init__(self):
 family.Family.__init__(self)
@@ -64,7 +64,7 @@
 
 alphabetic = ['de', 'en', 'es', 'fr', 'tr', 'zh']
 
-def hostname(self,code):
+def hostname(self, code):
 return '%s.battlestarwiki.org' % code
 
 def version(self, code):
diff --git a/families/commons_family.py b/families/commons_family.py
index f9fa08d..0730e7d 100644
--- a/families/commons_family.py
+++ b/families/commons_family.py
@@ -4,8 +4,8 @@
 
 import family
 
-# The Wikimedia Commons family
 
+# The Wikimedia Commons family
 class Family(family.WikimediaFamily):
 def __init__(self):
 super(Family, self).__init__()
diff --git a/families/fon_family.py b/families/fon_family.py
index 6d62cf7..6a8dec0 100644
--- a/families/fon_family.py
+++ b/families/fon_family.py
@@ -3,6 +3,7 @@
 
 import family
 
+
 # The official Beta Wiki.
 class Family(family.Family):
 
diff --git a/families/gentoo_family.py b/families/gentoo_family.py
index e9b4340..c35da2e 100644
--- a/families/gentoo_family.py
+++ b/families/gentoo_family.py
@@ -4,11 +4,11 @@
 
 __version__ = '$Id$'
 
+
 # An inofficial Gentoo wiki project.
 # Ask for permission at http://gentoo-wiki.com/Help:Bots before running a bot.
 # Be very careful, and set a long throttle: until we see it is good one edit
 # ever minute and one page fetch every 30 seconds, maybe a *bit* faster later.
-
 class Family(family.Family):
 
 def __init__(self):
@@ -20,11 +20,6 @@
 ]
 for l in self.languages_by_size:
 self.langs[l] = '%s.gentoo-wiki.com' % l
-
-# TODO: sort
-
-
-# he: also uses the default 'Media'
 
 self.namespaces[4] = {
 '_default': u'Gentoo Linux Wiki',
diff --git a/families/i18n_family.py b/families/i18n_family.py
index 7e07cc8..e4ca8eb 100644
--- a/families/i18n_family.py
+++ b/families/i18n_family.py
@@ -4,8 +4,8 @@
 
 import family
 
-# The Wikimedia i18n family
 
+# The Wikimedia i18n family
 class Family(family.Family):
 
 def __init__(self):
@@ -243,5 +243,6 @@
 self.namespaces[1253] = {
 '_default': [u'Vicuna talk'],
 }
+
 def version(self, code):
 return 1.21alpha
diff --git a/families/incubator_family.py b/families/incubator_family.py
index a8fb39a..511ea94 100644
--- a/families/incubator_family.py
+++ b/families/incubator_family.py
@@ -4,8 +4,8 @@
 
 import family
 
-# The Wikimedia Incubator family
 
+# The Wikimedia Incubator family
 class Family(family.WikimediaFamily):
 def __init__(self):
 super(Family, self).__init__()
diff --git a/families/lockwiki_family.py b/families/lockwiki_family.py
index 53a5fbf..fac9e2f 100644
--- a/families/lockwiki_family.py
+++ b/families/lockwiki_family.py
@@ -4,8 +4,8 @@
 
 import family
 
-# The locksmithwiki family
 
+# The locksmithwiki family
 class Family(family.Family):
 def __init__(self):
 family.Family.__init__(self)
diff --git a/families/lyricwiki_family.py b/families/lyricwiki_family.py
index cdb6279..7c87f40 100644
--- a/families/lyricwiki_family.py
+++ b/families/lyricwiki_family.py
@@ -3,18 +3,18 @@
 
 import family
 
+
 # The LyricWiki family
 
 # user_config.py:
 # usernames['lyricwiki']['en'] = 'user'
-
 class 

[MediaWiki-commits] [Gerrit] remove out-commented lines - change (pywikibot/compat)

2013-09-11 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: remove out-commented lines
..


remove out-commented lines

Change-Id: I260b9fd0e61744dfce0a4f75554e21bf940ae4c2
---
M .gitmodules
1 file changed, 0 insertions(+), 4 deletions(-)

Approvals:
  Ladsgroup: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/.gitmodules b/.gitmodules
index 069aa96..fe6f823 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,11 +1,7 @@
-#[submodule i18n]
-#path = scripts/i18n
-#url = https://gerrit.wikimedia.org/r/p/pywikibot/i18n.git
 [submodule i18n]
path = i18n
url = https://gerrit.wikimedia.org/r/p/pywikibot/i18n.git
branch = .
-
 [submodule externals/spelling]
path = externals/spelling
url = https://gerrit.wikimedia.org/r/p/pywikibot/spelling.git

-- 
To view, visit https://gerrit.wikimedia.org/r/83392
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I260b9fd0e61744dfce0a4f75554e21bf940ae4c2
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Xqt i...@gno.de
Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com
Gerrit-Reviewer: Legoktm legoktm.wikipe...@gmail.com
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] use lang nb instead of no in tests - change (mediawiki...Wikibase)

2013-09-11 Thread Addshore (Code Review)
Addshore has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83791


Change subject: use lang nb instead of no in tests
..

use lang nb instead of no in tests

It would seem the change has finally been made
so that entities cannot be created with elements
that have the lang code no.
Therefor we should stop using this language in
our api tests

Change-Id: I3459d6b543cd59a91b735f36ca6f325743000a8f
---
M repo/tests/phpunit/includes/api/EntityTestHelper.php
1 file changed, 8 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/91/83791/1

diff --git a/repo/tests/phpunit/includes/api/EntityTestHelper.php 
b/repo/tests/phpunit/includes/api/EntityTestHelper.php
index 90d9d25..c2aa31d 100644
--- a/repo/tests/phpunit/includes/api/EntityTestHelper.php
+++ b/repo/tests/phpunit/includes/api/EntityTestHelper.php
@@ -62,7 +62,7 @@
labels = array(
array( language = de, value = 
Berlin ),
array( language = en, value = 
Berlin ),
-   array( language = no, value = 
Berlin ),
+   array( language = nb, value = 
Berlin ),
array( language = nn, value = 
Berlin ),
),
aliases = array(
@@ -73,7 +73,7 @@
descriptions = array(
array( language = de, value = 
Bundeshauptstadt und Regierungssitz der Bundesrepublik Deutschland. ),
array( language = en, value = 
Capital city and a federated state of the Federal Republic of Germany. ),
-   array( language = no, value = 
Hovedsted og delstat og i Forbundsrepublikken Tyskland. ),
+   array( language = nb, value = 
Hovedsted og delstat og i Forbundsrepublikken Tyskland. ),
array( language = nn, value = 
Hovudstad og delstat i Forbundsrepublikken Tyskland. ),
),
)
@@ -90,7 +90,7 @@
labels = array(
array( language = de, value = 
London ),
array( language = en, value = 
London ),
-   array( language = no, value = 
London ),
+   array( language = nb, value = 
London ),
array( language = nn, value = 
London ),
),
aliases = array(
@@ -110,7 +110,7 @@
descriptions = array(
array( language = de, value = 
Hauptstadt Englands und des Vereinigten Königreiches. ),
array( language = en, value = 
Capital city of England and the United Kingdom. ),
-   array( language = no, value = 
Hovedsted i England og Storbritannia. ),
+   array( language = nb, value = 
Hovedsted i England og Storbritannia. ),
array( language = nn, value = 
Hovudstad i England og Storbritannia. ),
),
)
@@ -127,13 +127,13 @@
labels = array(
array( language = de, value = 
Oslo ),
array( language = en, value = 
Oslo ),
-   array( language = no, value = 
Oslo ),
+   array( language = nb, value = 
Oslo ),
array( language = nn, value = 
Oslo ),
),
aliases = array(
array(
-   array( language = no, 
value = Christiania ),
-   array( language = no, 
value = Kristiania ),
+   array( language = nb, 
value = Christiania ),
+   array( language = nb, 
value = Kristiania ),
),
array(
array( language = nn, 
value = Christiania ),
@@ -146,7 +146,7 @@
descriptions = array(
array( language = de, value = 
Hauptstadt der Norwegen. ),
array( language = en, value 

[MediaWiki-commits] [Gerrit] update namespace aliases - change (pywikibot/compat)

2013-09-11 Thread Xqt (Code Review)
Xqt has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83792


Change subject: update namespace aliases
..

update namespace aliases

Change-Id: If303107903afbcf853acd93b4cd47f000c3a001c
---
M family.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/compat 
refs/changes/92/83792/1

diff --git a/family.py b/family.py
index 1ccaaab..ef2a8ee 100644
--- a/family.py
+++ b/family.py
@@ -4639,7 +4639,7 @@
 'id': u'Pembicaraan Modul',
 'ilo': u'Modulo tungtungan',
 'it': u'Discussioni modulo',
-'ja': u'モジュール・トーク',
+'ja': [u'モジュール‐ノート', u'モジュール・トーク'],
 'jv': u'Pembicaraan Modul',
 'kl': u'Moduldiskussion',
 'ko': u'모듈토론',

-- 
To view, visit https://gerrit.wikimedia.org/r/83792
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If303107903afbcf853acd93b4cd47f000c3a001c
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Xqt i...@gno.de

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Add DataTypes extension for wikidata singlenode - change (operations/puppet)

2013-09-11 Thread Aude (Code Review)
Aude has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83793


Change subject: Add DataTypes extension for wikidata singlenode
..

Add DataTypes extension for wikidata singlenode

Change-Id: I46ec557a207a1f85393a2b0b4bba7c5fc909a9c8
---
M modules/wikidata_singlenode/manifests/init.pp
1 file changed, 6 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/93/83793/1

diff --git a/modules/wikidata_singlenode/manifests/init.pp 
b/modules/wikidata_singlenode/manifests/init.pp
index fbbcd7f..e6e871d 100644
--- a/modules/wikidata_singlenode/manifests/init.pp
+++ b/modules/wikidata_singlenode/manifests/init.pp
@@ -15,7 +15,7 @@
$ensure = latest,
$install_repo = true,
$install_client = true,
-   $role_requires = 
['$IP/extensions/Diff/Diff.php', 
'$IP/extensions/DataValues/DataValues.php', 
'$IP/extensions/WikibaseDataModel/WikibaseDataModel.php', 
'$IP/extensions/Wikibase/lib/WikibaseLib.php'],
+   $role_requires = 
['$IP/extensions/Diff/Diff.php', 
'$IP/extensions/DataValues/DataValues.php', 
'$IP/extensions/DataTypes/DataTypes.php', 
'$IP/extensions/WikibaseDataModel/WikibaseDataModel.php', 
'$IP/extensions/Wikibase/lib/WikibaseLib.php'],
$role_config_lines = [ 
'$wgShowExceptionDetails = true' ]) {
 
class { mediawiki_singlenode:
@@ -60,7 +60,7 @@
}
 
# get the dependencies for Wikibase extension after the successful 
installation of mediawiki core
-   mediawiki_singlenode::mw-extension { [ Diff, DataValues, 
WikibaseDataModel ]:
+   mediawiki_singlenode::mw-extension { [ Diff, DataValues, 
DataTypes, WikibaseDataModel ]:
require = [Git::Clone[mediawiki], Exec[mediawiki_setup]],
install_path = $install_path,
}
@@ -132,7 +132,7 @@
# get the extensions
# for repo get extensions Wikibase and ULS
mediawiki_singlenode::mw-extension { [ Wikibase, 
UniversalLanguageSelector, Babel, Translate, AbuseFilter ]:
-   require = [Git::Clone[mediawiki], 
Exec[mediawiki_setup], 
Exec[repo_move_mainpage],Mediawiki_singlenode::Mw-extension[Diff], 
Mediawiki_singlenode::Mw-extension[DataValues], 
Mediawiki_singlenode::Mw-extension[WikibaseDataModel]],
+   require = [Git::Clone[mediawiki], 
Exec[mediawiki_setup], 
Exec[repo_move_mainpage],Mediawiki_singlenode::Mw-extension[Diff], 
Mediawiki_singlenode::Mw-extension[DataValues], 
Mediawiki_singlenode::Mw-extension[DataTypes], 
Mediawiki_singlenode::Mw-extension[WikibaseDataModel]],
install_path = $install_path,
}
# put a repo specific settings file to $install_path (required 
by LocalSettings.php)
@@ -187,7 +187,7 @@
# get the extensions
# for client get extensions Wikibase and ParserFunctions 
(needed) and a bunch of other extensions that are on Wikipedias
mediawiki_singlenode::mw-extension { [ Wikibase, 
ParserFunctions, AbuseFilter, AntiBot, AntiSpoof, APC, 
ArticleFeedback, ArticleFeedbackv5, AssertEdit, Babel, CategoryTree, 
CharInsert, CheckUser, Cite, cldr, ClickTracking, CodeEditor, 
Collection, CustomData, Echo, EditPageTracking, EmailCapture, 
ExpandTemplates, FeaturedFeeds, FlaggedRevs, Gadgets, GlobalUsage, 
ImageMap, InputBox, Interwiki, LocalisationUpdate, MarkAsHelpful, 
Math, MobileFrontend, MwEmbedSupport, MWSearch, NewUserMessage, 
normal, OATHAuth, OpenSearchXml, Oversight, PagedTiffHandler, 
PageTriage, PdfHandler, Poem, PoolCounter, PostEdit, 
ReaderFeedback, RelatedArticles, RelatedSites, Renameuser, Scribunto, 
SecurePoll, SimpleAntiSpam, SwiftCloudFiles, SyntaxHighlight_GeSHi, 
TemplateSandbox, TitleKey, TorBlock, Translate, UserDailyContribs, 
UserMerge, Vector, WikiEditor, wikihiero, WikiLove, 
WikimediaMaintenance, WikimediaMessages ]:
-   require = [Git::Clone[mediawiki], 
Exec[mediawiki_setup], Mediawiki_singlenode::Mw-extension[Diff], 
Mediawiki_singlenode::Mw-extension[WikibaseDataModel], 
Mediawiki_singlenode::Mw-extension[DataValues]],
+   require = [Git::Clone[mediawiki], 
Exec[mediawiki_setup], Mediawiki_singlenode::Mw-extension[Diff], 
Mediawiki_singlenode::Mw-extension[WikibaseDataModel], 
Mediawiki_singlenode::Mw-extension[DataValues], 
Mediawiki_singlenode::Mw-extension[DataTypes]],
install_path = $install_path,
}
# put a client specific settings file to $install_path 
(required by LocalSettings.php)
@@ -258,8 +258,8 @@
   

[MediaWiki-commits] [Gerrit] Correct Text squids esams gmond port - change (operations/puppet)

2013-09-11 Thread Mark Bergsma (Code Review)
Mark Bergsma has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83794


Change subject: Correct Text squids esams gmond port
..

Correct Text squids esams gmond port

Change-Id: Ib3668336b892cc16fbeed85a2f4db5b00f49f35e
---
M manifests/ganglia.pp
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/94/83794/1

diff --git a/manifests/ganglia.pp b/manifests/ganglia.pp
index e3d1a55..22cffcf 100644
--- a/manifests/ganglia.pp
+++ b/manifests/ganglia.pp
@@ -325,7 +325,7 @@
 Search eqiad = search1001.eqiad.wmnet 
search1002.eqiad.wmnet,
 Decommissioned servers esams = 
knsq1.esams.wikimedia.org,
 Bits caches esams = 
hooft.esams.wikimedia.org:11670 cp3019.esams.wikimedia.org 
cp3020.esams.wikimedia.org,
-Text squids esams = 
hooft.esams.wikimedia.org:11669 amssq31.esams.wikimedia.org 
amssq32.esams.wikimedia.org,
+Text squids esams = 
hooft.esams.wikimedia.org:11656 amssq31.esams.wikimedia.org 
amssq32.esams.wikimedia.org,
 Upload squids esams = 
hooft.esams.wikimedia.org:11655 knsq16.esams.wikimedia.org 
knsq17.esams.wikimedia.org,
 LVS loadbalancers esams = 
hooft.esams.wikimedia.org:11651 amslvs1.esams.wikimedia.org 
amslvs2.esams.wikimedia.org,
 Miscellaneous esams = 
hooft.esams.wikimedia.org:11657,

-- 
To view, visit https://gerrit.wikimedia.org/r/83794
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib3668336b892cc16fbeed85a2f4db5b00f49f35e
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Mark Bergsma m...@wikimedia.org

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Correct Text squids esams gmond port - change (operations/puppet)

2013-09-11 Thread Mark Bergsma (Code Review)
Mark Bergsma has submitted this change and it was merged.

Change subject: Correct Text squids esams gmond port
..


Correct Text squids esams gmond port

Change-Id: Ib3668336b892cc16fbeed85a2f4db5b00f49f35e
---
M manifests/ganglia.pp
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Mark Bergsma: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/manifests/ganglia.pp b/manifests/ganglia.pp
index e3d1a55..22cffcf 100644
--- a/manifests/ganglia.pp
+++ b/manifests/ganglia.pp
@@ -325,7 +325,7 @@
 Search eqiad = search1001.eqiad.wmnet 
search1002.eqiad.wmnet,
 Decommissioned servers esams = 
knsq1.esams.wikimedia.org,
 Bits caches esams = 
hooft.esams.wikimedia.org:11670 cp3019.esams.wikimedia.org 
cp3020.esams.wikimedia.org,
-Text squids esams = 
hooft.esams.wikimedia.org:11669 amssq31.esams.wikimedia.org 
amssq32.esams.wikimedia.org,
+Text squids esams = 
hooft.esams.wikimedia.org:11656 amssq31.esams.wikimedia.org 
amssq32.esams.wikimedia.org,
 Upload squids esams = 
hooft.esams.wikimedia.org:11655 knsq16.esams.wikimedia.org 
knsq17.esams.wikimedia.org,
 LVS loadbalancers esams = 
hooft.esams.wikimedia.org:11651 amslvs1.esams.wikimedia.org 
amslvs2.esams.wikimedia.org,
 Miscellaneous esams = 
hooft.esams.wikimedia.org:11657,

-- 
To view, visit https://gerrit.wikimedia.org/r/83794
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib3668336b892cc16fbeed85a2f4db5b00f49f35e
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Mark Bergsma m...@wikimedia.org
Gerrit-Reviewer: Mark Bergsma m...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] update language_by_size - change (pywikibot/compat)

2013-09-11 Thread Xqt (Code Review)
Xqt has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83795


Change subject: update language_by_size
..

update language_by_size

Change-Id: Ie9eddc1ef58ab27cf437512e947fafd58de13188
---
M families/wikisource_family.py
M families/wikiversity_family.py
2 files changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/compat 
refs/changes/95/83795/1

diff --git a/families/wikisource_family.py b/families/wikisource_family.py
index c71261e..705f8ac 100644
--- a/families/wikisource_family.py
+++ b/families/wikisource_family.py
@@ -13,7 +13,7 @@
 self.languages_by_size = [
 'fr', 'en', 'de', 'ru', 'it', 'pl', 'zh', 'he', 'pt', 'es', 'sv',
 'ca', 'fa', 'cs', 'hu', 'ar', 'ko', 'sl', 'fi', 'ro', 'vi', 'te',
-'sa', 'el', 'sr', 'hr', 'bn', 'no', 'th', 'hy', 'nl', 'is', 'ml',
+'sa', 'el', 'sr', 'hr', 'bn', 'no', 'th', 'hy', 'is', 'nl', 'ml',
 'la', 'ja', 'vec', 'gu', 'tr', 'eo', 'br', 'uk', 'mk', 'yi', 'ta',
 'be', 'id', 'da', 'li', 'et', 'bg', 'as', 'mr', 'bs', 'sah', 'az',
 'gl', 'kn', 'lt', 'cy', 'sk', 'zh-min-nan', 'fo',
diff --git a/families/wikiversity_family.py b/families/wikiversity_family.py
index d0687fd..c0efd1e 100644
--- a/families/wikiversity_family.py
+++ b/families/wikiversity_family.py
@@ -11,8 +11,8 @@
 self.name = 'wikiversity'
 
 self.languages_by_size = [
-'en', 'fr', 'de', 'beta', 'cs', 'ru', 'it', 'pt', 'es', 'ar', 'sv',
-'fi', 'el', 'sl', 'ko', 'ja',
+'en', 'fr', 'de', 'beta', 'cs', 'ru', 'it', 'pt', 'es', 'ar', 'fi',
+'sv', 'el', 'sl', 'ko', 'ja',
 ]
 
 self.langs = dict([(lang, '%s.wikiversity.org' % lang)

-- 
To view, visit https://gerrit.wikimedia.org/r/83795
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie9eddc1ef58ab27cf437512e947fafd58de13188
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Xqt i...@gno.de

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] update language_by_size - change (pywikibot/compat)

2013-09-11 Thread Xqt (Code Review)
Xqt has submitted this change and it was merged.

Change subject: update language_by_size
..


update language_by_size

Change-Id: Ie9eddc1ef58ab27cf437512e947fafd58de13188
---
M families/wikisource_family.py
M families/wikiversity_family.py
2 files changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Xqt: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/families/wikisource_family.py b/families/wikisource_family.py
index c71261e..705f8ac 100644
--- a/families/wikisource_family.py
+++ b/families/wikisource_family.py
@@ -13,7 +13,7 @@
 self.languages_by_size = [
 'fr', 'en', 'de', 'ru', 'it', 'pl', 'zh', 'he', 'pt', 'es', 'sv',
 'ca', 'fa', 'cs', 'hu', 'ar', 'ko', 'sl', 'fi', 'ro', 'vi', 'te',
-'sa', 'el', 'sr', 'hr', 'bn', 'no', 'th', 'hy', 'nl', 'is', 'ml',
+'sa', 'el', 'sr', 'hr', 'bn', 'no', 'th', 'hy', 'is', 'nl', 'ml',
 'la', 'ja', 'vec', 'gu', 'tr', 'eo', 'br', 'uk', 'mk', 'yi', 'ta',
 'be', 'id', 'da', 'li', 'et', 'bg', 'as', 'mr', 'bs', 'sah', 'az',
 'gl', 'kn', 'lt', 'cy', 'sk', 'zh-min-nan', 'fo',
diff --git a/families/wikiversity_family.py b/families/wikiversity_family.py
index d0687fd..c0efd1e 100644
--- a/families/wikiversity_family.py
+++ b/families/wikiversity_family.py
@@ -11,8 +11,8 @@
 self.name = 'wikiversity'
 
 self.languages_by_size = [
-'en', 'fr', 'de', 'beta', 'cs', 'ru', 'it', 'pt', 'es', 'ar', 'sv',
-'fi', 'el', 'sl', 'ko', 'ja',
+'en', 'fr', 'de', 'beta', 'cs', 'ru', 'it', 'pt', 'es', 'ar', 'fi',
+'sv', 'el', 'sl', 'ko', 'ja',
 ]
 
 self.langs = dict([(lang, '%s.wikiversity.org' % lang)

-- 
To view, visit https://gerrit.wikimedia.org/r/83795
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie9eddc1ef58ab27cf437512e947fafd58de13188
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Xqt i...@gno.de
Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com
Gerrit-Reviewer: Legoktm legoktm.wikipe...@gmail.com
Gerrit-Reviewer: Xqt i...@gno.de
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] update language_by_size - change (pywikibot/compat)

2013-09-11 Thread Xqt (Code Review)
Xqt has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83796


Change subject: update language_by_size
..

update language_by_size

Change-Id: If5d4fa0e2ff882995810a7dafec0e698aee46413
---
M families/wikipedia_family.py
1 file changed, 9 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/compat 
refs/changes/96/83796/1

diff --git a/families/wikipedia_family.py b/families/wikipedia_family.py
index d962c57..80ed473 100644
--- a/families/wikipedia_family.py
+++ b/families/wikipedia_family.py
@@ -12,25 +12,25 @@
 
 self.languages_by_size = [
 'en', 'nl', 'de', 'sv', 'fr', 'it', 'es', 'ru', 'pl', 'ja', 'vi',
-'pt', 'war', 'ceb', 'zh', 'uk', 'ca', 'no', 'fi', 'fa', 'cs', 'ko',
+'war', 'ceb', 'pt', 'zh', 'uk', 'ca', 'no', 'fi', 'fa', 'cs', 'ko',
 'hu', 'ar', 'ro', 'ms', 'sr', 'tr', 'id', 'kk', 'sk', 'eo', 'da',
 'lt', 'eu', 'bg', 'he', 'hr', 'sl', 'uz', 'vo', 'et', 'hi', 'gl',
 'nn', 'simple', 'az', 'la', 'el', 'sh', 'oc', 'th', 'ka', 'hy',
 'mk', 'new', 'be', 'pms', 'tl', 'ta', 'ht', 'te', 'tt', 'be-x-old',
-'cy', 'lv', 'sq', 'bs', 'br', 'jv', 'mg', 'mr', 'lb', 'is', 'ml',
+'cy', 'lv', 'sq', 'bs', 'br', 'mg', 'jv', 'mr', 'lb', 'is', 'ml',
 'my', 'ba', 'yo', 'an', 'lmo', 'fy', 'af', 'bn', 'pnb', 'zh-yue',
-'sw', 'bpy', 'ur', 'io', 'ky', 'ne', 'scn', 'ga', 'gu', 'nds', 
'ku',
-'cv', 'ast', 'qu', 'tg', 'su', 'sco', 'als', 'bug', 'ia', 'nap',
-'kn', 'bat-smg', 'map-bms', 'wa', 'ckb', 'am', 'gd', 'hif',
+'sw', 'ur', 'bpy', 'io', 'ky', 'ne', 'scn', 'ga', 'gu', 'nds', 
'tg',
+'ku', 'cv', 'ast', 'qu', 'su', 'sco', 'als', 'bug', 'ia', 'nap',
+'kn', 'bat-smg', 'am', 'map-bms', 'wa', 'ckb', 'gd', 'hif',
 'zh-min-nan', 'arz', 'mzn', 'yi', 'mn', 'vec', 'sah', 'nah', 'sa',
 'roa-tara', 'os', 'si', 'bar', 'pam', 'hsb', 'se', 'pa', 'li', 
'mi',
 'fo', 'co', 'ilo', 'gan', 'bo', 'frr', 'glk', 'rue', 'bcl',
 'nds-nl', 'fiu-vro', 'mrj', 'tk', 'ps', 'vls', 'xmf', 'gv', 'min',
-'or', 'diq', 'kv', 'km', 'pag', 'ce', 'mhr', 'zea', 'dv', 'csb',
-'nrm', 'vep', 'rm', 'koi', 'hak', 'udm', 'lad', 'lij', 'wuu',
+'or', 'diq', 'kv', 'ce', 'km', 'pag', 'mhr', 'zea', 'dv', 'csb',
+'nrm', 'vep', 'rm', 'hak', 'koi', 'udm', 'lad', 'lij', 'wuu',
 'zh-classical', 'fur', 'sc', 'stq', 'mt', 'ug', 'ay', 'so', 'pi',
-'bh', 'ksh', 'nov', 'kw', 'gn', 'ang', 'pcd', 'nv', 'as', 'eml',
-'gag', 'ext', 'frp', 'ace', 'szl', 'ie', 'ln', 'pfl', 'krc', 'xal',
+'bh', 'ksh', 'nov', 'kw', 'gn', 'ang', 'pcd', 'nv', 'as', 'gag',
+'eml', 'ext', 'frp', 'ace', 'szl', 'ie', 'ln', 'pfl', 'krc', 'xal',
 'haw', 'pdc', 'rw', 'crh', 'lez', 'dsb', 'to', 'arc', 'kl', 'myv',
 'kab', 'sn', 'bjn', 'pap', 'tpi', 'lo', 'lbe', 'wo', 'mwl', 'jbo',
 'mdf', 'kbd', 'cbk-zam', 'av', 'srn', 'ty', 'kg', 'ab', 'tet',

-- 
To view, visit https://gerrit.wikimedia.org/r/83796
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If5d4fa0e2ff882995810a7dafec0e698aee46413
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Xqt i...@gno.de

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] update language_by_size - change (pywikibot/compat)

2013-09-11 Thread Xqt (Code Review)
Xqt has submitted this change and it was merged.

Change subject: update language_by_size
..


update language_by_size

Change-Id: If5d4fa0e2ff882995810a7dafec0e698aee46413
---
M families/wikipedia_family.py
1 file changed, 9 insertions(+), 9 deletions(-)

Approvals:
  Xqt: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/families/wikipedia_family.py b/families/wikipedia_family.py
index d962c57..80ed473 100644
--- a/families/wikipedia_family.py
+++ b/families/wikipedia_family.py
@@ -12,25 +12,25 @@
 
 self.languages_by_size = [
 'en', 'nl', 'de', 'sv', 'fr', 'it', 'es', 'ru', 'pl', 'ja', 'vi',
-'pt', 'war', 'ceb', 'zh', 'uk', 'ca', 'no', 'fi', 'fa', 'cs', 'ko',
+'war', 'ceb', 'pt', 'zh', 'uk', 'ca', 'no', 'fi', 'fa', 'cs', 'ko',
 'hu', 'ar', 'ro', 'ms', 'sr', 'tr', 'id', 'kk', 'sk', 'eo', 'da',
 'lt', 'eu', 'bg', 'he', 'hr', 'sl', 'uz', 'vo', 'et', 'hi', 'gl',
 'nn', 'simple', 'az', 'la', 'el', 'sh', 'oc', 'th', 'ka', 'hy',
 'mk', 'new', 'be', 'pms', 'tl', 'ta', 'ht', 'te', 'tt', 'be-x-old',
-'cy', 'lv', 'sq', 'bs', 'br', 'jv', 'mg', 'mr', 'lb', 'is', 'ml',
+'cy', 'lv', 'sq', 'bs', 'br', 'mg', 'jv', 'mr', 'lb', 'is', 'ml',
 'my', 'ba', 'yo', 'an', 'lmo', 'fy', 'af', 'bn', 'pnb', 'zh-yue',
-'sw', 'bpy', 'ur', 'io', 'ky', 'ne', 'scn', 'ga', 'gu', 'nds', 
'ku',
-'cv', 'ast', 'qu', 'tg', 'su', 'sco', 'als', 'bug', 'ia', 'nap',
-'kn', 'bat-smg', 'map-bms', 'wa', 'ckb', 'am', 'gd', 'hif',
+'sw', 'ur', 'bpy', 'io', 'ky', 'ne', 'scn', 'ga', 'gu', 'nds', 
'tg',
+'ku', 'cv', 'ast', 'qu', 'su', 'sco', 'als', 'bug', 'ia', 'nap',
+'kn', 'bat-smg', 'am', 'map-bms', 'wa', 'ckb', 'gd', 'hif',
 'zh-min-nan', 'arz', 'mzn', 'yi', 'mn', 'vec', 'sah', 'nah', 'sa',
 'roa-tara', 'os', 'si', 'bar', 'pam', 'hsb', 'se', 'pa', 'li', 
'mi',
 'fo', 'co', 'ilo', 'gan', 'bo', 'frr', 'glk', 'rue', 'bcl',
 'nds-nl', 'fiu-vro', 'mrj', 'tk', 'ps', 'vls', 'xmf', 'gv', 'min',
-'or', 'diq', 'kv', 'km', 'pag', 'ce', 'mhr', 'zea', 'dv', 'csb',
-'nrm', 'vep', 'rm', 'koi', 'hak', 'udm', 'lad', 'lij', 'wuu',
+'or', 'diq', 'kv', 'ce', 'km', 'pag', 'mhr', 'zea', 'dv', 'csb',
+'nrm', 'vep', 'rm', 'hak', 'koi', 'udm', 'lad', 'lij', 'wuu',
 'zh-classical', 'fur', 'sc', 'stq', 'mt', 'ug', 'ay', 'so', 'pi',
-'bh', 'ksh', 'nov', 'kw', 'gn', 'ang', 'pcd', 'nv', 'as', 'eml',
-'gag', 'ext', 'frp', 'ace', 'szl', 'ie', 'ln', 'pfl', 'krc', 'xal',
+'bh', 'ksh', 'nov', 'kw', 'gn', 'ang', 'pcd', 'nv', 'as', 'gag',
+'eml', 'ext', 'frp', 'ace', 'szl', 'ie', 'ln', 'pfl', 'krc', 'xal',
 'haw', 'pdc', 'rw', 'crh', 'lez', 'dsb', 'to', 'arc', 'kl', 'myv',
 'kab', 'sn', 'bjn', 'pap', 'tpi', 'lo', 'lbe', 'wo', 'mwl', 'jbo',
 'mdf', 'kbd', 'cbk-zam', 'av', 'srn', 'ty', 'kg', 'ab', 'tet',

-- 
To view, visit https://gerrit.wikimedia.org/r/83796
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: If5d4fa0e2ff882995810a7dafec0e698aee46413
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Xqt i...@gno.de
Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com
Gerrit-Reviewer: Legoktm legoktm.wikipe...@gmail.com
Gerrit-Reviewer: Xqt i...@gno.de
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] partly revert changes r11303 and fix Family.langs; update la... - change (pywikibot/compat)

2013-09-11 Thread Xqt (Code Review)
Xqt has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83797


Change subject: partly revert changes r11303 and fix Family.langs; update 
language_by_size
..

partly revert changes r11303 and fix Family.langs;
update language_by_size

Change-Id: Iabda9d5e3bd270d4bf7200e38ee958f48329b6b2
---
M families/wikitravel_family.py
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/compat 
refs/changes/97/83797/1

diff --git a/families/wikitravel_family.py b/families/wikitravel_family.py
index 579c494..fca5eb8 100644
--- a/families/wikitravel_family.py
+++ b/families/wikitravel_family.py
@@ -12,11 +12,11 @@
 
 self.languages_by_size = [
 'en', 'de', 'ja', 'it', 'nl', 'pt', 'fr', 'pl', 'es', 'fi', 'ru',
-'sv', 'hu', 'ca', 'ro', 'eo', 'hi', 'he',
+'sv', 'hu', 'ca', 'zh', 'ro', 'eo', 'ko', 'hi', 'ar', 'he',
 ]
 
-self.langs = dict([(lang, '%s.wikibooks.org' % lang)
-   for lang in self.languages_by_size])
+self.langs = dict([(lang, lang) for lang in self.languages_by_size])
+self.langs['wts'] = 'wts'
 
 self.namespaces[-2] = {
 '_default': u'Media',

-- 
To view, visit https://gerrit.wikimedia.org/r/83797
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iabda9d5e3bd270d4bf7200e38ee958f48329b6b2
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Xqt i...@gno.de

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] ignore logs folder and throttle.ctrl - change (pywikibot/compat)

2013-09-11 Thread Xqt (Code Review)
Xqt has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83798


Change subject: ignore logs folder and throttle.ctrl
..

ignore logs folder and throttle.ctrl

Change-Id: I83d5ca3d5a9b0c0f933f07e20d35278eb5958903
---
M .gitignore
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/compat 
refs/changes/98/83798/1

diff --git a/.gitignore b/.gitignore
index d2f1bed..945c8e2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
 *.bak
-*.log
 *.pyc
+logs*
 user-config.py
 user-fixes.py
+throttle.ctrl

-- 
To view, visit https://gerrit.wikimedia.org/r/83798
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I83d5ca3d5a9b0c0f933f07e20d35278eb5958903
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Xqt i...@gno.de

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Wikibase is now using Uppercase ID - change (pywikibot/compat)

2013-09-11 Thread Ladsgroup (Code Review)
Ladsgroup has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83799


Change subject: Wikibase is now using Uppercase ID
..

Wikibase is now using Uppercase ID

Change-Id: Ic11bd62afdc8a63310b3d86ec41a018ac2d3d406
---
M wikipedia.py
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/compat 
refs/changes/99/83799/1

diff --git a/wikipedia.py b/wikipedia.py
index c459615..aa48910 100644
--- a/wikipedia.py
+++ b/wikipedia.py
@@ -4309,7 +4309,7 @@
 except ValueError:
 search=self.searchentities(value, 'item',
lang=self._originSite.lang)
-value=int(search[0][id].replace(q, ))
+value=int(search[0][id].lower().replace(q, ))
 else:
 pass
 else:
@@ -4349,7 +4349,7 @@
 else:
 params = {
 'action': 'wbcreateclaim',
-'entity': self.title().replace(Q, q),
+'entity': self.title(),
 'snaktype': 'value',
 'property': p%d % propertyID,
 'value': value,
@@ -4400,7 +4400,7 @@
 ref[i], typesearch,
 lang=self._originSite.lang)
 value = int(
-search[0][id].replace(q,
+search[0][id].lower().replace(q,
 
).replace(p,
 
))
 else:
@@ -4480,7 +4480,7 @@
 except ValueError:
 search=self.searchentities(value, 'item',
lang=self._originSite.lang)
-value=int(search[0][id].replace(q, ))
+value=int(search[0][id].lower().replace(q, ))
 else:
 pass
 else:

-- 
To view, visit https://gerrit.wikimedia.org/r/83799
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic11bd62afdc8a63310b3d86ec41a018ac2d3d406
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Ladsgroup ladsgr...@gmail.com

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Split method in ByPropertyValueEntityFinder - change (mediawiki...WikibaseQuery)

2013-09-11 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Split method in ByPropertyValueEntityFinder
..


Split method in ByPropertyValueEntityFinder

Change-Id: I7e692d82deb145d0f2f998654f5b8413d581
---
M src/Wikibase/Query/ByPropertyValueEntityFinder.php
1 file changed, 30 insertions(+), 2 deletions(-)

Approvals:
  Addshore: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/src/Wikibase/Query/ByPropertyValueEntityFinder.php 
b/src/Wikibase/Query/ByPropertyValueEntityFinder.php
index caf0a5a..a553a0f 100644
--- a/src/Wikibase/Query/ByPropertyValueEntityFinder.php
+++ b/src/Wikibase/Query/ByPropertyValueEntityFinder.php
@@ -68,14 +68,39 @@
 * @throws InvalidArgumentException
 */
protected function findEntitiesGivenRawArguments( $propertyIdString, 
$valueString, $limit, $offset ) {
+   $this-assertIsValidLimit( $limit );
+   $this-assertIsValidOffset( $offset );
+
+   $value = $this-getValueFromString( $valueString );
+   $propertyId = $this-getPropertyIdFromString( $propertyIdString 
);
+
+   return $this-findByPropertyValue( $propertyId, $value, $limit, 
$offset );
+   }
+
+   protected function assertIsValidLimit( $limit ) {
if ( !is_string( $limit ) || !ctype_digit( $limit ) || 
(int)$limit  1 ) {
throw new InvalidArgumentException( '$limit needs to be 
a string representing a strictly positive integer' );
}
+   }
 
+   protected function assertIsValidOffset( $offset ) {
if ( !is_string( $offset ) || !ctype_digit( $offset ) ) {
throw new InvalidArgumentException( '$offset needs to 
be a string representing a positive integer' );
}
+   }
 
+   protected function getValueFromString( $valueString ) {
+   $valueSerialization = $this-getValueSerialization( 
$valueString );
+
+   try {
+   return $this-dvFactory-newFromArray( 
$valueSerialization );
+   }
+   catch ( RuntimeException $ex ) {
+   throw new InvalidArgumentException( $ex-getMessage(), 
0, $ex );
+   }
+   }
+
+   protected function getValueSerialization( $valueString ) {
if ( !is_string( $valueString ) ) {
throw new InvalidArgumentException( '$valueString needs 
to be a string serialization of a DataValue' );
}
@@ -86,9 +111,12 @@
throw new InvalidArgumentException( 'The provided value 
needs to be a serialization of a DataValue' );
}
 
+   return $valueSerialization;
+   }
+
+   protected function getPropertyIdFromString( $propertyIdString ) {
try {
$propertyId = $this-idParser-parse( $propertyIdString 
);
-   $value = $this-dvFactory-newFromArray( 
$valueSerialization );
}
catch ( RuntimeException $ex ) {
throw new InvalidArgumentException( $ex-getMessage(), 
0, $ex );
@@ -98,7 +126,7 @@
throw new InvalidArgumentException( 'The provided 
EntityId needs to be a PropertyId' );
}
 
-   return $this-findByPropertyValue( $propertyId, $value, $limit, 
$offset );
+   return $propertyId;
}
 
/**

-- 
To view, visit https://gerrit.wikimedia.org/r/83800
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7e692d82deb145d0f2f998654f5b8413d581
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseQuery
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com
Gerrit-Reviewer: Addshore addshorew...@gmail.com
Gerrit-Reviewer: Daniel Werner daniel.wer...@wikimedia.de
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Split method in ByPropertyValueEntityFinder - change (mediawiki...WikibaseQuery)

2013-09-11 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83800


Change subject: Split method in ByPropertyValueEntityFinder
..

Split method in ByPropertyValueEntityFinder

Change-Id: I7e692d82deb145d0f2f998654f5b8413d581
---
M src/Wikibase/Query/ByPropertyValueEntityFinder.php
1 file changed, 30 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQuery 
refs/changes/00/83800/1

diff --git a/src/Wikibase/Query/ByPropertyValueEntityFinder.php 
b/src/Wikibase/Query/ByPropertyValueEntityFinder.php
index caf0a5a..a553a0f 100644
--- a/src/Wikibase/Query/ByPropertyValueEntityFinder.php
+++ b/src/Wikibase/Query/ByPropertyValueEntityFinder.php
@@ -68,14 +68,39 @@
 * @throws InvalidArgumentException
 */
protected function findEntitiesGivenRawArguments( $propertyIdString, 
$valueString, $limit, $offset ) {
+   $this-assertIsValidLimit( $limit );
+   $this-assertIsValidOffset( $offset );
+
+   $value = $this-getValueFromString( $valueString );
+   $propertyId = $this-getPropertyIdFromString( $propertyIdString 
);
+
+   return $this-findByPropertyValue( $propertyId, $value, $limit, 
$offset );
+   }
+
+   protected function assertIsValidLimit( $limit ) {
if ( !is_string( $limit ) || !ctype_digit( $limit ) || 
(int)$limit  1 ) {
throw new InvalidArgumentException( '$limit needs to be 
a string representing a strictly positive integer' );
}
+   }
 
+   protected function assertIsValidOffset( $offset ) {
if ( !is_string( $offset ) || !ctype_digit( $offset ) ) {
throw new InvalidArgumentException( '$offset needs to 
be a string representing a positive integer' );
}
+   }
 
+   protected function getValueFromString( $valueString ) {
+   $valueSerialization = $this-getValueSerialization( 
$valueString );
+
+   try {
+   return $this-dvFactory-newFromArray( 
$valueSerialization );
+   }
+   catch ( RuntimeException $ex ) {
+   throw new InvalidArgumentException( $ex-getMessage(), 
0, $ex );
+   }
+   }
+
+   protected function getValueSerialization( $valueString ) {
if ( !is_string( $valueString ) ) {
throw new InvalidArgumentException( '$valueString needs 
to be a string serialization of a DataValue' );
}
@@ -86,9 +111,12 @@
throw new InvalidArgumentException( 'The provided value 
needs to be a serialization of a DataValue' );
}
 
+   return $valueSerialization;
+   }
+
+   protected function getPropertyIdFromString( $propertyIdString ) {
try {
$propertyId = $this-idParser-parse( $propertyIdString 
);
-   $value = $this-dvFactory-newFromArray( 
$valueSerialization );
}
catch ( RuntimeException $ex ) {
throw new InvalidArgumentException( $ex-getMessage(), 
0, $ex );
@@ -98,7 +126,7 @@
throw new InvalidArgumentException( 'The provided 
EntityId needs to be a PropertyId' );
}
 
-   return $this-findByPropertyValue( $propertyId, $value, $limit, 
$offset );
+   return $propertyId;
}
 
/**

-- 
To view, visit https://gerrit.wikimedia.org/r/83800
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7e692d82deb145d0f2f998654f5b8413d581
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseQuery
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Add Scrutinizer config - change (mediawiki...WikibaseDataModel)

2013-09-11 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83802


Change subject: Add Scrutinizer config
..

Add Scrutinizer config

Change-Id: I484adc31ddcc3dbac225d8c1ae0b445f6f9a8ff5
---
M .gitignore
A .scrutinizer.yml
2 files changed, 16 insertions(+), 6 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseDataModel 
refs/changes/02/83802/1

diff --git a/.gitignore b/.gitignore
index 37ef231..9460cc3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,15 +1,10 @@
-.*
 *~
 *.kate-swp
 
 composer.phar
 composer.lock
 
-!.gitignore
-!.gitreview
-
-!.travis.yml
-!.coveralls.yml
+!.*
 
 vendor/
 build/
\ No newline at end of file
diff --git a/.scrutinizer.yml b/.scrutinizer.yml
new file mode 100644
index 000..0fb9109
--- /dev/null
+++ b/.scrutinizer.yml
@@ -0,0 +1,15 @@
+inherit: true
+
+before_commands:
+  - composer install --prefer-source
+
+tools:
+php_code_coverage: true
+php_code_sniffer: true
+php_cpd: true
+php_cs_fixer: true
+php_loc: true
+php_mess_detector: true
+php_pdepend: true
+php_analyzer: true
+sensiolabs_security_checker: true
\ No newline at end of file

-- 
To view, visit https://gerrit.wikimedia.org/r/83802
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I484adc31ddcc3dbac225d8c1ae0b445f6f9a8ff5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseDataModel
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Add Scrutinizer config - change (mediawiki...WikibaseDataModel)

2013-09-11 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has submitted this change and it was merged.

Change subject: Add Scrutinizer config
..


Add Scrutinizer config

Change-Id: I484adc31ddcc3dbac225d8c1ae0b445f6f9a8ff5
---
M .gitignore
A .scrutinizer.yml
2 files changed, 16 insertions(+), 6 deletions(-)

Approvals:
  Jeroen De Dauw: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/.gitignore b/.gitignore
index 37ef231..9460cc3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,15 +1,10 @@
-.*
 *~
 *.kate-swp
 
 composer.phar
 composer.lock
 
-!.gitignore
-!.gitreview
-
-!.travis.yml
-!.coveralls.yml
+!.*
 
 vendor/
 build/
\ No newline at end of file
diff --git a/.scrutinizer.yml b/.scrutinizer.yml
new file mode 100644
index 000..0fb9109
--- /dev/null
+++ b/.scrutinizer.yml
@@ -0,0 +1,15 @@
+inherit: true
+
+before_commands:
+  - composer install --prefer-source
+
+tools:
+php_code_coverage: true
+php_code_sniffer: true
+php_cpd: true
+php_cs_fixer: true
+php_loc: true
+php_mess_detector: true
+php_pdepend: true
+php_analyzer: true
+sensiolabs_security_checker: true
\ No newline at end of file

-- 
To view, visit https://gerrit.wikimedia.org/r/83802
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I484adc31ddcc3dbac225d8c1ae0b445f6f9a8ff5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseDataModel
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com
Gerrit-Reviewer: Jeroen De Dauw jeroended...@gmail.com
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Remove system tests from phpunit config as this group cannot... - change (mediawiki...WikibaseQuery)

2013-09-11 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has submitted this change and it was merged.

Change subject: Remove system tests from phpunit config as this group cannot be 
run via the normal runner
..


Remove system tests from phpunit config as this group cannot be run via the 
normal runner

Change-Id: I3bab2defb75e5dd07c340f1aad23273afd4ecbdd
---
M Tests/bootstrap.php
M phpunit.xml.dist
2 files changed, 0 insertions(+), 4 deletions(-)

Approvals:
  Jeroen De Dauw: Verified; Looks good to me, approved



diff --git a/Tests/bootstrap.php b/Tests/bootstrap.php
index 3267097..4ae39bf 100644
--- a/Tests/bootstrap.php
+++ b/Tests/bootstrap.php
@@ -19,4 +19,3 @@
 require_once( __DIR__ . '/../../WikibaseDataModel/tests/testLoader.php' );
 
 require_once( __DIR__ . '/../WikibaseQuery.php' );
-
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
index 8033e12..a6f601d 100644
--- a/phpunit.xml.dist
+++ b/phpunit.xml.dist
@@ -19,9 +19,6 @@
 testsuite name=WikibaseQueryIntegration
 directoryTests/Integration/directory
 /testsuite
-testsuite name=WikibaseQuerySystem
-directoryTests/System/directory
-/testsuite
 /testsuites
 
 filter

-- 
To view, visit https://gerrit.wikimedia.org/r/83408
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I3bab2defb75e5dd07c340f1aad23273afd4ecbdd
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/WikibaseQuery
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw jeroended...@gmail.com
Gerrit-Reviewer: Addshore addshorew...@gmail.com
Gerrit-Reviewer: Jeroen De Dauw jeroended...@gmail.com
Gerrit-Reviewer: Tobias Gritschacher tobias.gritschac...@wikimedia.de
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] use lang nb instead of no in tests - change (mediawiki...Wikibase)

2013-09-11 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has submitted this change and it was merged.

Change subject: use lang nb instead of no in tests
..


use lang nb instead of no in tests

It would seem the change has finally been made
so that entities cannot be created with elements
that have the lang code no.
Therefor we should stop using this language in
our api tests

Change-Id: I3459d6b543cd59a91b735f36ca6f325743000a8f
---
M repo/tests/phpunit/includes/api/EntityTestHelper.php
1 file changed, 8 insertions(+), 8 deletions(-)

Approvals:
  Jeroen De Dauw: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/repo/tests/phpunit/includes/api/EntityTestHelper.php 
b/repo/tests/phpunit/includes/api/EntityTestHelper.php
index 90d9d25..c2aa31d 100644
--- a/repo/tests/phpunit/includes/api/EntityTestHelper.php
+++ b/repo/tests/phpunit/includes/api/EntityTestHelper.php
@@ -62,7 +62,7 @@
labels = array(
array( language = de, value = 
Berlin ),
array( language = en, value = 
Berlin ),
-   array( language = no, value = 
Berlin ),
+   array( language = nb, value = 
Berlin ),
array( language = nn, value = 
Berlin ),
),
aliases = array(
@@ -73,7 +73,7 @@
descriptions = array(
array( language = de, value = 
Bundeshauptstadt und Regierungssitz der Bundesrepublik Deutschland. ),
array( language = en, value = 
Capital city and a federated state of the Federal Republic of Germany. ),
-   array( language = no, value = 
Hovedsted og delstat og i Forbundsrepublikken Tyskland. ),
+   array( language = nb, value = 
Hovedsted og delstat og i Forbundsrepublikken Tyskland. ),
array( language = nn, value = 
Hovudstad og delstat i Forbundsrepublikken Tyskland. ),
),
)
@@ -90,7 +90,7 @@
labels = array(
array( language = de, value = 
London ),
array( language = en, value = 
London ),
-   array( language = no, value = 
London ),
+   array( language = nb, value = 
London ),
array( language = nn, value = 
London ),
),
aliases = array(
@@ -110,7 +110,7 @@
descriptions = array(
array( language = de, value = 
Hauptstadt Englands und des Vereinigten Königreiches. ),
array( language = en, value = 
Capital city of England and the United Kingdom. ),
-   array( language = no, value = 
Hovedsted i England og Storbritannia. ),
+   array( language = nb, value = 
Hovedsted i England og Storbritannia. ),
array( language = nn, value = 
Hovudstad i England og Storbritannia. ),
),
)
@@ -127,13 +127,13 @@
labels = array(
array( language = de, value = 
Oslo ),
array( language = en, value = 
Oslo ),
-   array( language = no, value = 
Oslo ),
+   array( language = nb, value = 
Oslo ),
array( language = nn, value = 
Oslo ),
),
aliases = array(
array(
-   array( language = no, 
value = Christiania ),
-   array( language = no, 
value = Kristiania ),
+   array( language = nb, 
value = Christiania ),
+   array( language = nb, 
value = Kristiania ),
),
array(
array( language = nn, 
value = Christiania ),
@@ -146,7 +146,7 @@
descriptions = array(
array( language = de, value = 
Hauptstadt der Norwegen. ),
array( language = en, value = 
Capital city in Norway. ),
-  

[MediaWiki-commits] [Gerrit] Allowing for config data when instantiating dialogs - change (mediawiki...VisualEditor)

2013-09-11 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83805


Change subject: Allowing for config data when instantiating dialogs
..

Allowing for config data when instantiating dialogs

Currently, WindowSet open method uses the Window factory to call up
the instantiation of a new dialog or inspector class. This commit will
also allow sending further config options to these classes if needed.

Specifically, this will also allow the use of ve.ui.Context.js for
block inspectors that are not dependent on current selection or current
location of the cursor.

It will also let us generalize the dialog/inspector window instantiations
by adding in any needed config settings on call.

Change-Id: If14384d74ab91ef01b1c7641ff84f327f2a12112
---
M modules/ve/ui/ve.ui.Context.js
M modules/ve/ui/ve.ui.WindowSet.js
2 files changed, 6 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/05/83805/1

diff --git a/modules/ve/ui/ve.ui.Context.js b/modules/ve/ui/ve.ui.Context.js
index 0a0825b..cfcb475 100644
--- a/modules/ve/ui/ve.ui.Context.js
+++ b/modules/ve/ui/ve.ui.Context.js
@@ -386,11 +386,12 @@
  *
  * @method
  * @param {string} name Symbolic name of inspector
+ * @param {Object} [config] Config options to be sent to the inspector class 
constructor
  * @chainable
  */
-ve.ui.Context.prototype.openInspector = function ( name ) {
+ve.ui.Context.prototype.openInspector = function ( name, config ) {
if ( !this.inspectors.currentWindow ) {
-   this.inspectors.open( name );
+   this.inspectors.open( name, config );
}
return this;
 };
diff --git a/modules/ve/ui/ve.ui.WindowSet.js b/modules/ve/ui/ve.ui.WindowSet.js
index 1c23fc7..769dd29 100644
--- a/modules/ve/ui/ve.ui.WindowSet.js
+++ b/modules/ve/ui/ve.ui.WindowSet.js
@@ -113,9 +113,10 @@
  *
  * @method
  * @param {string} name Symbolic name of window
+ * @param {Object} [config] Config options to be sent to the window class 
constructor
  * @chainable
  */
-ve.ui.WindowSet.prototype.open = function ( name ) {
+ve.ui.WindowSet.prototype.open = function ( name, config ) {
var win;
 
if ( !this.factory.lookup( name ) ) {
@@ -125,7 +126,7 @@
throw new Error( 'Cannot open another window while another one 
is active' );
}
if ( !( name in this.windows ) ) {
-   win = this.windows[name] = this.factory.create( name, 
this.surface );
+   win = this.windows[name] = this.factory.create( name, 
this.surface, config );
win.connect( this, {
'setup': ['onWindowSetup', win],
'open': ['onWindowOpen', win],

-- 
To view, visit https://gerrit.wikimedia.org/r/83805
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If14384d74ab91ef01b1c7641ff84f327f2a12112
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo mor...@gmail.com

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] update username location for running in Jenkins etc. - change (mediawiki...CirrusSearch)

2013-09-11 Thread Manybubbles (Code Review)
Manybubbles has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83806


Change subject: update username location for running in Jenkins etc.
..

update username location for running in Jenkins etc.

Change-Id: I71913e9b1f94cde4672a8bfe37b8419813339cf8
---
M tests/browser/features/support/env.rb
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch 
refs/changes/06/83806/1

diff --git a/tests/browser/features/support/env.rb 
b/tests/browser/features/support/env.rb
index d91ed29..4b4feb1 100644
--- a/tests/browser/features/support/env.rb
+++ b/tests/browser/features/support/env.rb
@@ -98,7 +98,7 @@
 config = YAML.load_file('config/config.yml')
 
 secret = YAML.load_file(#{secret_yml_location})
-mediawiki_username = secret['mediawiki_username']
+mediawiki_username = secret['mediawiki_username'] || 
config['mediawiki_username']
 mediawiki_password = secret['mediawiki_password']
 
 if ENV['ENVIRONMENT'] == 'cloudbees'

-- 
To view, visit https://gerrit.wikimedia.org/r/83806
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I71913e9b1f94cde4672a8bfe37b8419813339cf8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: Manybubbles never...@wikimedia.org
Gerrit-Reviewer: Cmcmahon cmcma...@wikimedia.org

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] update username location for running in Jenkins etc. - change (mediawiki...CirrusSearch)

2013-09-11 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: update username location for running in Jenkins etc.
..


update username location for running in Jenkins etc.

Change-Id: I71913e9b1f94cde4672a8bfe37b8419813339cf8
---
M tests/browser/features/support/env.rb
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Manybubbles: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/browser/features/support/env.rb 
b/tests/browser/features/support/env.rb
index d91ed29..4b4feb1 100644
--- a/tests/browser/features/support/env.rb
+++ b/tests/browser/features/support/env.rb
@@ -98,7 +98,7 @@
 config = YAML.load_file('config/config.yml')
 
 secret = YAML.load_file(#{secret_yml_location})
-mediawiki_username = secret['mediawiki_username']
+mediawiki_username = secret['mediawiki_username'] || 
config['mediawiki_username']
 mediawiki_password = secret['mediawiki_password']
 
 if ENV['ENVIRONMENT'] == 'cloudbees'

-- 
To view, visit https://gerrit.wikimedia.org/r/83806
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I71913e9b1f94cde4672a8bfe37b8419813339cf8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: Manybubbles never...@wikimedia.org
Gerrit-Reviewer: Cmcmahon cmcma...@wikimedia.org
Gerrit-Reviewer: Manybubbles never...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Implement morelike: for more like this. - change (mediawiki...CirrusSearch)

2013-09-11 Thread Manybubbles (Code Review)
Manybubbles has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83807


Change subject: Implement morelike: for more like this.
..

Implement morelike: for more like this.

Also some (more) code reorganization that makes sense in light of the
new search type.

Bug: 53474

Change-Id: Ib1e27dfcf980efa52414385c0b9264c1392bd2a1
---
M CirrusSearch.body.php
M CirrusSearch.php
A CirrusSearchPrefixSearchHook.php
M CirrusSearchSearcher.php
4 files changed, 271 insertions(+), 144 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch 
refs/changes/07/83807/1

diff --git a/CirrusSearch.body.php b/CirrusSearch.body.php
index 0771f8a..93d6b1e 100644
--- a/CirrusSearch.body.php
+++ b/CirrusSearch.body.php
@@ -19,13 +19,28 @@
  * http://www.gnu.org/copyleft/gpl.html
  */
 class CirrusSearch extends SearchEngine {
+   const MORE_LIKE_THIS_PREFIX = 'morelike:';
+
/**
 * @param string $term
 * @return CirrusSearchResultSet|null|SearchResultSet|Status
 */
public function searchText( $term ) {
-   return CirrusSearchSearcher::searchText( $term, $this-offset, 
$this-limit,
-   $this-namespaces, $this-showRedirects );
+   $searcher = new CirrusSearchSearcher( $this-offset, 
$this-limit, $this-namespaces );
+
+   // Ignore leading ~ because it is used to force displaying 
search results but not to effect them
+   if ( substr( $term, 0, 1 ) === '~' )  {
+   $term = substr( $term, 1 );
+   }
+   if ( substr( $term, 0, strlen( self::MORE_LIKE_THIS_PREFIX ) ) 
=== self::MORE_LIKE_THIS_PREFIX ) {
+   $term = substr( $term, strlen( 
self::MORE_LIKE_THIS_PREFIX ) );
+   $title = Title::newFromText( $term );
+   if ( !$title ) {
+   return null;
+   }
+   return $searcher-moreLikeThisArticle( 
$title-getArticleID() );
+   }
+   return $searcher-searchText( $term, $this-showRedirects );
}
 
public function update( $id, $title, $text ) {
diff --git a/CirrusSearch.php b/CirrusSearch.php
index 6ed23b9..ffac738 100644
--- a/CirrusSearch.php
+++ b/CirrusSearch.php
@@ -77,6 +77,7 @@
 $wgAutoloadClasses['CirrusSearchAnalysisConfigBuilder'] = $dir . 
'CirrusSearchAnalysisConfigBuilder.php';
 $wgAutoloadClasses['CirrusSearchConnection'] = $dir . 
'CirrusSearchConnection.php';
 $wgAutoloadClasses['CirrusSearchMappingConfigBuilder'] = $dir . 
'CirrusSearchMappingConfigBuilder.php';
+$wgAutoloadClasses['CirrusSearchPrefixSearchHook'] = $dir . 
'CirrusSearchPrefixSearchHook.php';
 $wgAutoloadClasses['CirrusSearchSearcher'] = $dir . 'CirrusSearchSearcher.php';
 $wgAutoloadClasses['CirrusSearchTextSanitizer'] = $dir . 
'CirrusSearchTextSanitizer.php';
 $wgAutoloadClasses['CirrusSearchUpdater'] = $dir . 'CirrusSearchUpdater.php';
@@ -117,6 +118,8 @@
 $wgAutoloadClasses['Elastica\Filter\AbstractFilter'] = $elasticaDir . 
'Filter/AbstractFilter.php';
 $wgAutoloadClasses['Elastica\Filter\AbstractMulti'] = $elasticaDir . 
'Filter/AbstractMulti.php';
 $wgAutoloadClasses['Elastica\Filter\Bool'] = $elasticaDir . 'Filter/Bool.php';
+$wgAutoloadClasses['Elastica\Filter\BoolNot'] = $elasticaDir . 
'Filter/BoolNot.php';
+$wgAutoloadClasses['Elastica\Filter\Ids'] = $elasticaDir . 'Filter/Ids.php';
 $wgAutoloadClasses['Elastica\Filter\Prefix'] = $elasticaDir . 
'Filter/Prefix.php';
 $wgAutoloadClasses['Elastica\Filter\Query'] = $elasticaDir . 
'Filter/Query.php';
 $wgAutoloadClasses['Elastica\Filter\Term'] = $elasticaDir . 'Filter/Term.php';
@@ -128,6 +131,7 @@
 $wgAutoloadClasses['Elastica\Query\Field'] = $elasticaDir . 'Query/Field.php';
 $wgAutoloadClasses['Elastica\Query\MatchAll'] = $elasticaDir . 
'Query/MatchAll.php';
 $wgAutoloadClasses['Elastica\Query\Match'] = $elasticaDir . 'Query/Match.php';
+$wgAutoloadClasses['Elastica\Query\MoreLikeThis'] = $elasticaDir . 
'Query/MoreLikeThis.php';
 $wgAutoloadClasses['Elastica\Query\Prefix'] = $elasticaDir . 
'Query/Prefix.php';
 $wgAutoloadClasses['Elastica\Query\QueryString'] = $elasticaDir . 
'Query/QueryString.php';
 $wgAutoloadClasses['Elastica\Transport\AbstractTransport'] = $elasticaDir . 
'Transport/AbstractTransport.php';
@@ -157,6 +161,6 @@
global $wgSearchType, $wgHooks;
// Install our prefix search hook only if we're enabled.
if ( $wgSearchType === 'CirrusSearch' ) {
-   $wgHooks['PrefixSearchBackend'][] = 
'CirrusSearchSearcher::prefixSearch';
+   $wgHooks['PrefixSearchBackend'][] = 
'CirrusSearchPrefixSearchHook::prefixSearch';
}
 }
diff --git a/CirrusSearchPrefixSearchHook.php b/CirrusSearchPrefixSearchHook.php
new file mode 100644
index 000..a9f7841
--- /dev/null
+++ 

[MediaWiki-commits] [Gerrit] Fix auto-summary in delete.py - change (pywikibot/compat)

2013-09-11 Thread Merlijn van Deen (Code Review)
Merlijn van Deen has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83808


Change subject: Fix auto-summary in delete.py
..

Fix auto-summary in delete.py

mysite was not defined. pywikibot.handleArgs is guaranteed to return
a list (as opposed to a generator) after parsing all global arguments
(such as -lang and -family). This means it's safe to call
pywikibot.getSite immediately after handleArgs, but before handling
local arguments.

Change-Id: I0bd76806e460fec200973a712370e459c9189ea7
Fixes-Change-Id: 
https://gerrit.wikimedia.org/r/#q,I386328c62b1bbeb7022a620f8e95d25a67686371,n,z
---
M delete.py
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/compat 
refs/changes/08/83808/1

diff --git a/delete.py b/delete.py
index d1e2c13..f8ce025 100644
--- a/delete.py
+++ b/delete.py
@@ -75,7 +75,10 @@
 generator = None
 
 # read command line parameters
-for arg in pywikibot.handleArgs():
+localargs = pywikibot.handleArgs()
+mysite = pywikibot.getSite()
+
+for arg in localargs:
 if arg == '-always':
 always = True
 elif arg.startswith('-summary'):

-- 
To view, visit https://gerrit.wikimedia.org/r/83808
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0bd76806e460fec200973a712370e459c9189ea7
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Merlijn van Deen valhall...@arctus.nl

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] A very important change to make delete.py works, merge it as... - change (pywikibot/compat)

2013-09-11 Thread Ladsgroup (Code Review)
Ladsgroup has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83803


Change subject: A very important change to make delete.py works, merge it asap, 
disabled auto-summaries
..

A very important change to make delete.py works, merge it asap, disabled 
auto-summaries

Change-Id: Ib7e2cc887c1e5dab71d16b72fb2ee8365e2fd180
---
M delete.py
1 file changed, 0 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/compat 
refs/changes/03/83803/1

diff --git a/delete.py b/delete.py
index d1e2c13..5422f24 100644
--- a/delete.py
+++ b/delete.py
@@ -96,15 +96,6 @@
 undelete = True
 else:
 genFactory.handleArg(arg)
-if not summary:
-if arg.startswith('-category'):
-summary = i18n.twtranslate(mysite, 
'delete-from-category',{'page': pageName})
-elif arg.startswith('-links'):
-summary = i18n.twtranslate(mysite, 'delete-linked-pages', 
{'page': pageName})
-elif arg.startswith('-ref'):
-summary = i18n.twtranslate(mysite, 'delete-referring-pages', 
{'page': pageName})
-elif arg.startswith('-file'):
-summary = i18n.twtranslate(mysite, 'delete-from-file')
 mysite = pywikibot.getSite()
 if doImages:
 if not summary:

-- 
To view, visit https://gerrit.wikimedia.org/r/83803
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib7e2cc887c1e5dab71d16b72fb2ee8365e2fd180
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Ladsgroup ladsgr...@gmail.com

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Add monitoring of graphs - change (analytics/geowiki)

2013-09-11 Thread QChris (Code Review)
QChris has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83811


Change subject: Add monitoring of graphs
..

Add monitoring of graphs

Change-Id: I0bb7db1ad45e8675ab97db49ab5fbaa3d26a959f
---
M scripts/check_web_page.sh
1 file changed, 91 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/geowiki 
refs/changes/11/83811/1

diff --git a/scripts/check_web_page.sh b/scripts/check_web_page.sh
index 660fdd8..980f4ab 100755
--- a/scripts/check_web_page.sh
+++ b/scripts/check_web_page.sh
@@ -30,6 +30,7 @@
 # Urls to download files from
 URL_BASE=http://gp.wmflabs.org/;
 URL_BASE_DASHBOARD=$URL_BASE/dashboards
+URL_BASE_GRAPH=$URL_BASE/graphs
 
 # Set DEBUG to local to download files into /tmp and use those copies
 # instead of fetching the files again and again for each run. Files do
@@ -148,6 +149,47 @@
 }
 
 #---
+# Downloads a json file and does some basic checks on the file
+#
+# It is assured (not by parsing the json, but by some basic grepping)
+#   * the file contains a matching id node, and
+#   * the file contains a name node that is a string.
+#
+# Input:
+#   $1 - The kind of file. I.e.: either graph, or datasource.
+#   $2 - The file's stub. E.g.: active_editors_by_region,
+#pt_top10.
+#   $3 - The url to download (without the .json ending)
+#
+# Output:
+#   DOWNLOADED_FILE_ABS - The absolute name of the file into which the
+#   URL's content can be found. Do not modify this file, as it may
+#   be reused for different runs, when in DEBUG=local mode. Do not
+#   clean up the file. It is removed automatically (when not in
+#   DEBUG=local).
+#
+check_json() {
+local KIND=$1
+local JSON_STUB=$2
+local URL_WITHOUT_EXTENSION=$3
+download_file ${URL_WITHOUT_EXTENSION}.json
+
+# We do not parse the json, just to some basic sanity checks.
+
+# Check for matching id
+if ! grep -q 'id[[:space:]]*:[[:space:]]*'$JSON_STUB'' 
${DOWNLOADED_FILE_ABS}
+then
+   error Could not find id '$JSON_STUB' for $KIND '$JSON_STUB'
+fi
+
+# Check for name being a string
+if ! grep -q 'name[[:space:]]*:[[:space:]]*' ${DOWNLOADED_FILE_ABS}
+then
+   error Could not find 'name' node of type string for $KIND '$JSON_STUB'
+fi
+}
+
+#---
 # Downloads a dashboard file and does some basic checks on the file
 #
 # It is assured that
@@ -176,6 +218,33 @@
 }
 
 #---
+# Downloads a graph file and does some basic checks on the file
+#
+# It is assured (not by parsing the json, but by some basic grepping)
+#   * the file contains a matching id node, and
+#   * the file contains a name node that is a string.
+#
+# Input:
+#   $2 - The file's stub. E.g.: active_editors_by_region,
+#pt_top10.
+#
+# Output:
+#   -
+#
+check_graph() {
+local GRAPH_STUB=$1
+
+local DOWNLOADED_FILE_ABS=
+check_json graph ${GRAPH_STUB} ${URL_BASE_GRAPH}/${GRAPH_STUB}
+
+# Check for matching slug
+if ! grep -q 'slug[[:space:]]*:[[:space:]]*'$GRAPH_STUB'' 
${DOWNLOADED_FILE_ABS}
+then
+   error Could not find slug '$GRAPH_STUB' for graph '$GRAPH_STUB'
+fi
+}
+
+#---
 # Checks that geowiki's dashboards are ok.
 #
 # Input:
@@ -189,6 +258,27 @@
 }
 
 #---
+# Checks that geowiki's graphs are ok.
+#
+# Input:
+#   -
+#
+# Output:
+#   -
+#
+check_graphs() {
+check_graph active_editors_by_region
+check_graph global_north_south_active_editors
+check_graph global_south_editor_fractions
+check_graph grants_count_by_global_south
+check_graph grants_count_by_program
+check_graph grants_spending_by_country
+check_graph grants_spending_by_global_south
+check_graph grants_spending_by_program
+check_graph pt_wp_brazil
+}
+
+#---
 # Checks that geowiki's files are ok.
 #
 # Input:
@@ -199,7 +289,7 @@
 #
 check() {
 check_dashboards
-error checking graphs not yet implemented
+check_graphs
 error checking datasources not yet implemented
 error checking datafiles not yet implemented
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/83811
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0bb7db1ad45e8675ab97db49ab5fbaa3d26a959f
Gerrit-PatchSet: 1
Gerrit-Project: analytics/geowiki
Gerrit-Branch: master
Gerrit-Owner: QChris christ...@quelltextlich.at

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Update monitoring for data up to 2013-09-10 - change (analytics/geowiki)

2013-09-11 Thread QChris (Code Review)
QChris has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83814


Change subject: Update monitoring for data up to 2013-09-10
..

Update monitoring for data up to 2013-09-10

Change-Id: I7a5fdaff0d7c50ad6794f4138f6256f68886d34b
---
M scripts/check_web_page.sh
1 file changed, 4 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/geowiki 
refs/changes/14/83814/1

diff --git a/scripts/check_web_page.sh b/scripts/check_web_page.sh
index 5c70e80..bd2bd91 100755
--- a/scripts/check_web_page.sh
+++ b/scripts/check_web_page.sh
@@ -50,9 +50,6 @@
 # override the default expected date (i.e.: current day) of the last
 # data point of a file.
 declare -A EXPECTED_LAST_DATE_OVERRIDE
-EXPECTED_LAST_DATE_OVERRIDE[bm_top10]=2013-08-23
-EXPECTED_LAST_DATE_OVERRIDE[ee_top10]=2013-08-13
-EXPECTED_LAST_DATE_OVERRIDE[ff_top10]=2013-08-13
 EXPECTED_LAST_DATE_OVERRIDE[global_south_editor_fractions]=2013-08-20
 EXPECTED_LAST_DATE_OVERRIDE[grants_count_by_global_south]=2013-06-01
 EXPECTED_LAST_DATE_OVERRIDE[grants_count_by_program]=2013-06-01
@@ -62,24 +59,19 @@
 EXPECTED_LAST_DATE_OVERRIDE[lg_top10]=2013-06-20
 EXPECTED_LAST_DATE_OVERRIDE[pnt_all]=2013-08-15
 EXPECTED_LAST_DATE_OVERRIDE[pnt_top10]=2013-08-01
-EXPECTED_LAST_DATE_OVERRIDE[rn_all]=2013-08-27
 EXPECTED_LAST_DATE_OVERRIDE[rn_top10]=2013-08-27
-EXPECTED_LAST_DATE_OVERRIDE[roa_rup_top10]=2013-09-07
 EXPECTED_LAST_DATE_OVERRIDE[sg_all]=2013-09-05
-EXPECTED_LAST_DATE_OVERRIDE[sg_top10]=2013-08-29
+EXPECTED_LAST_DATE_OVERRIDE[sg_top10]=2013-09-05
 EXPECTED_LAST_DATE_OVERRIDE[sm_all]=2013-09-07
 EXPECTED_LAST_DATE_OVERRIDE[sm_top10]=2013-09-07
-EXPECTED_LAST_DATE_OVERRIDE[st_top10]=2013-09-06
 EXPECTED_LAST_DATE_OVERRIDE[ti_all]=2013-09-07
-EXPECTED_LAST_DATE_OVERRIDE[ti_top10]=2013-08-23
+EXPECTED_LAST_DATE_OVERRIDE[ti_top10]=2013-09-07
 EXPECTED_LAST_DATE_OVERRIDE[to_top10]=2013-09-05
 EXPECTED_LAST_DATE_OVERRIDE[ts_top10]=2013-08-26
 EXPECTED_LAST_DATE_OVERRIDE[tum_all]=2013-08-06
-EXPECTED_LAST_DATE_OVERRIDE[tum_top10]=2013-08-02
-EXPECTED_LAST_DATE_OVERRIDE[tw_top10]=2013-08-31
+EXPECTED_LAST_DATE_OVERRIDE[tum_top10]=2013-08-06
 EXPECTED_LAST_DATE_OVERRIDE[ve_all]=2013-07-31
 EXPECTED_LAST_DATE_OVERRIDE[ve_top10]=2013-06-07
-EXPECTED_LAST_DATE_OVERRIDE[xh_top10]=2013-08-13
 
 # Set DEBUG to local to download files into /tmp and use those copies
 # instead of fetching the files again and again for each run. Files do
@@ -670,7 +662,7 @@
 check_csv_column $CSV_STUB $CSV_FILE_ABS Brazil (all) 2  4 
3000 4000
 check_csv_column $CSV_STUB $CSV_FILE_ABS France (all)15 25   
35   80
 check_csv_column $CSV_STUB $CSV_FILE_ABS Germany (all)   15 25   
60  110
-check_csv_column $CSV_STUB $CSV_FILE_ABS Portugal (all)   5 14  
300  550
+check_csv_column $CSV_STUB $CSV_FILE_ABS Portugal (all)   6 14  
300  550
 check_csv_column $CSV_STUB $CSV_FILE_ABS Spain (all) 15 40   
20   70
 check_csv_column $CSV_STUB $CSV_FILE_ABS United States (all) 13 30   
60  130
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/83814
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7a5fdaff0d7c50ad6794f4138f6256f68886d34b
Gerrit-PatchSet: 1
Gerrit-Project: analytics/geowiki
Gerrit-Branch: master
Gerrit-Owner: QChris christ...@quelltextlich.at

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Add monitoring of datafiles - change (analytics/geowiki)

2013-09-11 Thread QChris (Code Review)
QChris has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83813


Change subject: Add monitoring of datafiles
..

Add monitoring of datafiles

Change-Id: I1d4693c991a7fae87fb081725f246fb4050ddbed
---
M scripts/check_web_page.sh
1 file changed, 627 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/geowiki 
refs/changes/13/83813/1

diff --git a/scripts/check_web_page.sh b/scripts/check_web_page.sh
index 3e17282..5c70e80 100755
--- a/scripts/check_web_page.sh
+++ b/scripts/check_web_page.sh
@@ -32,6 +32,17 @@
 URL_BASE_DASHBOARD=$URL_BASE/dashboards
 URL_BASE_GRAPH=$URL_BASE/graphs
 URL_BASE_DATASOURCE=$URL_BASE/datasources
+URL_BASE_CSV=$URL_BASE/data/datafiles/gp
+
+# Wikis with many active editors.
+# For those wikis, we use allow less deviation from linear
+# extrapolated values for the column with maximum active editors.
+WIKIS_MANY_ACTIVE_EDITORS=( ar az be be_x_old bg bn ca cs da de el en eo es et 
eu fa fi gl he hi hr hu hy id is it ja ka kk kn ko lt lv mk ml mn mr ms nl nn 
no pl pt ro ru sh simple sk sl sr sq sv ta te th tl tr uk vi zh zh_yue )
+
+# Wikis with hardly any active editors.
+# For those wikis, linear extrapolation does not make sense. However,
+# we check whether the needed files exist.
+WIKIS_HARDLY_ACTIVE_EDITORS=( ab ace af ak als am an ang arc arz as ast av ay 
ba bar bat_smg bcl bh bi bjn bm bo bpy br bs bug bxr cbk_zam cdo ce ceb ch chr 
chy ckb co cr crh csb cu cv cy diq dsb dv dz ee eml ext ff fiu_vro fj fo frp 
frr fur fy ga gan gd glk gn got gu gv ha hak haw hif hsb ht ia ie ig ik ilo io 
iu jbo jv kaa kab kbd kg ki kl km koi krc ks ksh ku kv kw ky la lad lb lbe lez 
lg li lij lmo ln lo ltg map_bms mdf mg mhr mi mrj mt mwl my myv mzn na nah nap 
nds nds_nl ne new nov nrm nso nv ny oc om or os pa pag pam pap pcd pdc pi pih 
pms pnb pnt ps qu rm rmy rn roa_rup roa_tara rue rw sa sah sc scn sco sd se sg 
si sm sn so srn ss st stq su sw szl tet tg ti tk tn to tpi ts tt tum tw ty udm 
ug ur uz ve vec vep vls vo wa war wo wuu xal xh yi yo za zea zh_classical 
zh_min_nan zu )
 
 # Some files have a last data point that is further back. Either
 # because the wiki ran out of active editors, or the file has to be
@@ -39,11 +50,36 @@
 # override the default expected date (i.e.: current day) of the last
 # data point of a file.
 declare -A EXPECTED_LAST_DATE_OVERRIDE
+EXPECTED_LAST_DATE_OVERRIDE[bm_top10]=2013-08-23
+EXPECTED_LAST_DATE_OVERRIDE[ee_top10]=2013-08-13
+EXPECTED_LAST_DATE_OVERRIDE[ff_top10]=2013-08-13
 EXPECTED_LAST_DATE_OVERRIDE[global_south_editor_fractions]=2013-08-20
 EXPECTED_LAST_DATE_OVERRIDE[grants_count_by_global_south]=2013-06-01
 EXPECTED_LAST_DATE_OVERRIDE[grants_count_by_program]=2013-06-01
 EXPECTED_LAST_DATE_OVERRIDE[grants_spending_by_global_south]=2013-06-01
 EXPECTED_LAST_DATE_OVERRIDE[grants_spending_by_program]=2013-06-01
+EXPECTED_LAST_DATE_OVERRIDE[lg_all]=2013-08-09
+EXPECTED_LAST_DATE_OVERRIDE[lg_top10]=2013-06-20
+EXPECTED_LAST_DATE_OVERRIDE[pnt_all]=2013-08-15
+EXPECTED_LAST_DATE_OVERRIDE[pnt_top10]=2013-08-01
+EXPECTED_LAST_DATE_OVERRIDE[rn_all]=2013-08-27
+EXPECTED_LAST_DATE_OVERRIDE[rn_top10]=2013-08-27
+EXPECTED_LAST_DATE_OVERRIDE[roa_rup_top10]=2013-09-07
+EXPECTED_LAST_DATE_OVERRIDE[sg_all]=2013-09-05
+EXPECTED_LAST_DATE_OVERRIDE[sg_top10]=2013-08-29
+EXPECTED_LAST_DATE_OVERRIDE[sm_all]=2013-09-07
+EXPECTED_LAST_DATE_OVERRIDE[sm_top10]=2013-09-07
+EXPECTED_LAST_DATE_OVERRIDE[st_top10]=2013-09-06
+EXPECTED_LAST_DATE_OVERRIDE[ti_all]=2013-09-07
+EXPECTED_LAST_DATE_OVERRIDE[ti_top10]=2013-08-23
+EXPECTED_LAST_DATE_OVERRIDE[to_top10]=2013-09-05
+EXPECTED_LAST_DATE_OVERRIDE[ts_top10]=2013-08-26
+EXPECTED_LAST_DATE_OVERRIDE[tum_all]=2013-08-06
+EXPECTED_LAST_DATE_OVERRIDE[tum_top10]=2013-08-02
+EXPECTED_LAST_DATE_OVERRIDE[tw_top10]=2013-08-31
+EXPECTED_LAST_DATE_OVERRIDE[ve_all]=2013-07-31
+EXPECTED_LAST_DATE_OVERRIDE[ve_top10]=2013-06-07
+EXPECTED_LAST_DATE_OVERRIDE[xh_top10]=2013-08-13
 
 # Set DEBUG to local to download files into /tmp and use those copies
 # instead of fetching the files again and again for each run. Files do
@@ -188,6 +224,64 @@
 }
 
 #---
+# Downloads a csv file and does some basic checks on the file
+#
+# It is assured that
+#   * the file's last line is for the expected date,
+#   * each line of the file has the same amount of columns, and
+#   * (for stubs != global_south_editor_fractions) that the file has
+# at least 10 columns.
+#
+# Input:
+#   $1 - The csv's stub to download. The URL to download is generated
+#from this stub. E.g.: 'global_south', 'de_top10'.
+#
+# Output:
+#   DOWNLOADED_FILE_ABS - The absolute name of the file into which the
+#   URL's content can be found. Do not modify this file, as it may
+#   be reused for different runs, when in DEBUG=local mode. Do not
+#   clean up the file. It is removed 

[MediaWiki-commits] [Gerrit] Use Cirrus as default on mw.org - change (operations/mediawiki-config)

2013-09-11 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Use Cirrus as default on mw.org
..


Use Cirrus as default on mw.org

Change-Id: Idbbe12c3e4fff507ba1fc621ce6a8799dc444ea7
---
M wmf-config/InitialiseSettings.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Chad: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/wmf-config/InitialiseSettings.php 
b/wmf-config/InitialiseSettings.php
index ce1e5bb..4e74749 100644
--- a/wmf-config/InitialiseSettings.php
+++ b/wmf-config/InitialiseSettings.php
@@ -12701,12 +12701,12 @@
 
 'wmgUseCirrus' = array(
'default' = false,
+   'mediawikiwiki' = true,
'test2wiki' = true,
 ),
 
 'wmgUseCirrusAsAlternative' = array(
'default' = false,
-   'mediawikiwiki' = true,
 ),
 
 ### End (roughly) of general extensions 

-- 
To view, visit https://gerrit.wikimedia.org/r/83759
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Idbbe12c3e4fff507ba1fc621ce6a8799dc444ea7
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Chad ch...@wikimedia.org
Gerrit-Reviewer: Chad ch...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Implementation work in SimpleTableSchemaUpdater - change (mediawiki...WikibaseDatabase)

2013-09-11 Thread Jeroen De Dauw (Code Review)
Jeroen De Dauw has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83815


Change subject: Implementation work in SimpleTableSchemaUpdater
..

Implementation work in SimpleTableSchemaUpdater

Change-Id: Ib09615ca096f678d5a9c857b1eea0cec5930eacb
---
M src/Schema/SimpleTableSchemaUpdater.php
M tests/phpunit/Schema/SimpleTableSchemaUpdaterTest.php
2 files changed, 76 insertions(+), 4 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseDatabase 
refs/changes/15/83815/1

diff --git a/src/Schema/SimpleTableSchemaUpdater.php 
b/src/Schema/SimpleTableSchemaUpdater.php
index c6abc5c..e815167 100644
--- a/src/Schema/SimpleTableSchemaUpdater.php
+++ b/src/Schema/SimpleTableSchemaUpdater.php
@@ -13,6 +13,16 @@
 
protected $schemaModifier;
 
+   /**
+* @var TableDefinition
+*/
+   protected $currentTable;
+
+   /**
+* @var TableDefinition
+*/
+   protected $newTable;
+
public function __construct( SchemaModifier $schemaModifier ) {
$this-schemaModifier = $schemaModifier;
}
@@ -26,13 +36,31 @@
 * @throws SchemaUpdateFailedException
 */
public function updateTable( TableDefinition $currentTable, 
TableDefinition $newTable ) {
-   $this-removeRemovedFields( $currentTable, $newTable );
+   // TODO: assert same table
+
+   $this-currentTable = $currentTable;
+   $this-newTable = $newTable;
+
+   $this-removeRemovedFields();
+   $this-addAddedFields();
+
// TODO
}
 
-   protected function removeRemovedFields( TableDefinition $currentTable, 
TableDefinition $newTable ) {
-   $removedFields = array_diff_key( $currentTable-getFields(), 
$newTable-getFields() );
-   // TODO
+   protected function removeRemovedFields() {
+   $removedFields = array_diff_key( 
$this-currentTable-getFields(), $this-newTable-getFields() );
+
+   foreach ( $removedFields as $removedField ) {
+   $this-schemaModifier-removeField( 
$this-currentTable-getName(), $removedField-getName() );
+   }
+   }
+
+   protected function addAddedFields() {
+   $addedFields = array_diff_key( $this-newTable-getFields(), 
$this-currentTable-getFields() );
+
+   foreach ( $addedFields as $addedField ) {
+   $this-schemaModifier-addField( 
$this-currentTable-getName(), $addedField );
+   }
}
 
 }
diff --git a/tests/phpunit/Schema/SimpleTableSchemaUpdaterTest.php 
b/tests/phpunit/Schema/SimpleTableSchemaUpdaterTest.php
index 8f61985..efbf840 100644
--- a/tests/phpunit/Schema/SimpleTableSchemaUpdaterTest.php
+++ b/tests/phpunit/Schema/SimpleTableSchemaUpdaterTest.php
@@ -90,4 +90,48 @@
return array_map( function( $definition ) { return array( 
$definition ); }, $definitions );
}
 
+   /**
+* @dataProvider tableDefinitionProvider
+*/
+   public function testNewFieldsGetAdded( TableDefinition $tableDefinition 
) {
+   $schema = $this-getMock( 
'Wikibase\Database\Schema\SchemaModifier' );
+
+   $schema-expects( $this-never() )
+   -method( 'removeField' );
+
+   $fields = $tableDefinition-getFields();
+
+   $schema-expects( $this-exactly( count( $fields ) - 1 ) )
+   -method( 'addField' );
+
+   $updater = new SimpleTableSchemaUpdater( $schema );
+
+   $updater-updateTable(
+   $tableDefinition-mutateFields( array( reset( $fields ) 
) ),
+   $tableDefinition
+   );
+   }
+
+   /**
+* @dataProvider tableDefinitionProvider
+*/
+   public function testRemovedFieldsGetRemoved( TableDefinition 
$tableDefinition ) {
+   $schema = $this-getMock( 
'Wikibase\Database\Schema\SchemaModifier' );
+
+   $schema-expects( $this-never() )
+   -method( 'addField' );
+
+   $fields = $tableDefinition-getFields();
+
+   $schema-expects( $this-exactly( count( $fields ) - 1 ) )
+   -method( 'removeField' );
+
+   $updater = new SimpleTableSchemaUpdater( $schema );
+
+   $updater-updateTable(
+   $tableDefinition,
+   $tableDefinition-mutateFields( array( reset( $fields ) 
) )
+   );
+   }
+
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/83815
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib09615ca096f678d5a9c857b1eea0cec5930eacb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseDatabase
Gerrit-Branch: master
Gerrit-Owner: Jeroen 

[MediaWiki-commits] [Gerrit] Add monitoring of dashboards - change (analytics/geowiki)

2013-09-11 Thread QChris (Code Review)
QChris has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83810


Change subject: Add monitoring of dashboards
..

Add monitoring of dashboards

Change-Id: I4147f67572927773004f8de83e582572a7b94679
---
M scripts/check_web_page.sh
1 file changed, 167 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/geowiki 
refs/changes/10/83810/1

diff --git a/scripts/check_web_page.sh b/scripts/check_web_page.sh
index fe14dea..660fdd8 100755
--- a/scripts/check_web_page.sh
+++ b/scripts/check_web_page.sh
@@ -6,8 +6,37 @@
 
 set -e
 
+# Automatic cleanup of temporary file by trapping EXIT. (See
+# DEBUG=local below)
+TMP_FILES_ABS=()
+cleanup() {
+if [ $DEBUG != local ]
+then
+   for TMP_FILE_ABS in ${TMP_FILES_ABS[@]}
+   do
+   rm -f $TMP_FILE_ABS
+   if [ -e $TMP_FILE_ABS ]
+   then
+   echo Could not remove temporary file: $TMP_FILE_ABS 2
+   fi
+   done
+fi
+}
+trap cleanup EXIT
+
 # Absolute path to this script
 SCRIPT_DIR_ABS=$(dirname $0)
+
+# Urls to download files from
+URL_BASE=http://gp.wmflabs.org/;
+URL_BASE_DASHBOARD=$URL_BASE/dashboards
+
+# Set DEBUG to local to download files into /tmp and use those copies
+# instead of fetching the files again and again for each run. Files do
+# not get removed upon script exit. This is only useful when
+# debugging/developing the script
+DEBUG=
+#DEBUG=local
 
 #---
 # Dumps an error message to stderr and exits the script
@@ -26,6 +55,140 @@
 }
 
 #---
+# Creates a temporary file
+#
+# The temporary file gets added to the TMP_FILES_ABS array, and hence
+# removed upon exit of the script, if not in DEBUG=local mode. (See
+# trap at top of this script).
+#
+# Input:
+#   $1 - stencil to be used for the temporary file. This stencil gets
+#prepended by geowiki_monitor. and has a randow string
+#appended.
+#
+# Output:
+#   TMP_FILE_ABS - The absolucte name of the created temporary file. Do
+#   not clean up the file. It is removed automatically (when not
+#   in DEBUG=local).
+#
+mktemp_file() {
+local NAME=$1
+TMP_FILE_ABS=$(mktemp --tmpdir geowiki_monitor.$NAME.XX)
+if [ -z $TMP_FILE_ABS ]
+then
+   error Could not create new temporary file
+fi
+if [ ! -e $TMP_FILE_ABS ]
+then
+   error Could not create temporary file '$TMP_FILE_ABS'
+fi
+TMP_FILES_ABS=( ${TMP_FILES_ABS[@]} ${TMP_FILE_ABS} )
+}
+
+#---
+# Downloads a URL to $DOWNLOADED_FILE_ABS without considering caches.
+#
+# Rather use the download_file function instead, as do_download_file
+# does not pick up previously downloaded files.
+#
+# This function does not respect DEBUG=local.
+#
+# Input:
+#   $1 - The url to download
+#
+# Output:
+#   DOWNLOADED_FILE_ABS - The absolute name of the file into which the
+#   URL has been downloaded.
+#
+do_download_file() {
+local URL=$1
+wget -O $DOWNLOADED_FILE_ABS -o /dev/null $URL
+}
+
+#---
+# Downloads a URL to $DOWNLOADED_FILE_ABS.
+#
+# When not in DEBUG=local mode, the file is downloaded from the given
+# URL into a temporary file (which automatically gets removed upon
+# script exit). The name of this temporary file is passed back.
+#
+# When in DEBUG=local mode, a canonical file name for the URL is
+# generated under /tmp/. If the file does not exist, the URL gets
+# downloaded into this URL. The canonical file name for the URL is
+# returned.
+#
+# Input:
+#   $1 - The url to download
+#
+# Output:
+#   DOWNLOADED_FILE_ABS - The absolute name of the file into which the
+#   URL's content can be found. Do not modify this file, as it may
+#   be reused for different runs, when in DEBUG=local mode. Do not
+#   clean up the file. It is removed automatically (when not in
+#   DEBUG=local).
+#
+download_file() {
+local URL=$1
+
+local SAFE_URL=$(echo $URL | sed -e 's/[^a-zA-Z0-9_.-]/_/g')
+
+if [ $DEBUG = local ]
+then
+   DOWNLOADED_FILE_ABS=/tmp/geowiki_monitor.$SAFE_URL
+   if [ ! -e $DOWNLOADED_FILE_ABS ]
+   then
+   do_download_file $URL
+   fi
+else
+   local TMP_FILE_ABS
+   mktemp_file $SAFE_URL
+   DOWNLOADED_FILE_ABS=$TMP_FILE_ABS
+   do_download_file $URL
+fi
+}
+
+#---
+# Downloads a dashboard file and does some basic checks on the file
+#
+# It is assured that
+#   * the file exists and is not empty
+#
+# Input:
+#   $1 - The dashboards's stub to download. The URL to download is generated
+#from this stub. E.g.: 'reportcard'.
+#
+# Output:
+#   -
+#
+check_dashboard() {
+local DASHBOARD_STUB=$1
+
+local DOWNLOADED_FILE_ABS=
+download_file 

[MediaWiki-commits] [Gerrit] (bug 52799) Introducing dumpJson. - change (mediawiki...Wikibase)

2013-09-11 Thread Daniel Kinzler (Code Review)
Daniel Kinzler has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83816


Change subject: (bug 52799) Introducing dumpJson.
..

(bug 52799) Introducing dumpJson.

This allows JSON dumps to be created for all entities.

This is a baseline implementation.

In later changes, this will be extended to allow for
entities to be filtered by type, ids to be loaded from file, etc.

Change-Id: I09eaa2a7b6fa9cb6a5ffc57b5f28c30e93d79f8b
---
M lib/WikibaseLib.classes.php
A lib/includes/Dumpers/JsonDumpGenerator.php
A lib/tests/phpunit/Dumpers/JsonDumpGeneratorTest.php
M repo/Wikibase.classes.php
M repo/includes/store/EntityPerPage.php
A repo/includes/store/sql/ConvertingResultWrapper.php
A repo/includes/store/sql/DatabaseRowEntityIdIterator.php
M repo/includes/store/sql/EntityPerPageTable.php
A repo/maintenance/dumpJson.php
A repo/tests/phpunit/includes/store/sql/DatabaseRowEntityIdIteratorTest.php
A repo/tests/phpunit/includes/store/sql/EntityPerPageTableTest.php
11 files changed, 782 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/16/83816/1

diff --git a/lib/WikibaseLib.classes.php b/lib/WikibaseLib.classes.php
index f63ede2..af37853 100644
--- a/lib/WikibaseLib.classes.php
+++ b/lib/WikibaseLib.classes.php
@@ -85,6 +85,9 @@
'Wikibase\EntityDiffVisualizer' = 
'includes/EntityDiffVisualizer.php',
'Wikibase\EntityFactory' = 'includes/EntityFactory.php',
 
+   // includes/Dumpers
+   'Wikibase\Dumpers\JsonDumpGenerator' = 
'includes/Dumpers/JsonDumpGenerator.php',
+
// includes/formatters
'Wikibase\Lib\EntityIdFormatter' = 
'includes/formatters/EntityIdFormatter.php',
'Wikibase\Lib\EntityIdLabelFormatter' = 
'includes/formatters/EntityIdLabelFormatter.php',
diff --git a/lib/includes/Dumpers/JsonDumpGenerator.php 
b/lib/includes/Dumpers/JsonDumpGenerator.php
new file mode 100644
index 000..20f007f
--- /dev/null
+++ b/lib/includes/Dumpers/JsonDumpGenerator.php
@@ -0,0 +1,144 @@
+?php
+
+namespace Wikibase\Dumpers;
+use MWException;
+use Traversable;
+use Wikibase\DataModel\Entity\EntityId;
+use Wikibase\EntityLookup;
+use Wikibase\Lib\Serializers\Serializer;
+use Wikibase\StorageException;
+
+/**
+ * JsonDumpGenerator generates an JSON dump of a given set of entities.
+ *
+ * @since 0.5
+ *
+ * @license GPL 2+
+ * @author Daniel Kinzler
+ */
+class JsonDumpGenerator {
+
+   /**
+* @var int flags to use with json_encode as a bit field, see PHP's 
JSON_XXX constants.
+*/
+   public $jsonFlags = 0;
+
+   /**
+* @var resource File handle for output
+*/
+   protected $out;
+
+   /**
+* @var Serializer
+*/
+   protected $entitySerializer;
+
+   /**
+* @var EntityLookup
+*/
+   protected $entityLookup;
+
+   /**
+* @param resource $out
+* @param \Wikibase\EntityLookup $lookup
+* @param Serializer $entitySerializer
+*
+* @throws \InvalidArgumentException
+*/
+   public function __construct( $out, EntityLookup $lookup, Serializer 
$entitySerializer ) {
+   if ( !is_resource( $out ) ) {
+   throw new \InvalidArgumentException( '$out must be a 
file handle!' );
+   }
+
+   $this-out = $out;
+   $this-entitySerializer = $entitySerializer;
+   $this-entityLookup = $lookup;
+   }
+
+   /**
+* Generates a JSON dump, writing to the file handle provided to the 
constructor.
+*
+* @param Traversable $idStream an Iterator that returns EntityId 
instances
+*/
+   public function generateDump( Traversable $idStream ) {
+
+   $json = [\n; //TODO: make optional
+   $this-writeToDump( $json );
+
+   $i = 0;
+
+   /* @var EntityId $id */
+   foreach ( $idStream as $id ) {
+   try {
+   if ( $i++  0 ) {
+   $this-writeToDump( ,\n );
+   }
+
+   $entity = $this-entityLookup-getEntity( $id );
+   $data = $this-entitySerializer-getSerialized( 
$entity );
+   $json = $this-encode( $data );
+   $this-writeToDump( $json );
+   } catch ( StorageException $ex ) {
+   $this-handleStorageException( $ex );
+   }
+   }
+
+   $json = ]\n; //TODO: make optional
+   $this-writeToDump( $json );
+   }
+
+   /**
+* @param $ex
+*/
+   private function handleStorageException( $ex ) {
+   //TODO: optionally, log  

[MediaWiki-commits] [Gerrit] VE support on beta is now reliable, run tests there - change (mediawiki...VisualEditor)

2013-09-11 Thread Cmcmahon (Code Review)
Cmcmahon has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83817


Change subject: VE support on beta is now reliable, run tests there
..

VE support on beta is now reliable, run tests there

Change-Id: I82e42f24a6950680770bf6fc2b11e554d95224b6
---
M modules/ve-mw/test/browser/features/visual_editor_anon.feature
M modules/ve-mw/test/browser/features/visual_editor_headings.feature
M modules/ve-mw/test/browser/features/visual_editor_links.feature
M modules/ve-mw/test/browser/features/visual_editor_logged_in.feature
M modules/ve-mw/test/browser/features/visual_editor_references.feature
M modules/ve-mw/test/browser/features/visual_editor_transclusion.feature
6 files changed, 7 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/17/83817/1

diff --git a/modules/ve-mw/test/browser/features/visual_editor_anon.feature 
b/modules/ve-mw/test/browser/features/visual_editor_anon.feature
index b6d87c8..dc85eb7 100644
--- a/modules/ve-mw/test/browser/features/visual_editor_anon.feature
+++ b/modules/ve-mw/test/browser/features/visual_editor_anon.feature
@@ -1,4 +1,4 @@
-@ie6-bug  @ie7-bug  @ie8-bug @ie9-bug @ie10-bug @test2.wikipedia.org
+@ie6-bug  @ie7-bug  @ie8-bug @ie9-bug @ie10-bug @test2.wikipedia.org 
@en.wikipedia.beta.wmflabs.org
 Feature: VisualEditor
 
   @login
diff --git a/modules/ve-mw/test/browser/features/visual_editor_headings.feature 
b/modules/ve-mw/test/browser/features/visual_editor_headings.feature
index 1d4c41c..40f3b5f 100644
--- a/modules/ve-mw/test/browser/features/visual_editor_headings.feature
+++ b/modules/ve-mw/test/browser/features/visual_editor_headings.feature
@@ -1,4 +1,4 @@
-@ie6-bug  @ie7-bug  @ie8-bug  @ie9-bug @ie10-bug @test2.wikipedia.org @login
+@ie6-bug  @ie7-bug  @ie8-bug  @ie9-bug @ie10-bug @test2.wikipedia.org 
@en.wikipedia.beta.wmflabs.org @login
 Feature: VisualEditor Headings
 
   Background: Open VE and edit page with string
@@ -71,4 +71,4 @@
 And I click Save page
 And I click Review your changes
 Then a Page title should appear in the diff view
-And I should be able to click the up arrow on the save box
\ No newline at end of file
+And I should be able to click the up arrow on the save box
diff --git a/modules/ve-mw/test/browser/features/visual_editor_links.feature 
b/modules/ve-mw/test/browser/features/visual_editor_links.feature
index d9de92a..656e79a 100644
--- a/modules/ve-mw/test/browser/features/visual_editor_links.feature
+++ b/modules/ve-mw/test/browser/features/visual_editor_links.feature
@@ -1,4 +1,4 @@
-@ie6-bug  @ie7-bug  @ie8-bug  @ie9-bug @ie10-bug @test2.wikipedia.org @login
+@ie6-bug  @ie7-bug  @ie8-bug  @ie9-bug @ie10-bug 
@en.wikipedia.beta.wmflabs.org @test2.wikipedia.org @login
 Feature: VisualEditor Links
 
   Background:
diff --git 
a/modules/ve-mw/test/browser/features/visual_editor_logged_in.feature 
b/modules/ve-mw/test/browser/features/visual_editor_logged_in.feature
index 7867a41..b776c4a 100644
--- a/modules/ve-mw/test/browser/features/visual_editor_logged_in.feature
+++ b/modules/ve-mw/test/browser/features/visual_editor_logged_in.feature
@@ -1,4 +1,4 @@
-@ie6-bug  @ie7-bug  @ie8-bug @ie9-bug @ie10-bug @test2.wikipedia.org
+@ie6-bug  @ie7-bug  @ie8-bug @ie9-bug @ie10-bug @test2.wikipedia.org 
@en.wikipedia.beta.wmflabs.org
 Feature: VisualEditor
 
   @login
diff --git 
a/modules/ve-mw/test/browser/features/visual_editor_references.feature 
b/modules/ve-mw/test/browser/features/visual_editor_references.feature
index ad5fc74..a404632 100644
--- a/modules/ve-mw/test/browser/features/visual_editor_references.feature
+++ b/modules/ve-mw/test/browser/features/visual_editor_references.feature
@@ -1,4 +1,4 @@
-@ie6-bug  @ie7-bug  @ie8-bug @ie9-bug @ie10-bug @test2.wikipedia.org @login
+@ie6-bug  @ie7-bug  @ie8-bug @ie9-bug @ie10-bug @test2.wikipedia.org 
@en.wikipedia.beta.wmflabs.org @login
 Feature: VisualEditor References
 
   Background:
diff --git 
a/modules/ve-mw/test/browser/features/visual_editor_transclusion.feature 
b/modules/ve-mw/test/browser/features/visual_editor_transclusion.feature
index be1f575..a7afcdb 100644
--- a/modules/ve-mw/test/browser/features/visual_editor_transclusion.feature
+++ b/modules/ve-mw/test/browser/features/visual_editor_transclusion.feature
@@ -1,4 +1,4 @@
-@ie6-bug  @ie7-bug  @ie8-bug @ie9-bug @ie10-bug @test2.wikipedia.org @login
+@ie6-bug  @ie7-bug  @ie8-bug @ie9-bug @ie10-bug @test2.wikipedia.org 
@en.wikipedia.beta.wmflabs.org @login
 Feature: VisualEditor Transclusion
 
   Background:

-- 
To view, visit https://gerrit.wikimedia.org/r/83817
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I82e42f24a6950680770bf6fc2b11e554d95224b6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Cmcmahon cmcma...@wikimedia.org


[MediaWiki-commits] [Gerrit] redeploy OTRS idle_agent_report - change (operations/puppet)

2013-09-11 Thread Jgreen (Code Review)
Jgreen has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83822


Change subject: redeploy OTRS idle_agent_report
..

redeploy OTRS idle_agent_report

Change-Id: Ie5151001d03dc276c8588995b97b2f9e4905d5de
---
A files/otrs/idle_agent_report
M manifests/role/otrs.pp
2 files changed, 253 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/22/83822/1

diff --git a/files/otrs/idle_agent_report b/files/otrs/idle_agent_report
new file mode 100755
index 000..7e69598
--- /dev/null
+++ b/files/otrs/idle_agent_report
@@ -0,0 +1,247 @@
+#!/usr/bin/perl
+use strict;
+use CGI;
+use FindBin qw($Bin); # use ../ as lib location
+use lib $Bin/../..;
+use lib $Bin/../../Kernel/cpan-lib;
+use Kernel::Config;
+use Kernel::System::Time;
+use Kernel::System::Log;
+use Kernel::System::Main;
+use Kernel::System::Encode;
+use Kernel::System::User;
+use Kernel::System::Group;
+use Kernel::System::DB;
+use Kernel::System::Auth;
+use Kernel::System::AuthSession;
+
+# if any of these queries returns 5K rows we have a problem
+my $rowlimit = 5000;
+
+
+# http://dev.otrs.org/2.4/Kernel/System/Group.html
+# http://meta.wikimedia.org/wiki/OTRS#OTRS_administrators
+my %RoleOK2View = (
+   'OTRS admins' = 1,
+   'Wikimedia Technical Staff' = 1,
+);
+
+# reporting queries provided by Philippe, simply numbered for easy access from 
URI query string
+# stab otrs db libs for lacking fetchrow hashref
+my $query = {
+   1 = {
+   'desc' = 'Last login over 6 months',
+   'cols' = [ qw(login id email lastlogin) ],
+   'sql' = 'SELECT login, id, eml.preferences_value, 
DATE_FORMAT(FROM_UNIXTIME(ull.preferences_value), %Y-%m-%d) FROM users LEFT 
JOIN user_preferences AS ull ON (ull.user_id = users.id) LEFT JOIN 
user_preferences AS eml ON (eml.user_id = users.id) WHERE ull.preferences_key = 
UserLastLogin AND eml.preferences_key = UserEmail AND valid_id = 1 AND 
FROM_UNIXTIME(ull.preferences_value)  DATE_SUB(CURDATE(), INTERVAL 6 MONTH) 
ORDER BY FROM_UNIXTIME(ull.preferences_value)',
+   },
+   2 = {
+   'desc' = 'No login one month, no ticket three months',
+   'cols' = [ qw(login id email lastlogin lastticket) ],
+   'sql' = 'SELECT u.login, u.id, eml.preferences_value, 
DATE_FORMAT(FROM_UNIXTIME(ull.preferences_value), %Y-%m-%d), 
DATE_FORMAT(last_ticket, %Y-%m-%d) FROM users AS u LEFT JOIN user_preferences 
AS ull ON (ull.user_id = u.id) LEFT JOIN user_preferences AS eml ON 
(eml.user_id = u.id) LEFT JOIN (SELECT MAX(change_time) AS last_ticket, user_id 
FROM ticket GROUP BY user_id) AS t ON (t.user_id = u.id) WHERE 
ull.preferences_key = UserLastLogin AND u.valid_id = 1 AND 
eml.preferences_key = UserEmail AND FROM_UNIXTIME(ull.preferences_value)  
DATE_SUB(CURDATE(), INTERVAL 1 MONTH) AND FROM_UNIXTIME(ull.preferences_value) 
= DATE_SUB(CURDATE(), INTERVAL 6 MONTH) AND last_ticket  DATE_SUB(CURDATE(), 
INTERVAL 3 MONTH) GROUP BY u.id ORDER BY last_ticket',
+   },
+   3 = {
+   'desc' = 'Inactive users who occasionally log in',
+   'cols' = [ qw(login id email lastlogin lastticket) ],
+   'sql' = 'SELECT u.login, u.id, eml.preferences_value, 
DATE_FORMAT(FROM_UNIXTIME(ull.preferences_value), %Y-%m-%d), 
DATE_FORMAT(last_ticket, %Y-%m-%d) FROM users AS u LEFT JOIN user_preferences 
AS ull ON (ull.user_id = u.id) LEFT JOIN user_preferences AS eml ON 
(eml.user_id = u.id) LEFT JOIN (SELECT MAX(change_time) AS last_ticket, user_id 
FROM ticket GROUP BY user_id) AS t ON (t.user_id = u.id) WHERE 
ull.preferences_key = UserLastLogin AND u.valid_id = 1 AND 
eml.preferences_key = UserEmail AND last_ticket  DATE_SUB(CURDATE(), 
INTERVAL 120 DAY) GROUP BY u.id ORDER BY last_ticket', 
+
+   },
+};
+
+# I use CGI.pm here instead of the built in stuff to avoid tangling with the
+# OTRS UI libaries. CGI.pm is quick and dirty way to select query and (below)
+# whether or not to output a csv file
+my $q = CGI-new;
+my $params = $q-Vars;
+my $qn = (defined $query-{$params-{'qn'}}) ? $params-{'qn'} : 1;
+
+# essentially boilerplate to create common OTRS objects we'll use for database
+# calls and client authentication
+my %CommonObject = ();
+$CommonObject{'ConfigObject'} = Kernel::Config-new();
+$CommonObject{'LogObject'}= Kernel::System::Log-new(
+   'LogPrefix' = 'idle_agent_report',
+   'ConfigObject' = $CommonObject{'ConfigObject'},
+);
+$CommonObject{'MainObject'}= Kernel::System::Main-new(%CommonObject);
+$CommonObject{'EncodeObject'}  = Kernel::System::Encode-new(%CommonObject);
+$CommonObject{'TimeObject'}= Kernel::System::Time-new(%CommonObject);
+$CommonObject{'DBObject'}  = Kernel::System::DB-new(%CommonObject);
+$CommonObject{'UserObject'}= Kernel::System::User-new(%CommonObject);
+$CommonObject{'GroupObject'}   = 

[MediaWiki-commits] [Gerrit] Final normalisation of WAP detection - change (mediawiki...MobileFrontend)

2013-09-11 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83823


Change subject: Final normalisation of WAP detection
..

Final normalisation of WAP detection

If a browser claims HTML support - it gets HTML, period.

Change-Id: I0abc7aba57bd333609da1fb2c302b6dd60dcb2fb
---
M includes/DeviceDetection.php
1 file changed, 2 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/23/83823/1

diff --git a/includes/DeviceDetection.php b/includes/DeviceDetection.php
index 53fa2b2..09861bb 100644
--- a/includes/DeviceDetection.php
+++ b/includes/DeviceDetection.php
@@ -78,9 +78,8 @@
 * @return string
 */
protected function detectFormat() {
-   if ( strpos( $this-acceptHeader, 'vnd.wap.wml' ) !== false
-strpos( $this-acceptHeader, 'text/html' ) === false
-strpos( $this-acceptHeader, 
'application/vnd.wap.xhtml+xml' ) === false )
+   if ( strpos( $this-acceptHeader, 'text/vnd.wap.wml' ) !== false
+strpos( $this-acceptHeader, 'text/html' ) === false 
)
{
return 'wml';
}

-- 
To view, visit https://gerrit.wikimedia.org/r/83823
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0abc7aba57bd333609da1fb2c302b6dd60dcb2fb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: MaxSem maxsem.w...@gmail.com

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] redeploy OTRS idle_agent_report - change (operations/puppet)

2013-09-11 Thread Jgreen (Code Review)
Jgreen has submitted this change and it was merged.

Change subject: redeploy OTRS idle_agent_report
..


redeploy OTRS idle_agent_report

Change-Id: Ie5151001d03dc276c8588995b97b2f9e4905d5de
---
A files/otrs/idle_agent_report
M manifests/role/otrs.pp
2 files changed, 253 insertions(+), 0 deletions(-)

Approvals:
  Jgreen: Checked; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/files/otrs/idle_agent_report b/files/otrs/idle_agent_report
new file mode 100755
index 000..7e69598
--- /dev/null
+++ b/files/otrs/idle_agent_report
@@ -0,0 +1,247 @@
+#!/usr/bin/perl
+use strict;
+use CGI;
+use FindBin qw($Bin); # use ../ as lib location
+use lib $Bin/../..;
+use lib $Bin/../../Kernel/cpan-lib;
+use Kernel::Config;
+use Kernel::System::Time;
+use Kernel::System::Log;
+use Kernel::System::Main;
+use Kernel::System::Encode;
+use Kernel::System::User;
+use Kernel::System::Group;
+use Kernel::System::DB;
+use Kernel::System::Auth;
+use Kernel::System::AuthSession;
+
+# if any of these queries returns 5K rows we have a problem
+my $rowlimit = 5000;
+
+
+# http://dev.otrs.org/2.4/Kernel/System/Group.html
+# http://meta.wikimedia.org/wiki/OTRS#OTRS_administrators
+my %RoleOK2View = (
+   'OTRS admins' = 1,
+   'Wikimedia Technical Staff' = 1,
+);
+
+# reporting queries provided by Philippe, simply numbered for easy access from 
URI query string
+# stab otrs db libs for lacking fetchrow hashref
+my $query = {
+   1 = {
+   'desc' = 'Last login over 6 months',
+   'cols' = [ qw(login id email lastlogin) ],
+   'sql' = 'SELECT login, id, eml.preferences_value, 
DATE_FORMAT(FROM_UNIXTIME(ull.preferences_value), %Y-%m-%d) FROM users LEFT 
JOIN user_preferences AS ull ON (ull.user_id = users.id) LEFT JOIN 
user_preferences AS eml ON (eml.user_id = users.id) WHERE ull.preferences_key = 
UserLastLogin AND eml.preferences_key = UserEmail AND valid_id = 1 AND 
FROM_UNIXTIME(ull.preferences_value)  DATE_SUB(CURDATE(), INTERVAL 6 MONTH) 
ORDER BY FROM_UNIXTIME(ull.preferences_value)',
+   },
+   2 = {
+   'desc' = 'No login one month, no ticket three months',
+   'cols' = [ qw(login id email lastlogin lastticket) ],
+   'sql' = 'SELECT u.login, u.id, eml.preferences_value, 
DATE_FORMAT(FROM_UNIXTIME(ull.preferences_value), %Y-%m-%d), 
DATE_FORMAT(last_ticket, %Y-%m-%d) FROM users AS u LEFT JOIN user_preferences 
AS ull ON (ull.user_id = u.id) LEFT JOIN user_preferences AS eml ON 
(eml.user_id = u.id) LEFT JOIN (SELECT MAX(change_time) AS last_ticket, user_id 
FROM ticket GROUP BY user_id) AS t ON (t.user_id = u.id) WHERE 
ull.preferences_key = UserLastLogin AND u.valid_id = 1 AND 
eml.preferences_key = UserEmail AND FROM_UNIXTIME(ull.preferences_value)  
DATE_SUB(CURDATE(), INTERVAL 1 MONTH) AND FROM_UNIXTIME(ull.preferences_value) 
= DATE_SUB(CURDATE(), INTERVAL 6 MONTH) AND last_ticket  DATE_SUB(CURDATE(), 
INTERVAL 3 MONTH) GROUP BY u.id ORDER BY last_ticket',
+   },
+   3 = {
+   'desc' = 'Inactive users who occasionally log in',
+   'cols' = [ qw(login id email lastlogin lastticket) ],
+   'sql' = 'SELECT u.login, u.id, eml.preferences_value, 
DATE_FORMAT(FROM_UNIXTIME(ull.preferences_value), %Y-%m-%d), 
DATE_FORMAT(last_ticket, %Y-%m-%d) FROM users AS u LEFT JOIN user_preferences 
AS ull ON (ull.user_id = u.id) LEFT JOIN user_preferences AS eml ON 
(eml.user_id = u.id) LEFT JOIN (SELECT MAX(change_time) AS last_ticket, user_id 
FROM ticket GROUP BY user_id) AS t ON (t.user_id = u.id) WHERE 
ull.preferences_key = UserLastLogin AND u.valid_id = 1 AND 
eml.preferences_key = UserEmail AND last_ticket  DATE_SUB(CURDATE(), 
INTERVAL 120 DAY) GROUP BY u.id ORDER BY last_ticket', 
+
+   },
+};
+
+# I use CGI.pm here instead of the built in stuff to avoid tangling with the
+# OTRS UI libaries. CGI.pm is quick and dirty way to select query and (below)
+# whether or not to output a csv file
+my $q = CGI-new;
+my $params = $q-Vars;
+my $qn = (defined $query-{$params-{'qn'}}) ? $params-{'qn'} : 1;
+
+# essentially boilerplate to create common OTRS objects we'll use for database
+# calls and client authentication
+my %CommonObject = ();
+$CommonObject{'ConfigObject'} = Kernel::Config-new();
+$CommonObject{'LogObject'}= Kernel::System::Log-new(
+   'LogPrefix' = 'idle_agent_report',
+   'ConfigObject' = $CommonObject{'ConfigObject'},
+);
+$CommonObject{'MainObject'}= Kernel::System::Main-new(%CommonObject);
+$CommonObject{'EncodeObject'}  = Kernel::System::Encode-new(%CommonObject);
+$CommonObject{'TimeObject'}= Kernel::System::Time-new(%CommonObject);
+$CommonObject{'DBObject'}  = Kernel::System::DB-new(%CommonObject);
+$CommonObject{'UserObject'}= Kernel::System::User-new(%CommonObject);
+$CommonObject{'GroupObject'}   = Kernel::System::Group-new(%CommonObject);

[MediaWiki-commits] [Gerrit] Fix auto-summary in delete.py - change (pywikibot/compat)

2013-09-11 Thread Xqt (Code Review)
Xqt has submitted this change and it was merged.

Change subject: Fix auto-summary in delete.py
..


Fix auto-summary in delete.py

mysite was not defined. pywikibot.handleArgs is guaranteed to return
a list (as opposed to a generator) after parsing all global arguments
(such as -lang and -family). This means it's safe to call
pywikibot.getSite immediately after handleArgs, but before handling
local arguments.

Change-Id: I0bd76806e460fec200973a712370e459c9189ea7
Fixes-Change-Id: I386328c62b1bbeb7022a620f8e95d25a67686371
---
M delete.py
1 file changed, 6 insertions(+), 3 deletions(-)

Approvals:
  Xqt: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/delete.py b/delete.py
index d1e2c13..b51a594 100644
--- a/delete.py
+++ b/delete.py
@@ -75,7 +75,10 @@
 generator = None
 
 # read command line parameters
-for arg in pywikibot.handleArgs():
+localargs = pywikibot.handleArgs()
+mysite = pywikibot.getSite()
+
+for arg in localargs:
 if arg == '-always':
 always = True
 elif arg.startswith('-summary'):
@@ -105,7 +108,7 @@
 summary = i18n.twtranslate(mysite, 'delete-referring-pages', 
{'page': pageName})
 elif arg.startswith('-file'):
 summary = i18n.twtranslate(mysite, 'delete-from-file')
-mysite = pywikibot.getSite()
+
 if doImages:
 if not summary:
 summary = i18n.twtranslate(mysite, 'delete-images',
@@ -131,4 +134,4 @@
 try:
 main()
 finally:
-pywikibot.stopme()
\ No newline at end of file
+pywikibot.stopme()

-- 
To view, visit https://gerrit.wikimedia.org/r/83808
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0bd76806e460fec200973a712370e459c9189ea7
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Merlijn van Deen valhall...@arctus.nl
Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com
Gerrit-Reviewer: Legoktm legoktm.wikipe...@gmail.com
Gerrit-Reviewer: Xqt i...@gno.de
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Use the language of the page, not necessarily the general site - change (pywikibot/core)

2013-09-11 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Use the language of the page, not necessarily the general site
..


Use the language of the page, not necessarily the general site

It's possible that the user specificies a generator like
-cat:zh:Category:Blah, in which case the value of
pywikibot.Site().language() may not be zh, depending
on the user's config. It's also possible that in the future
a generator will yield pages on multiple projects, so this
guards against that as well.

Change-Id: Ic1f10118a2dff93b71861b7ea97f7da22908cb04
---
M scripts/claimit.py
M scripts/harvest_template.py
2 files changed, 46 insertions(+), 29 deletions(-)

Approvals:
  Merlijn van Deen: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/scripts/claimit.py b/scripts/claimit.py
index 0f50db0..e72e804 100755
--- a/scripts/claimit.py
+++ b/scripts/claimit.py
@@ -33,23 +33,29 @@
 self.generator = generator
 self.claims = claims
 self.repo = pywikibot.Site().data_repository()
-self.source = None
-self.setSource(pywikibot.Site().language())
+self.cacheSources()
 
-def setSource(self, lang):
+def getSource(self, lang):
 
-Get the source
+Get the source for the specified language,
+if possible
 
-page = pywikibot.Page(self.repo, 'Wikidata:List of wikis/python')
-source_values = json.loads(page.get())
-source_values = source_values['wikipedia']
-for source_lang in source_values:
-source_values[source_lang] = pywikibot.ItemPage(self.repo,
-
source_values[source_lang])
+if lang in self.source_values:
+source = pywikibot.Claim(self.repo, 'p143')
+source.setTarget(self.source_values.get(lang))
+return source
 
-if lang in source_values:
-self.source = pywikibot.Claim(self.repo, 'p143')
-self.source.setTarget(source_values.get(lang))
+def cacheSources(self):
+
+Fetches the sources from the onwiki list
+and stores it internally
+
+page = pywikibot.Page(self.repo, u'Wikidata:List of wikis/python')
+self.source_values = json.loads(page.get())
+self.source_values = self.source_values['wikipedia']
+for source_lang in self.source_values:
+self.source_values[source_lang] = pywikibot.ItemPage(self.repo,
+ 
self.source_values[source_lang])
 
 def run(self):
 
@@ -72,8 +78,10 @@
 pywikibot.output('Adding %s -- %s'
  % (claim.getID(), claim.getTarget()))
 item.addClaim(claim)
-if self.source:
-claim.addSource(self.source, bot=True)
+# A generator might yield pages from multiple languages
+source = self.getSource(page.site.language())
+if source:
+claim.addSource(source, bot=True)
 # TODO FIXME: We need to check that we aren't adding a
 # duplicate
 
diff --git a/scripts/harvest_template.py b/scripts/harvest_template.py
index 2bc5ace..40e43a3 100755
--- a/scripts/harvest_template.py
+++ b/scripts/harvest_template.py
@@ -45,22 +45,29 @@
 # TODO: Make it a list which also includes the redirects to the 
template
 self.fields = fields
 self.repo = pywikibot.Site().data_repository()
-self.source = None
-self.setSource(pywikibot.Site().language())
+self.cacheSources()
 
-def setSource(self, lang):
+def getSource(self, lang):
 
-Get the source
+Get the source for the specified language,
+if possible
 
-page = pywikibot.Page(self.repo, 'Wikidata:List of wikis/python')
-source_values = json.loads(page.get())
-source_values = source_values['wikipedia']
-for source_lang in source_values:
-source_values[source_lang] = pywikibot.ItemPage(self.repo, 
source_values[source_lang])
+if lang in self.source_values:
+source = pywikibot.Claim(self.repo, 'p143')
+source.setTarget(self.source_values.get(lang))
+return source
 
-if lang in source_values:
-self.source = pywikibot.Claim(self.repo, 'p143')
-self.source.setTarget(source_values.get(lang))
+def cacheSources(self):
+
+Fetches the sources from the onwiki list
+and stores it internally
+
+page = pywikibot.Page(self.repo, u'Wikidata:List of wikis/python')
+self.source_values = json.loads(page.get())
+self.source_values = 

[MediaWiki-commits] [Gerrit] BlockInspectorTool and StickerToolbar - change (mediawiki...VisualEditor)

2013-09-11 Thread Mooeypoo (Code Review)
Mooeypoo has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83826


Change subject: BlockInspectorTool and StickerToolbar
..

BlockInspectorTool and StickerToolbar

This change adds a 'BlockInspectorTool' whose purpose is to be used for
block nodes. The tool will have two functions; add a block node or edit
and existing block node. The add functionality is used when the tool is
called from the general toolbar, but the edit functionality is called when
this tool is called from the specific StickerToolbar that is associated
with the existing block node.

For the moment, this functionality is designed to be used mainly with the
languageblock div functionality, but it is designed to be generalized so
it can be used with other block nodes, like tables, etc.

In this change:
* BlockInspectorTool - defines a new sublcass for the inspector tool that
  is meant to work with block nodes for either edit or add functions.
* BlockInspectorAction - calls the designated inspector and sends over
  the edit details if needed. If the tool was called from the sticker
  toolbar, there is an associated ve.dm.Node that will be sent to the
  inspector.
* StickerToolbar - defines a new subclass for the toolbar that is
  specifically attached to a blocknode (through the upcoming 'stickernode'
  mixin. The new subclass allows to attach a specific node to the toolbar
  so the buttons and inspectors within it are associated with that node
  for editing.

Change-Id: I5efff0741eec68c820b29a7b8e68729ad2889f3d
---
M VisualEditor.php
A modules/ve/ui/actions/ve.ui.BlockInspectorAction.js
A modules/ve/ui/tools/ve.ui.BlockInspectorTool.js
A modules/ve/ui/ve.ui.StickerToolbar.js
4 files changed, 160 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/26/83826/1

diff --git a/VisualEditor.php b/VisualEditor.php
index 6327d7e..4920ed4 100644
--- a/VisualEditor.php
+++ b/VisualEditor.php
@@ -702,6 +702,9 @@
've/ce/annotations/ve.ce.LanguageAnnotation.js',
've/ui/inspectors/ve.ui.LanguageInspector.js',
've/ui/widgets/ve.ui.LanguageInputWidget.js',
+   've/ui/tools/ve.ui.BlockInspectorTool.js',
+   've/ui/actions/ve.ui.BlockInspectorAction.js',
+   've/ui/ve.ui.StickerToolbar.js',
've/ui/tools/ve.ui.ExperimentalTool.js',
've-mw/ui/tools/ve.ui.MWExperimentalTool.js',
),
diff --git a/modules/ve/ui/actions/ve.ui.BlockInspectorAction.js 
b/modules/ve/ui/actions/ve.ui.BlockInspectorAction.js
new file mode 100644
index 000..ca16783
--- /dev/null
+++ b/modules/ve/ui/actions/ve.ui.BlockInspectorAction.js
@@ -0,0 +1,57 @@
+/*!
+ * VisualEditor UserInterface BlockInspectorAction class.
+ * Handling actions coming from an inspector of blocks or stickeredNodes
+ *
+ * @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
+ * @license The MIT License (MIT); see LICENSE.txt
+ */
+
+/**
+ * BlockInspector action.
+ *
+ * @class
+ * @extends ve.ui.Action
+ * @constructor
+ * @param {ve.ui.Surface} surface Surface to act on
+ */
+ve.ui.BlockInspectorAction = function VeUiBlockInspectorAction( surface ) {
+   // Parent constructor
+   ve.ui.Action.call( this, surface );
+};
+
+/* Inheritance */
+
+ve.inheritClass( ve.ui.BlockInspectorAction, ve.ui.Action );
+
+/* Static Properties */
+
+/**
+ * List of allowed methods for the action.
+ *
+ * @static
+ * @property
+ */
+ve.ui.BlockInspectorAction.static.methods = ['open', 'close'];
+
+/* Methods */
+
+/**
+ * Open an inspector.
+ *
+ * @method
+ * @param {string} name Symbolic name of inspector to open
+ * @param {boolean} isEditBlockAction dictates whether this is an 'edit' 
action for the block
+ * @param {ve.dm.Node} nodeModel if we are in 'edit' mode, this is the 
nodeModel that is to be edited
+ */
+ve.ui.BlockInspectorAction.prototype.open = function ( name, 
isEditBlockAction, nodeModel ) {
+   var props = {
+   'isBlock': true,
+   'isEditBlockAction': isEditBlockAction,
+   'nodeModel': nodeModel
+   };
+   this.surface.getContext().openInspector( name, props );
+};
+
+/* Registration */
+
+ve.ui.actionFactory.register( 'blockinspector', ve.ui.BlockInspectorAction );
diff --git a/modules/ve/ui/tools/ve.ui.BlockInspectorTool.js 
b/modules/ve/ui/tools/ve.ui.BlockInspectorTool.js
new file mode 100644
index 000..0ed759d
--- /dev/null
+++ b/modules/ve/ui/tools/ve.ui.BlockInspectorTool.js
@@ -0,0 +1,61 @@
+/*!
+ * VisualEditor UserInterface InspectorTool classes.
+ *
+ * @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
+ * @license The MIT License (MIT); see LICENSE.txt
+ */
+
+/**
+ * UserInterface block inspector tool for block nodes 

[MediaWiki-commits] [Gerrit] Parameter type hints - change (mediawiki...Mpdf)

2013-09-11 Thread Reedy (Code Review)
Reedy has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83825


Change subject: Parameter type hints
..

Parameter type hints

Remove unused globals

Fix mixed spaces and tabs

Change-Id: I41a697c19ca06da4c0d0fdd89559a32bfdc40856
---
M Mpdf.hooks.php
M Mpdf.php
2 files changed, 38 insertions(+), 24 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Mpdf 
refs/changes/25/83825/1

diff --git a/Mpdf.hooks.php b/Mpdf.hooks.php
index 1013ac7..9206c3d 100644
--- a/Mpdf.hooks.php
+++ b/Mpdf.hooks.php
@@ -4,10 +4,14 @@
 
/**
 * Perform the export operation
+*
+* @param $action
+* @param Article $article
+*
+* @return bool
 */
public static function onUnknownAction( $action, $article ) {
global $wgOut, $wgRequest;
-   global $wgServer, $wgArticlePath, $wgScriptPath, $wgUploadPath, 
$wgUploadDirectory, $wgScript;
 
if( $action == 'mpdf' ) {
 
@@ -20,7 +24,7 @@
 
$wgOut-addWikiText( $text );
$wgOut-setHTMLTitle( $titletext );
-   
+
ob_start();
$wgOut-output();
$html=ob_get_contents();
@@ -52,8 +56,12 @@
 
/**
 * Add PDF to actions tabs in MonoBook based skins
+* @param Skin $skin
+* @param array $actions
+*
+* @return bool true
 */
-   public static function onSkinTemplateTabs( $skin, $actions) {
+   public static function onSkinTemplateTabs( $skin, $actions ) {
global $wgMpdfTab;
 
if ( $wgMpdfTab ) {
@@ -69,6 +77,10 @@
 
/**
 * Add PDF to actions tabs in vector based skins
+* @param Skin $skin
+* @param array $actions
+*
+* @return bool true
 */
public static function onSkinTemplateNavigation( $skin, $actions ) {
global $wgMpdfTab;
@@ -82,24 +94,26 @@
}
return true;
}
-
-public static function mpdftags_Render( $parser )
-{
-// Get the parameters that were passed to this function
-$params = func_get_args();
-array_shift( $params );
 
-// Replace open and close tag for security reason
-$params = str_replace(array('', ''), array('lt;', 'gt;'), 
$params);
-
-// Insert mpdf tags between !--mpdf ... mpdf--
-$ret = !--mpdf ;
-foreach ($params as $value) {
-$ret.=.  $value . /\n;
-}
-
-//Return mpdf tags as raw html
-return $parser-insertStripItem( $ret.mpdf--\n, 
$parser-mStripState );
-
-}
+   /**
+* @param $parser Parser
+* @return mixed
+*/
+   public static function mpdftags_Render( $parser ) {
+   // Get the parameters that were passed to this function
+   $params = func_get_args();
+   array_shift( $params );
+
+   // Replace open and close tag for security reason
+   $params = str_replace(array('', ''), array('lt;', 'gt;'), 
$params);
+
+   // Insert mpdf tags between !--mpdf ... mpdf--
+   $ret = !--mpdf ;
+   foreach ($params as $value) {
+   $ret.=.  $value . /\n;
+   }
+
+   //Return mpdf tags as raw html
+   return $parser-insertStripItem( $ret.mpdf--\n, 
$parser-mStripState );
+   }
 }
diff --git a/Mpdf.php b/Mpdf.php
index ea6e684..79c39a0 100644
--- a/Mpdf.php
+++ b/Mpdf.php
@@ -45,7 +45,7 @@
 $wgHooks['SkinTemplateTabs'][] = 'MpdfHooks::onSkinTemplateTabs';
 $wgHooks['SkinTemplateNavigation'][] = 'MpdfHooks::onSkinTemplateNavigation';
 
-function mpdf_Setup( Parser $parser )   {
+function mpdf_Setup( Parser $parser ) {
$parser-setFunctionHook( 'mpdftags', 'MpdfHooks::mpdftags_Render' );
return true;
-}
\ No newline at end of file
+}

-- 
To view, visit https://gerrit.wikimedia.org/r/83825
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I41a697c19ca06da4c0d0fdd89559a32bfdc40856
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Mpdf
Gerrit-Branch: master
Gerrit-Owner: Reedy re...@wikimedia.org

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Remove one last ceph reference - change (operations/mediawiki-config)

2013-09-11 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Remove one last ceph reference
..


Remove one last ceph reference

Change-Id: I5cda5ac338e1b1b3db68c47891d0f5e3474283ee
---
M wmf-config/filebackend.php
1 file changed, 1 insertion(+), 2 deletions(-)

Approvals:
  Chad: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/wmf-config/filebackend.php b/wmf-config/filebackend.php
index d556e32..0438c67 100644
--- a/wmf-config/filebackend.php
+++ b/wmf-config/filebackend.php
@@ -105,8 +105,7 @@
'lockManager' = 'nullLockManager',
'backends'= array(
# DO NOT change the master backend unless it is fully trusted 
or autoRsync is off
-   array( 'template' = 'global-swift', 'isMultiMaster' = true ),
-   array( 'template' = 'global-ceph', 'isMultiMaster' = false )
+   array( 'template' = 'global-swift', 'isMultiMaster' = true )
),
'syncChecks'  = ( 1 | 4 ), // (size  sha1)
'autoResync'  = 'conservative'

-- 
To view, visit https://gerrit.wikimedia.org/r/83820
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I5cda5ac338e1b1b3db68c47891d0f5e3474283ee
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz asch...@wikimedia.org
Gerrit-Reviewer: Chad ch...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Add skeleton for script to monitor geowiki-data files - change (analytics/geowiki)

2013-09-11 Thread QChris (Code Review)
QChris has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83809


Change subject: Add skeleton for script to monitor geowiki-data files
..

Add skeleton for script to monitor geowiki-data files

Change-Id: I43a6a4db26cb206ea40868488e67257f49111284
---
A scripts/check_web_page.sh
1 file changed, 46 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/geowiki 
refs/changes/09/83809/1

diff --git a/scripts/check_web_page.sh b/scripts/check_web_page.sh
new file mode 100755
index 000..fe14dea
--- /dev/null
+++ b/scripts/check_web_page.sh
@@ -0,0 +1,46 @@
+#!/bin/bash
+#
+# This script checks if the geowiki files on the wmf webpages are up
+# to date and it's numbers are within reasonable ranges.
+#
+
+set -e
+
+# Absolute path to this script
+SCRIPT_DIR_ABS=$(dirname $0)
+
+#---
+# Dumps an error message to stderr and exits the script
+#
+# Concatenation of Error: $1, $2, ... gets used as error message.
+#
+# Input:
+#   $1, $2, ... used as error message
+#
+# Output:
+#   -
+#
+error() {
+echo Error: $@ 2
+exit 1
+}
+
+#---
+# Checks that geowiki's files are ok.
+#
+# Input:
+#   -
+#
+# Output:
+#   -
+#
+check() {
+error not yet implemented
+}
+
+
+#---
+
+check
+
+echo geowiki: Ok

-- 
To view, visit https://gerrit.wikimedia.org/r/83809
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I43a6a4db26cb206ea40868488e67257f49111284
Gerrit-PatchSet: 1
Gerrit-Project: analytics/geowiki
Gerrit-Branch: master
Gerrit-Owner: QChris christ...@quelltextlich.at

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Add getKeys optimization to BannerMessageGroup - change (mediawiki...CentralNotice)

2013-09-11 Thread Nikerabbit (Code Review)
Nikerabbit has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83827


Change subject: Add getKeys optimization to BannerMessageGroup
..

Add getKeys optimization to BannerMessageGroup

This avoids the wfMessage calls to load message content.

Bug: 53769
Bug: 53769
Change-Id: I14cdda777e3a70cda78d2f52d59b6ad569619571
---
M includes/BannerMessageGroup.php
1 file changed, 27 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralNotice 
refs/changes/27/83827/1

diff --git a/includes/BannerMessageGroup.php b/includes/BannerMessageGroup.php
index 38c13c8..50e941d 100644
--- a/includes/BannerMessageGroup.php
+++ b/includes/BannerMessageGroup.php
@@ -32,6 +32,33 @@
}
 
/**
+* This is optimized version of getDefinitions that only returns
+* message keys to speed up message index creation.
+* @return array
+*/
+   public function getKeys() {
+   $keys = array();
+
+   $banner = Banner::fromName( $this-bannerName );
+   $fields = $banner-extractMessageFields();
+
+   // The MediaWiki page name convention for messages is the same 
as the
+   // convention for banners themselves, except that it doesn't 
include
+   // the 'template' designation.
+   if ( $this-namespace == NS_CN_BANNER ) {
+   $msgKeyPrefix = $this-bannerName . '-';
+   } else {
+   $msgKeyPrefix = Centralnotice-{$this-bannerName}-;
+   }
+
+   foreach ( array_keys( $fields ) as $msgName ) {
+   $keys[] = $msgKeyPrefix . $msgName;
+   }
+
+   return $keys;
+   }
+
+   /**
 * Fetch the messages for the banner
 * @return array Array of message keys with definitions.
 */

-- 
To view, visit https://gerrit.wikimedia.org/r/83827
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I14cdda777e3a70cda78d2f52d59b6ad569619571
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralNotice
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit niklas.laxst...@gmail.com

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Integrate with BetaPreferences - change (mediawiki...VisualEditor)

2013-09-11 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Integrate with BetaPreferences
..


Integrate with BetaPreferences

Look at logo Michael.

Bug: 52686
Change-Id: I3cfada2ea264184698de5f322c1fe5041b37b8c8
---
M VisualEditor.hooks.php
M VisualEditor.i18n.php
M VisualEditor.php
A logo-experimental.png
A logo-experimental.svg
M modules/ve-mw/init/ve.init.mw.Target.js
6 files changed, 108 insertions(+), 5 deletions(-)

Approvals:
  Catrope: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/VisualEditor.hooks.php b/VisualEditor.hooks.php
index a484702..17f9016 100644
--- a/VisualEditor.hooks.php
+++ b/VisualEditor.hooks.php
@@ -230,6 +230,19 @@
return true;
}
 
+   public static function onGetBetaPreferences( $user, $preferences ) {
+   global $wgExtensionAssetsPath;
+
+   $preferences['visualeditor-enable-experimental'] = array(
+   'version' = '1.0',
+   'label-message' = 
'visualeditor-preference-experimental-label',
+   'desc-message' = 
'visualeditor-preference-experimental-description',
+   'info-link' = 
'visualeditor-preference-experimental-info-link',
+   'discussion-link' = 
'visualeditor-preference-experimental-discussion-link',
+   'screenshot' = $wgExtensionAssetsPath . 
'/VisualEditor/logo-experimental.png',
+   );
+   }
+
public static function onListDefinedTags( $tags ) {
$tags[] = 'visualeditor';
$tags[] = 'visualeditor-needcheck';
@@ -273,8 +286,9 @@
'namespaces' = $wgVisualEditorNamespaces,
'pluginModules' = $wgVisualEditorPluginModules,
'defaultUserOptions' = array(
-   'enable' = 
$wgDefaultUserOptions['visualeditor-enable'],
'betatempdisable' = 
$wgDefaultUserOptions['visualeditor-betatempdisable'],
+   'enable' = 
$wgDefaultUserOptions['visualeditor-enable'],
+   'experimental' = 
$wgDefaultUserOptions['visualeditor-enable-experimental'],
),
'skins' = self::$supportedSkins,
'tabPosition' = $wgVisualEditorTabPosition,
diff --git a/VisualEditor.i18n.php b/VisualEditor.i18n.php
index a74138a..c1115ca 100644
--- a/VisualEditor.i18n.php
+++ b/VisualEditor.i18n.php
@@ -163,6 +163,8 @@
'visualeditor-parameter-search-unknown' = 'Unknown parameter',
'visualeditor-preference-betatempdisable' = 'Temporarily disable 
VisualEditor while it is in beta',
'visualeditor-preference-enable' = 'Enable VisualEditor (only in the 
[[{{MediaWiki:visualeditor-mainnamespacepagelink}}|main]] and 
[[{{MediaWiki:visualeditor-usernamespacepagelink}}|user]] namespaces)',
+   'visualeditor-preference-experimental-description' = 'Enable the 
latest features inside VisualEditor. As we develop tools and make changes for 
the editor, we make them available for testing ahead of general release. Please 
remember to always review your changes before saving when using experimental 
features.',
+   'visualeditor-preference-experimental-label' = 'VisualEditor 
experimental features',
'visualeditor-reference-input-placeholder' = 'What do you want to 
reference?',
'visualeditor-referencelist-isempty' = 'There are no references with 
the group $1 on this page.',
'visualeditor-referencelist-missingref' = 'This reference is defined 
in a template or other generated block, and for now can only be edited in 
source mode.',
@@ -504,6 +506,8 @@
'visualeditor-preference-betatempdisable' = 'Label for the temporary 
user preference to disable VisualEditor while it is in beta.',
'visualeditor-preference-enable' = 'Label for the user preference to 
enable VisualEditor while it is in alpha (opt-in) mode.
 Links are in {{msg-mw|Visualeditor-mainnamespacepagelink}} and 
{{msg-mw|visualeditor-usernamespacepagelink}}.',
+   'visualeditor-preference-experimental-description' = 'Description of 
VisualEditor experimental features',
+   'visualeditor-preference-experimental-label' = 'Label for option to 
enable VisualEditor experimental features',
'visualeditor-reference-input-placeholder' = 'Placeholder text for 
reference search field: searches existing on-page references.',
'visualeditor-referencelist-isempty' = 'Message that appears in the 
references list when there are no references on the page of that group.
 
diff --git a/VisualEditor.php b/VisualEditor.php
index 6327d7e..1253a1a 100644
--- a/VisualEditor.php
+++ b/VisualEditor.php
@@ -48,6 +48,9 @@
 // Register Hooks
 $wgHooks['BeforePageDisplay'][] = 'VisualEditorHooks::onBeforePageDisplay';
 

[MediaWiki-commits] [Gerrit] Alpha: Temporarily remove Firefox from supported browser for... - change (mediawiki...MobileFrontend)

2013-09-11 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83828


Change subject: Alpha: Temporarily remove Firefox from supported browser for 
history api
..

Alpha: Temporarily remove Firefox from supported browser for history api

Page redirects to undefined

Change-Id: I218da5f75662542cab3dc4c66b10a78c2ddc3e2c
---
M javascripts/externals/epoch.js
1 file changed, 1 insertion(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/28/83828/1

diff --git a/javascripts/externals/epoch.js b/javascripts/externals/epoch.js
index a122d04..619f484 100644
--- a/javascripts/externals/epoch.js
+++ b/javascripts/externals/epoch.js
@@ -20,9 +20,7 @@
// iOS 5+
ua.match( /OS [5-9]_.*like Mac OS X/ ) ||
// iOS 10+ (future proofing)
-   ua.match( /OS [1-9][0-9]_.*like Mac OS X/ ) ||
-   // Firefox (ignoring version  4 in the check)
-   ua.match( /Firefox/ )
+   ua.match( /OS [1-9][0-9]_.*like Mac OS X/ )
) ? true : false;
}
 

-- 
To view, visit https://gerrit.wikimedia.org/r/83828
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I218da5f75662542cab3dc4c66b10a78c2ddc3e2c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson jrob...@wikimedia.org

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Fix off-by-one error with metadata-mutating transactions. - change (mediawiki...VisualEditor)

2013-09-11 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Fix off-by-one error with metadata-mutating transactions.
..


Fix off-by-one error with metadata-mutating transactions.

Add some test cases for documents with trailing metadata, and fix an
off-by-one error in the metadata-mutating transactions (since the
document metadata array is one larger than the document data array).

Change-Id: I8f049466e03ed55010dfcf0a35702536edfa7b0a
---
M modules/ve/dm/ve.dm.Transaction.js
M modules/ve/test/dm/ve.dm.Transaction.test.js
M modules/ve/test/dm/ve.dm.TransactionProcessor.test.js
M modules/ve/test/dm/ve.dm.example.js
4 files changed, 157 insertions(+), 10 deletions(-)

Approvals:
  Catrope: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/ve/dm/ve.dm.Transaction.js 
b/modules/ve/dm/ve.dm.Transaction.js
index 6719110..9ba29e1 100644
--- a/modules/ve/dm/ve.dm.Transaction.js
+++ b/modules/ve/dm/ve.dm.Transaction.js
@@ -320,7 +320,7 @@
// Retain up to end of metadata elements (second dimension)
tx.pushRetainMetadata( elements.length - index );
// Retain to end of document
-   tx.pushRetain( data.getLength() - offset );
+   tx.pushRetain( doc.data.getLength() - offset );
return tx;
 };
 
@@ -364,12 +364,12 @@
// Retain up to end of metadata elements (second dimension)
tx.pushRetainMetadata( elements.length - range.end );
// Retain to end of document
-   tx.pushRetain( data.getLength() - offset );
+   tx.pushRetain( doc.data.getLength() - offset );
return tx;
 };
 
 /**
- * Generate a transaction that relaces a single metadata element.
+ * Generate a transaction that replaces a single metadata element.
  *
  * @static
  * @method
@@ -403,7 +403,7 @@
// Retain up to end of metadata elements (second dimension)
tx.pushRetainMetadata( elements.length - index - 1 );
// Retain to end of document
-   tx.pushRetain( data.length - offset );
+   tx.pushRetain( doc.data.getLength() - offset );
return tx;
 };
 
diff --git a/modules/ve/test/dm/ve.dm.Transaction.test.js 
b/modules/ve/test/dm/ve.dm.Transaction.test.js
index cbd363b..8d188d8 100644
--- a/modules/ve/test/dm/ve.dm.Transaction.test.js
+++ b/modules/ve/test/dm/ve.dm.Transaction.test.js
@@ -47,6 +47,7 @@
doc = ve.dm.example.createExampleDocument(),
isolationDoc = ve.dm.example.createExampleDocument( 
'isolationData' ),
complexTableDoc = ve.dm.example.createExampleDocument( 
'complexTable' ),
+   listWithMetaDoc = ve.dm.example.createExampleDocument( 
'listWithMeta' ),
doc2 = new ve.dm.Document(
ve.dm.example.preprocessAnnotations( [ { 'type': 
'paragraph' }, { 'type': '/paragraph' } ] )
),
@@ -307,6 +308,18 @@
]
},
{ 'type': 'retain', 'length': 13 }
+   ]
+   },
+   'preserving trailing metadata': {
+   'args': [ listWithMetaDoc, 4, [ 'b' ] ],
+   'ops': [
+   { 'type': 'retain', 'length': 4 },
+   {
+   'type': 'replace',
+   'remove': [],
+   'insert': [ 'b' ]
+   },
+   { 'type': 'retain', 'length': 8 }
]
}
// TODO test cases for unclosed openings
@@ -1581,6 +1594,7 @@
 
 QUnit.test( 'newFromMetadataInsertion', function ( assert ) {
var doc = ve.dm.example.createExampleDocument( 'withMeta' ),
+   listWithMetaDoc = ve.dm.example.createExampleDocument( 
'listWithMeta' ),
element = {
'type': 'alienMeta',
'attributes': {
@@ -1600,7 +1614,7 @@
'insert': [ element ]
},
{ 'type': 'retainMetadata', 'length': 2 
},
-   { 'type': 'retain', 'length': 3 }
+   { 'type': 'retain', 'length': 2 }
]
},
'inserting metadata element into empty list': {
@@ -1612,7 +1626,31 @@
'remove': [],
'insert': [ element ]
},
-   { 

[MediaWiki-commits] [Gerrit] Support coordinate and entityidvalue in autossummaries - change (mediawiki...Wikibase)

2013-09-11 Thread Daniel Kinzler (Code Review)
Daniel Kinzler has submitted this change and it was merged.

Change subject: Support coordinate and entityidvalue in autossummaries
..


Support coordinate and entityidvalue in autossummaries

- this affects all API modules using ChangeOpMainSnak
- this is a fix for deployment only
- coordinates were just left blank in the summaries till now
- also the entityid were not shown anymore due to the changes in the
  EntityId class
- on master this should be fixed using formatters

Bug: 54005
Change-Id: Ib6df76009157b867e051f8d3fea822636bf850e9
---
M repo/includes/changeop/ChangeOpMainSnak.php
1 file changed, 17 insertions(+), 2 deletions(-)

Approvals:
  Aude: Verified; Looks good to me, but someone else must approve
  Daniel Kinzler: Looks good to me, approved



diff --git a/repo/includes/changeop/ChangeOpMainSnak.php 
b/repo/includes/changeop/ChangeOpMainSnak.php
index 247e5a1..00f2b9e 100644
--- a/repo/includes/changeop/ChangeOpMainSnak.php
+++ b/repo/includes/changeop/ChangeOpMainSnak.php
@@ -5,6 +5,8 @@
 use InvalidArgumentException;
 use Wikibase\Snak;
 use Wikibase\Lib\EntityIdFormatter;
+use Wikibase\DataModel\Entity\EntityIdValue;
+use DataValues\GlobeCoordinateValue;
 
 /**
  * Class for mainsnak change operation
@@ -179,11 +181,24 @@
protected function getClaimSummaryArgs( Snak $mainSnak ) {
$propertyId = $this-idFormatter-format( 
$mainSnak-getPropertyId() );
 
-   //TODO: use formatters here!
if ( $mainSnak instanceof PropertyValueSnak ) {
$value = $mainSnak-getDataValue();
+
+   // TODO: we should use value formatters here!
+   if ( $value instanceof EntityIdValue ) {
+   $value = $value-getEntityId();
+   } elseif ( $value instanceof TimeValue ) {
+   $value = $value-getTime();
+   } elseif ( $value instanceof GlobeCoordinateValue ) {
+   $value = $value-getLatitude() . ', ' . 
$value-getLongitude();
+   } elseif ( is_string( $value-getValue() ) ) {
+   $value = $value-getValue();
+   } else {
+   //type not supported;
+   $value = ;
+   }
} else {
-   $value = $mainSnak-getType();
+   $value = $mainSnak-getType(); // todo handle no values 
in general way (needed elsewhere)
}
 
$args = array( $propertyId = array( $value ) );

-- 
To view, visit https://gerrit.wikimedia.org/r/83780
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib6df76009157b867e051f8d3fea822636bf850e9
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: mw1.22-wmf16
Gerrit-Owner: Tobias Gritschacher tobias.gritschac...@wikimedia.de
Gerrit-Reviewer: Addshore addshorew...@gmail.com
Gerrit-Reviewer: Aude aude.w...@gmail.com
Gerrit-Reviewer: Daniel Kinzler daniel.kinz...@wikimedia.de
Gerrit-Reviewer: Jeroen De Dauw jeroended...@gmail.com
Gerrit-Reviewer: Tobias Gritschacher tobias.gritschac...@wikimedia.de
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Always call getKeys for message groups if it exists - change (mediawiki...Translate)

2013-09-11 Thread Mwalker (Code Review)
Mwalker has submitted this change and it was merged.

Change subject: Always call getKeys for message groups if it exists
..


Always call getKeys for message groups if it exists

Previously limited only to MessageGroupBase and classes derived
from that.

Bug: 53769
Bug: 53792
Change-Id: I5b065813afaa07699ae68d24659aac4445d59f9f
---
M utils/MessageIndex.php
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Mwalker: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/utils/MessageIndex.php b/utils/MessageIndex.php
index 0b7c442..708da2c 100644
--- a/utils/MessageIndex.php
+++ b/utils/MessageIndex.php
@@ -185,7 +185,7 @@
 * @param bool $ignore
 */
protected function checkAndAdd( $hugearray, MessageGroup $g, $ignore = 
false ) {
-   if ( $g instanceof MessageGroupBase ) {
+   if ( method_exists( $g, 'getKeys' ) ) {
$keys = $g-getKeys();
} else {
$messages = $g-getDefinitions();

-- 
To view, visit https://gerrit.wikimedia.org/r/83818
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I5b065813afaa07699ae68d24659aac4445d59f9f
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit niklas.laxst...@gmail.com
Gerrit-Reviewer: Mwalker mwal...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Cleanup action methods - change (mediawiki...VisualEditor)

2013-09-11 Thread Trevor Parscal (Code Review)
Trevor Parscal has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83824


Change subject: Cleanup action methods
..

Cleanup action methods

Changes:
* Remove reference to inspector close method, which didn't actually exist
* Use more spacy array syntax for all action methods

Change-Id: I08ee2d262acc7b39456766fb4a0b490da88ad041
---
M modules/ve/ui/actions/ve.ui.AnnotationAction.js
M modules/ve/ui/actions/ve.ui.ContentAction.js
M modules/ve/ui/actions/ve.ui.FormatAction.js
M modules/ve/ui/actions/ve.ui.HistoryAction.js
M modules/ve/ui/actions/ve.ui.IndentationAction.js
M modules/ve/ui/actions/ve.ui.InspectorAction.js
M modules/ve/ui/actions/ve.ui.ListAction.js
7 files changed, 7 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/24/83824/1

diff --git a/modules/ve/ui/actions/ve.ui.AnnotationAction.js 
b/modules/ve/ui/actions/ve.ui.AnnotationAction.js
index 99f15f2..7f4361c 100644
--- a/modules/ve/ui/actions/ve.ui.AnnotationAction.js
+++ b/modules/ve/ui/actions/ve.ui.AnnotationAction.js
@@ -30,7 +30,7 @@
  * @static
  * @property
  */
-ve.ui.AnnotationAction.static.methods = ['set', 'clear', 'toggle', 'clearAll'];
+ve.ui.AnnotationAction.static.methods = [ 'set', 'clear', 'toggle', 'clearAll' 
];
 
 /* Methods */
 
diff --git a/modules/ve/ui/actions/ve.ui.ContentAction.js 
b/modules/ve/ui/actions/ve.ui.ContentAction.js
index ef935d5..8eb72fb 100644
--- a/modules/ve/ui/actions/ve.ui.ContentAction.js
+++ b/modules/ve/ui/actions/ve.ui.ContentAction.js
@@ -30,7 +30,7 @@
  * @static
  * @property
  */
-ve.ui.ContentAction.static.methods = ['insert', 'remove', 'select'];
+ve.ui.ContentAction.static.methods = [ 'insert', 'remove', 'select' ];
 
 /* Methods */
 
diff --git a/modules/ve/ui/actions/ve.ui.FormatAction.js 
b/modules/ve/ui/actions/ve.ui.FormatAction.js
index 0d5c6b7..05e395b 100644
--- a/modules/ve/ui/actions/ve.ui.FormatAction.js
+++ b/modules/ve/ui/actions/ve.ui.FormatAction.js
@@ -30,7 +30,7 @@
  * @static
  * @property
  */
-ve.ui.FormatAction.static.methods = ['convert'];
+ve.ui.FormatAction.static.methods = [ 'convert' ];
 
 /* Methods */
 
diff --git a/modules/ve/ui/actions/ve.ui.HistoryAction.js 
b/modules/ve/ui/actions/ve.ui.HistoryAction.js
index 9d2f22b..61a1129 100644
--- a/modules/ve/ui/actions/ve.ui.HistoryAction.js
+++ b/modules/ve/ui/actions/ve.ui.HistoryAction.js
@@ -30,7 +30,7 @@
  * @static
  * @property
  */
-ve.ui.HistoryAction.static.methods = ['undo', 'redo'];
+ve.ui.HistoryAction.static.methods = [ 'undo', 'redo' ];
 
 /* Methods */
 
diff --git a/modules/ve/ui/actions/ve.ui.IndentationAction.js 
b/modules/ve/ui/actions/ve.ui.IndentationAction.js
index 13add73..a502699 100644
--- a/modules/ve/ui/actions/ve.ui.IndentationAction.js
+++ b/modules/ve/ui/actions/ve.ui.IndentationAction.js
@@ -30,7 +30,7 @@
  * @static
  * @property
  */
-ve.ui.IndentationAction.static.methods = ['increase', 'decrease'];
+ve.ui.IndentationAction.static.methods = [ 'increase', 'decrease' ];
 
 /* Methods */
 
diff --git a/modules/ve/ui/actions/ve.ui.InspectorAction.js 
b/modules/ve/ui/actions/ve.ui.InspectorAction.js
index d0cfcea..3b0a12c 100644
--- a/modules/ve/ui/actions/ve.ui.InspectorAction.js
+++ b/modules/ve/ui/actions/ve.ui.InspectorAction.js
@@ -30,7 +30,7 @@
  * @static
  * @property
  */
-ve.ui.InspectorAction.static.methods = ['open', 'close'];
+ve.ui.InspectorAction.static.methods = [ 'open' ];
 
 /* Methods */
 
diff --git a/modules/ve/ui/actions/ve.ui.ListAction.js 
b/modules/ve/ui/actions/ve.ui.ListAction.js
index 6a57b88..42e1782 100644
--- a/modules/ve/ui/actions/ve.ui.ListAction.js
+++ b/modules/ve/ui/actions/ve.ui.ListAction.js
@@ -30,7 +30,7 @@
  * @static
  * @property
  */
-ve.ui.ListAction.static.methods = ['wrap', 'unwrap'];
+ve.ui.ListAction.static.methods = [ 'wrap', 'unwrap' ];
 
 /* Methods */
 

-- 
To view, visit https://gerrit.wikimedia.org/r/83824
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I08ee2d262acc7b39456766fb4a0b490da88ad041
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Trevor Parscal tpars...@wikimedia.org

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Add getKeys optimization to BannerMessageGroup - change (mediawiki...CentralNotice)

2013-09-11 Thread Mwalker (Code Review)
Mwalker has submitted this change and it was merged.

Change subject: Add getKeys optimization to BannerMessageGroup
..


Add getKeys optimization to BannerMessageGroup

This avoids the wfMessage calls to load message content.

Bug: 53769
Bug: 53792
Change-Id: I14cdda777e3a70cda78d2f52d59b6ad569619571
---
M includes/BannerMessageGroup.php
1 file changed, 27 insertions(+), 0 deletions(-)

Approvals:
  Mwalker: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/BannerMessageGroup.php b/includes/BannerMessageGroup.php
index 38c13c8..50e941d 100644
--- a/includes/BannerMessageGroup.php
+++ b/includes/BannerMessageGroup.php
@@ -32,6 +32,33 @@
}
 
/**
+* This is optimized version of getDefinitions that only returns
+* message keys to speed up message index creation.
+* @return array
+*/
+   public function getKeys() {
+   $keys = array();
+
+   $banner = Banner::fromName( $this-bannerName );
+   $fields = $banner-extractMessageFields();
+
+   // The MediaWiki page name convention for messages is the same 
as the
+   // convention for banners themselves, except that it doesn't 
include
+   // the 'template' designation.
+   if ( $this-namespace == NS_CN_BANNER ) {
+   $msgKeyPrefix = $this-bannerName . '-';
+   } else {
+   $msgKeyPrefix = Centralnotice-{$this-bannerName}-;
+   }
+
+   foreach ( array_keys( $fields ) as $msgName ) {
+   $keys[] = $msgKeyPrefix . $msgName;
+   }
+
+   return $keys;
+   }
+
+   /**
 * Fetch the messages for the banner
 * @return array Array of message keys with definitions.
 */

-- 
To view, visit https://gerrit.wikimedia.org/r/83827
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I14cdda777e3a70cda78d2f52d59b6ad569619571
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/CentralNotice
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit niklas.laxst...@gmail.com
Gerrit-Reviewer: Mwalker mwal...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Tests for morelike:. - change (mediawiki...CirrusSearch)

2013-09-11 Thread Manybubbles (Code Review)
Manybubbles has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83819


Change subject: Tests for morelike:.
..

Tests for morelike:.

Bug: 53474
Change-Id: Id1c606bebdbc5211dbe9f622861ddc36f37c85d6
---
M tests/browser/features/full_text.feature
M tests/browser/features/support/build_pages.rb
2 files changed, 25 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch 
refs/changes/19/83819/1

diff --git a/tests/browser/features/full_text.feature 
b/tests/browser/features/full_text.feature
index 2645613..9bf43c0 100644
--- a/tests/browser/features/full_text.feature
+++ b/tests/browser/features/full_text.feature
@@ -102,3 +102,14 @@
   Scenario: Searching for multiword category finds it
 When I search for incategory:CategoryWith ASpace
 Then IHaveATwoWordCategory is the first search result
+
+  @setup_more_like_this
+  Scenario: Searching for morelike:page that doesn't exist returns no results
+When I search for morelike:IDontExist
+Then there are no search results
+
+  @setup_more_like_this
+  Scenario: Searching for morelike:page returns pages that are 'like' that 
page
+When I search for morelike:More Like Me 1
+Then More Like Me is in the first search result
+But More Like Me 1 is not in the search results
diff --git a/tests/browser/features/support/build_pages.rb 
b/tests/browser/features/support/build_pages.rb
index bd63ad3..5e0ce8b 100644
--- a/tests/browser/features/support/build_pages.rb
+++ b/tests/browser/features/support/build_pages.rb
@@ -86,3 +86,17 @@
   end
   $setup_highlighting = true
 end
+
+Before('@setup_more_like_this') do
+  if !$setup_more_like_this
+# The MoreLikeMe term must appear in a bunch of pages for it to be used 
in morelike: searches
+steps %Q{
+  Given a page named More Like Me 1 exists with contents MoreLikeMe 
MoreLikeMe
+  And a page named More Like Me 2 exists with contents MoreLikeMe 
MoreLikeMe
+  And a page named More Like Me 3 exists with contents MoreLikeMe 
MoreLikeMe
+  And a page named More Like Me 4 exists with contents MoreLikeMe 
MoreLikeMe
+  And a page named More Like Me 5 exists with contents MoreLikeMe 
MoreLikeMe
+}
+  end
+  $setup_more_like_this = true
+end

-- 
To view, visit https://gerrit.wikimedia.org/r/83819
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id1c606bebdbc5211dbe9f622861ddc36f37c85d6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CirrusSearch
Gerrit-Branch: master
Gerrit-Owner: Manybubbles never...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Update mpdf to 5.7.1 - change (mediawiki...Mpdf)

2013-09-11 Thread Reedy (Code Review)
Reedy has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83829


Change subject: Update mpdf to 5.7.1
..

Update mpdf to 5.7.1

Change-Id: I432063e90f9c196b61314cfae878e842d6bf2b5e
---
M mpdf/CHANGELOG.txt
M mpdf/README.txt
M mpdf/classes/barcode.php
A mpdf/classes/cssmgr.php
M mpdf/classes/directw.php
A mpdf/classes/meter.php
M mpdf/classes/svg.php
M mpdf/classes/tocontents.php
M mpdf/classes/ttfontsuni.php
A mpdf/classes/ttfontsuni_analysis.php
M mpdf/config.php
M mpdf/config_fonts.php
M mpdf/includes/functions.php
M mpdf/includes/out.php
M mpdf/mpdf.php
M mpdf/utils/font_collections.php
M mpdf/utils/font_coverage.php
M mpdf/utils/font_dump.php
18 files changed, 5,683 insertions(+), 4,268 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Mpdf 
refs/changes/29/83829/1


-- 
To view, visit https://gerrit.wikimedia.org/r/83829
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I432063e90f9c196b61314cfae878e842d6bf2b5e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Mpdf
Gerrit-Branch: master
Gerrit-Owner: Reedy re...@wikimedia.org

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Make navigation.js load at the top - change (mediawiki...MobileFrontend)

2013-09-11 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Make navigation.js load at the top
..


Make navigation.js load at the top

And ensure that mobile.head module loads at the top too. This might fix
bug 53511 or at least make it less annoying.

Bug: 53511
Change-Id: I81945dd0723b4c6fb67cc5e8e687a5aa3000ad2e
---
M includes/Resources.php
M includes/skins/SkinMinerva.php
2 files changed, 2 insertions(+), 1 deletion(-)

Approvals:
  Jdlrobson: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/Resources.php b/includes/Resources.php
index 5a6fe91..e80141f 100644
--- a/includes/Resources.php
+++ b/includes/Resources.php
@@ -131,6 +131,7 @@
'scripts' = array(
'javascripts/common/polyfills.js',
'javascripts/common/modules.js',
+   'javascripts/common/navigation.js',
),
'position' = 'top',
),
@@ -404,7 +405,6 @@
'javascripts/common/CtaDrawer.js',
'javascripts/common/Overlay.js',
'javascripts/widgets/progress-bar.js',
-   'javascripts/common/navigation.js',
'javascripts/common/notification.js',
'javascripts/views/page.js',
// Upload specific code
diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php
index 0fab93d..dc1970e 100644
--- a/includes/skins/SkinMinerva.php
+++ b/includes/skins/SkinMinerva.php
@@ -211,6 +211,7 @@
$out = $this-getOutput();
 
$modules['mobile'] = array(
+   'mobile.head',
'mobile.startup',
'mobile.site',
// FIXME: separate mobile.stable into more meaningful 
groupings

-- 
To view, visit https://gerrit.wikimedia.org/r/83207
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I81945dd0723b4c6fb67cc5e8e687a5aa3000ad2e
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: JGonera jgon...@wikimedia.org
Gerrit-Reviewer: Jdlrobson jrob...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Move pywikibot/data/logentries.py to pywikibot/logentries.py - change (pywikibot/core)

2013-09-11 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Move pywikibot/data/logentries.py to pywikibot/logentries.py
..


Move pywikibot/data/logentries.py to pywikibot/logentries.py

logentries.py makes no sense in the data folder since it is just
a container for already fetched data.

Change-Id: Ic8948f7115f468a6fbe521721a7b3677695e6539
---
M pywikibot/data/api.py
R pywikibot/logentries.py
M tests/site_tests.py
3 files changed, 6 insertions(+), 6 deletions(-)

Approvals:
  Merlijn van Deen: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py
index 237d433..c439eb2 100644
--- a/pywikibot/data/api.py
+++ b/pywikibot/data/api.py
@@ -857,7 +857,7 @@
 def __init__(self, logtype=None, **kwargs):
 ListGenerator.__init__(self, logevents, **kwargs)
 
-import logentries
+from pywikibot import logentries
 self.entryFactory = logentries.LogEntryFactory(logtype)
 
 def result(self, pagedata):
diff --git a/pywikibot/data/logentries.py b/pywikibot/logentries.py
similarity index 100%
rename from pywikibot/data/logentries.py
rename to pywikibot/logentries.py
diff --git a/tests/site_tests.py b/tests/site_tests.py
index cb29a0e..b45cf0c 100644
--- a/tests/site_tests.py
+++ b/tests/site_tests.py
@@ -549,7 +549,7 @@
 
 le = list(mysite.logevents(total=10))
 self.assertTrue(len(le) = 10)
-self.assertTrue(all(isinstance(entry, 
pywikibot.data.logentries.LogEntry)
+self.assertTrue(all(isinstance(entry, pywikibot.logentries.LogEntry)
 for entry in le))
 for typ in (block, protect, rights, delete, upload,
 move, import, patrol, merge):
@@ -560,21 +560,21 @@
 for entry in mysite.logevents(user=mysite.user(), total=3):
 self.assertTrue(entry.user() == mysite.user())
 for entry in mysite.logevents(start=2008-09-01T00:00:01Z, total=5):
-self.assertType(entry, pywikibot.data.logentries.LogEntry)
+self.assertType(entry, pywikibot.logentries.LogEntry)
 self.assertTrue(str(entry.timestamp()) = 2008-09-01T00:00:01Z)
 for entry in mysite.logevents(end=2008-09-02T23:59:59Z, total=5):
-self.assertType(entry, pywikibot.data.logentries.LogEntry)
+self.assertType(entry, pywikibot.logentries.LogEntry)
 self.assertTrue(str(entry.timestamp()) = 2008-09-02T23:59:59Z)
 for entry in mysite.logevents(start=2008-02-02T00:00:01Z,
   end=2008-02-02T23:59:59Z,
   reverse=True, total=5):
-self.assertType(entry, pywikibot.data.logentries.LogEntry)
+self.assertType(entry, pywikibot.logentries.LogEntry)
 self.assertTrue(2008-02-02T00:00:01Z = str(entry.timestamp())
 = 2008-02-02T23:59:59Z)
 for entry in mysite.logevents(start=2008-02-03T23:59:59Z,
   end=2008-02-03T00:00:01Z,
   total=5):
-self.assertType(entry, pywikibot.data.logentries.LogEntry)
+self.assertType(entry, pywikibot.logentries.LogEntry)
 self.assertTrue(2008-02-03T00:00:01Z = str(entry.timestamp())
 = 2008-02-03T23:59:59Z)
 # starttime earlier than endtime

-- 
To view, visit https://gerrit.wikimedia.org/r/80300
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic8948f7115f468a6fbe521721a7b3677695e6539
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Legoktm legoktm.wikipe...@gmail.com
Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com
Gerrit-Reviewer: Merlijn van Deen valhall...@arctus.nl
Gerrit-Reviewer: Xqt i...@gno.de
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Alpha: Temporarily remove Firefox from supported browser for... - change (mediawiki...MobileFrontend)

2013-09-11 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Alpha: Temporarily remove Firefox from supported browser for 
history api
..


Alpha: Temporarily remove Firefox from supported browser for history api

Page redirects to undefined

Change-Id: I218da5f75662542cab3dc4c66b10a78c2ddc3e2c
---
M javascripts/externals/epoch.js
1 file changed, 1 insertion(+), 3 deletions(-)

Approvals:
  Kaldari: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/javascripts/externals/epoch.js b/javascripts/externals/epoch.js
index a122d04..619f484 100644
--- a/javascripts/externals/epoch.js
+++ b/javascripts/externals/epoch.js
@@ -20,9 +20,7 @@
// iOS 5+
ua.match( /OS [5-9]_.*like Mac OS X/ ) ||
// iOS 10+ (future proofing)
-   ua.match( /OS [1-9][0-9]_.*like Mac OS X/ ) ||
-   // Firefox (ignoring version  4 in the check)
-   ua.match( /Firefox/ )
+   ua.match( /OS [1-9][0-9]_.*like Mac OS X/ )
) ? true : false;
}
 

-- 
To view, visit https://gerrit.wikimedia.org/r/83828
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I218da5f75662542cab3dc4c66b10a78c2ddc3e2c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson jrob...@wikimedia.org
Gerrit-Reviewer: Kaldari rkald...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Remove one last ceph reference - change (operations/mediawiki-config)

2013-09-11 Thread Aaron Schulz (Code Review)
Aaron Schulz has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83820


Change subject: Remove one last ceph reference
..

Remove one last ceph reference

Change-Id: I5cda5ac338e1b1b3db68c47891d0f5e3474283ee
---
M wmf-config/filebackend.php
1 file changed, 1 insertion(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/20/83820/1

diff --git a/wmf-config/filebackend.php b/wmf-config/filebackend.php
index d556e32..0438c67 100644
--- a/wmf-config/filebackend.php
+++ b/wmf-config/filebackend.php
@@ -105,8 +105,7 @@
'lockManager' = 'nullLockManager',
'backends'= array(
# DO NOT change the master backend unless it is fully trusted 
or autoRsync is off
-   array( 'template' = 'global-swift', 'isMultiMaster' = true ),
-   array( 'template' = 'global-ceph', 'isMultiMaster' = false )
+   array( 'template' = 'global-swift', 'isMultiMaster' = true )
),
'syncChecks'  = ( 1 | 4 ), // (size  sha1)
'autoResync'  = 'conservative'

-- 
To view, visit https://gerrit.wikimedia.org/r/83820
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5cda5ac338e1b1b3db68c47891d0f5e3474283ee
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz asch...@wikimedia.org

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Introduce header-loaded event - change (mediawiki...MobileFrontend)

2013-09-11 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Introduce header-loaded event
..


Introduce header-loaded event

Use it to bind the left nav opening JS as soon as possible. In future
can be also used for binding search earlier.

Change-Id: I0955a418068123634d5d067bc3ddbcfccb33291a
Bug: 53511
---
M includes/Resources.php
M includes/skins/MinervaTemplate.php
M javascripts/common/application.js
M javascripts/common/eventemitter.js
M javascripts/common/navigation.js
5 files changed, 23 insertions(+), 25 deletions(-)

Approvals:
  Jdlrobson: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/Resources.php b/includes/Resources.php
index e80141f..c2fd164 100644
--- a/includes/Resources.php
+++ b/includes/Resources.php
@@ -131,6 +131,8 @@
'scripts' = array(
'javascripts/common/polyfills.js',
'javascripts/common/modules.js',
+   'javascripts/common/Class.js',
+   'javascripts/common/eventemitter.js',
'javascripts/common/navigation.js',
),
'position' = 'top',
@@ -142,8 +144,6 @@
),
'scripts' = array(
'javascripts/externals/hogan.js',
-   'javascripts/common/Class.js',
-   'javascripts/common/eventemitter.js',
'javascripts/common/Router.js',
'javascripts/common/api.js',
'javascripts/common/PageApi.js',
diff --git a/includes/skins/MinervaTemplate.php 
b/includes/skins/MinervaTemplate.php
index 466d706..ce3b9dd 100644
--- a/includes/skins/MinervaTemplate.php
+++ b/includes/skins/MinervaTemplate.php
@@ -193,6 +193,9 @@
echo $data['userButton'];
?
/div
+   script
+   mw.mobileFrontend.emit( 'header-loaded' 
);
+   /script
?php
$this-renderContentWrapper( $data );
$this-renderFooter( $data );
diff --git a/javascripts/common/application.js 
b/javascripts/common/application.js
index d31c2f4..4a13940 100644
--- a/javascripts/common/application.js
+++ b/javascripts/common/application.js
@@ -1,29 +1,11 @@
 // FIXME: make this an object with a constructor to facilitate testing
 // (see https://bugzilla.wikimedia.org/show_bug.cgi?id=44264)
 ( function( M, $ ) {
-   var EventEmitter = M.require( 'eventemitter' ),
-   Router = M.require( 'Router' ),
+   var Router = M.require( 'Router' ),
PageApi = M.require( 'PageApi' ),
-   // FIXME: when mobileFrontend is an object with a constructor,
-   // just inherit from EventEmitter instead
-   eventEmitter = new EventEmitter(),
$viewportMeta, viewport,
template,
templates = {};
-
-   /**
-* See EventEmitter#on.
-*/
-   function on(/* event, callback */ ) {
-   return eventEmitter.on.apply( eventEmitter, arguments );
-   }
-
-   /**
-* See EventEmitter#emit.
-*/
-   function emit(/* event, arg1, arg2, ... */ ) {
-   return eventEmitter.emit.apply( eventEmitter, arguments );
-   }
 
template = {
/**
@@ -273,14 +255,12 @@
 
$.extend( M, {
init: init,
-   emit: emit,
jQuery: typeof jQuery  !== 'undefined' ? jQuery : false,
getOrigin: getOrigin,
getSessionId: getSessionId,
isLoggedIn: isLoggedIn,
lockViewport: lockViewport,
log: log,
-   on: on,
supportsGeoLocation: supportsGeoLocation,
supportsPositionFixed: supportsPositionFixed,
prettyEncodeTitle: prettyEncodeTitle,
diff --git a/javascripts/common/eventemitter.js 
b/javascripts/common/eventemitter.js
index 4a6afd7..e8bfe44 100644
--- a/javascripts/common/eventemitter.js
+++ b/javascripts/common/eventemitter.js
@@ -49,5 +49,8 @@
} );
 
M.define( 'eventemitter', EventEmitter );
+   // FIXME: if we want more of M's functionality in loaded in head,
+   // move this to a separate file
+   $.extend( M, new EventEmitter() );
 
 }( mw.mobileFrontend, jQuery ) );
diff --git a/javascripts/common/navigation.js b/javascripts/common/navigation.js
index 37fd17e..d20a359 100644
--- a/javascripts/common/navigation.js
+++ b/javascripts/common/navigation.js
@@ -3,6 +3,8 @@
 var m = ( function( $ ) {
var
menu,
+   // FIXME: 

[MediaWiki-commits] [Gerrit] Removed ceph backend config for decommissioning - change (operations/mediawiki-config)

2013-09-11 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Removed ceph backend config for decommissioning
..


Removed ceph backend config for decommissioning

* Also removed extra purge hook code related to using multiwrite backends

Change-Id: I4d1253cc9e240682b44d40a0668d44c88bb8d07a
---
M wmf-config/filebackend.php
1 file changed, 0 insertions(+), 99 deletions(-)

Approvals:
  Aaron Schulz: Looks good to me, approved
  Faidon Liambotis: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/wmf-config/filebackend.php b/wmf-config/filebackend.php
index 4ba64b2..d556e32 100644
--- a/wmf-config/filebackend.php
+++ b/wmf-config/filebackend.php
@@ -71,69 +71,6 @@
 );
 /* end Swift backend config */
 
-/* Ceph rados+rgw backend config */
-$wgFileBackends[] = array( // backend config for wiki's local repo
-   'class'  = 'SwiftFileBackend',
-   'name'   = 'local-ceph',
-   'wikiId' = {$site}-{$lang},
-   'lockManager'= 'nullLockManager', // LocalFile uses FOR UPDATE
-   'fileJournal'= array( 'class' = 'DBFileJournal', 'wiki' = 
$wgDBname, 'ttlDays' = $wmfFileJournalTTL ),
-   'swiftAuthUrl'   = $wmfCephRgwConfig['authUrl'],
-   'swiftUser'  = $wmfCephRgwConfig['user'],
-   'swiftKey'   = $wmfCephRgwConfig['key'],
-   'swiftTempUrlKey'= $wmfCephRgwConfig['tempUrlKey'],
-   'rgwS3AccessKey' = $wmfCephRgwConfig['S3AccessKey'],
-   'rgwS3SecretKey' = $wmfCephRgwConfig['S3SecretKey'],
-   'shardViaHashLevels' = array(
-   'local-public' = array( 'levels' = $wmfSwiftShardLocal, 
'base' = 16, 'repeat' = 1 ),
-   'local-thumb'  = array( 'levels' = $wmfSwiftShardLocal, 
'base' = 16, 'repeat' = 1 ),
-   'local-temp'   = array( 'levels' = $wmfSwiftShardLocal, 
'base' = 16, 'repeat' = 1 ),
-   'local-transcoded' = array( 'levels' = $wmfSwiftShardLocal, 
'base' = 16, 'repeat' = 1 ),
-   'local-deleted'= array( 'levels' = $wmfSwiftShardLocal, 
'base' = 36, 'repeat' = 0 )
-   ),
-   'parallelize'= 'implicit',
-   'cacheAuthInfo'  = true
-);
-$wgFileBackends[] = array( // backend config for wiki's access to shared repo
-   'class'  = 'SwiftFileBackend',
-   'name'   = 'shared-ceph',
-   'wikiId' = wikipedia-commons,
-   'lockManager'= 'nullLockManager', // just thumbnails
-   'fileJournal'= array( 'class' = 'DBFileJournal', 'wiki' = 
'commonswiki', 'ttlDays' = $wmfFileJournalTTL ),
-   'swiftAuthUrl'   = $wmfCephRgwConfig['authUrl'],
-   'swiftUser'  = $wmfCephRgwConfig['user'],
-   'swiftKey'   = $wmfCephRgwConfig['key'],
-   'swiftTempUrlKey'= $wmfCephRgwConfig['tempUrlKey'],
-   'rgwS3AccessKey' = $wmfCephRgwConfig['S3AccessKey'],
-   'rgwS3SecretKey' = $wmfCephRgwConfig['S3SecretKey'],
-   'shardViaHashLevels' = array(
-   'local-public' = array( 'levels' = $wmfSwiftShardCommon, 
'base' = 16, 'repeat' = 1 ),
-   'local-thumb'  = array( 'levels' = $wmfSwiftShardCommon, 
'base' = 16, 'repeat' = 1 ),
-   'local-temp'   = array( 'levels' = $wmfSwiftShardCommon, 
'base' = 16, 'repeat' = 1 ),
-   'local-transcoded' = array( 'levels' = $wmfSwiftShardCommon, 
'base' = 16, 'repeat' = 1 ),
-   ),
-   'parallelize'= 'implicit',
-   'cacheAuthInfo'  = true
-);
-$wgFileBackends[] = array( // backend config for wiki's access to shared files
-   'class'  = 'SwiftFileBackend',
-   'name'   = 'global-ceph',
-   'wikiId' = global-data,
-   'lockManager'= 'nullLockManager',
-   'swiftAuthUrl'   = $wmfCephRgwConfig['authUrl'],
-   'swiftUser'  = $wmfCephRgwConfig['user'],
-   'swiftKey'   = $wmfCephRgwConfig['key'],
-   'swiftTempUrlKey'= $wmfCephRgwConfig['tempUrlKey'],
-   'rgwS3AccessKey' = $wmfCephRgwConfig['S3AccessKey'],
-   'rgwS3SecretKey' = $wmfCephRgwConfig['S3SecretKey'],
-   'shardViaHashLevels' = array(
-   'math-render'  = array( 'levels' = 2, 'base' = 16, 'repeat' 
= 0 ),
-   ),
-   'parallelize'= 'implicit',
-   'cacheAuthInfo'  = true
-);
-/* end Ceph rados+rgw backend config */
-
 /* Multiwrite backend config */
 $wgFileBackends[] = array(
'class'   = 'FileBackendMultiWrite',
@@ -144,7 +81,6 @@
'backends'= array(
# DO NOT change the master backend unless it is fully trusted 
or autoRsync is off
array( 'template' = 'local-swift', 'isMultiMaster' = true ),
-   array( 'template' = 'local-ceph', 'isMultiMaster' = false )
),
'syncChecks'  

[MediaWiki-commits] [Gerrit] Removing decom'd sq servers from dns - change (operations/dns)

2013-09-11 Thread Cmjohnson (Code Review)
Cmjohnson has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83830


Change subject: Removing decom'd sq servers from dns
..

Removing decom'd sq servers from dns

Change-Id: Ia59c3559514cd0df3ff8dba0e563d90c62551a7c
---
M templates/152.80.208.in-addr.arpa
M templates/wikimedia.org
2 files changed, 1 insertion(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/dns 
refs/changes/30/83830/1

diff --git a/templates/152.80.208.in-addr.arpa 
b/templates/152.80.208.in-addr.arpa
index 7408128..2687206 100644
--- a/templates/152.80.208.in-addr.arpa
+++ b/templates/152.80.208.in-addr.arpa
@@ -57,8 +57,7 @@
 48 1H IN PTR   ms10.wikimedia.org.
 
 50 1H IN PTR   sq89.wikimedia.org.
-51 1H IN PTR   sq41.wikimedia.org.
-52 1H IN PTR   sq42.wikimedia.org.
+
 53 1H IN PTR   sq43.wikimedia.org.
 54 1H IN PTR   sq44.wikimedia.org.
 55 1H IN PTR   sq45.wikimedia.org.
diff --git a/templates/wikimedia.org b/templates/wikimedia.org
index 59f0d20..1050b9e 100644
--- a/templates/wikimedia.org
+++ b/templates/wikimedia.org
@@ -211,12 +211,7 @@
1H  IN  2620:0:860:1:208:80:152:18
 ssl4   1H  IN A208.80.152.19
1H  IN  2620:0:860:1:208:80:152:19
-sq33   1H  IN A208.80.152.43
-sq35   1H  IN A208.80.152.45
 
-sq37   1H  IN A208.80.152.47
-sq41   1H  IN A208.80.152.51
-sq42   1H  IN A208.80.152.52
 sq43   1H  IN A208.80.152.53
 sq44   1H  IN A208.80.152.54
 sq45   1H  IN A208.80.152.55

-- 
To view, visit https://gerrit.wikimedia.org/r/83830
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia59c3559514cd0df3ff8dba0e563d90c62551a7c
Gerrit-PatchSet: 1
Gerrit-Project: operations/dns
Gerrit-Branch: master
Gerrit-Owner: Cmjohnson cmjohn...@wikimedia.org

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Work in progress: Simplify formatter HTML - change (mediawiki...MobileFrontend)

2013-09-11 Thread Jdlrobson (Code Review)
Jdlrobson has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83837


Change subject: Work in progress: Simplify formatter HTML
..

Work in progress: Simplify formatter HTML

Change-Id: Iafc288e284b07061aba5fcb53bd80cc6e57a6c86
---
M includes/formatters/MobileFormatterHTML.php
M javascripts/common/application.js
M javascripts/modules/issues/issues.js
M javascripts/modules/lazyload.js
M javascripts/modules/mf-tables.js
M javascripts/modules/mf-toggle-dynamic.js
M javascripts/modules/mf-toggle.js
M javascripts/modules/uploads/PhotoUploader.js
M javascripts/modules/uploads/lead-photo-init.js
M less/common/typography.less
M less/modules/toggle.less
M stylesheets/common/typography.css
M stylesheets/modules/toggle.css
13 files changed, 64 insertions(+), 65 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/37/83837/1

diff --git a/includes/formatters/MobileFormatterHTML.php 
b/includes/formatters/MobileFormatterHTML.php
index 6e43c02..aceba82 100644
--- a/includes/formatters/MobileFormatterHTML.php
+++ b/includes/formatters/MobileFormatterHTML.php
@@ -46,7 +46,6 @@
} else {
$base = '';
}
-   $base .= Html::openElement( 'div', array( 'class' = 'section' 
) );
$base .= Html::openElement( 'h2',
array( 'class' = 'section_heading', 'id' = 'section_' 
. $this-headings )
);
@@ -56,15 +55,12 @@
$matches[2]
)
. Html::closeElement( 'h2' )
-   . Html::openElement( 'div',
-   array( 'class' = 'content_block', 'id' = 
'content_' . $this-headings )
-   );
+   . Html::openElement( 'div' );
 
if ( $this-headings  1 ) {
// Close it up here
$base = '/div' // div class=content_block
. $backToTop
-   . /div // div class=section
. $base;
}
 
diff --git a/javascripts/common/application.js 
b/javascripts/common/application.js
index 4a13940..59f7f21 100644
--- a/javascripts/common/application.js
+++ b/javascripts/common/application.js
@@ -257,6 +257,9 @@
init: init,
jQuery: typeof jQuery  !== 'undefined' ? jQuery : false,
getOrigin: getOrigin,
+   getLeadSection: function() {
+   return $( '#content' ).find( 'div' ).eq( 0 );
+   },
getSessionId: getSessionId,
isLoggedIn: isLoggedIn,
lockViewport: lockViewport,
diff --git a/javascripts/modules/issues/issues.js 
b/javascripts/modules/issues/issues.js
index 6d39028..3459241 100644
--- a/javascripts/modules/issues/issues.js
+++ b/javascripts/modules/issues/issues.js
@@ -12,7 +12,7 @@
} );
 
function run( $container, parentOverlay ) {
-   $container = $container || $( '#content_0' );
+   $container = $container || M.getLeadSection();
var $metadata = $container.find( 'table.ambox' ),
overlay;
 
diff --git a/javascripts/modules/lazyload.js b/javascripts/modules/lazyload.js
index 244b634..1f895a0 100644
--- a/javascripts/modules/lazyload.js
+++ b/javascripts/modules/lazyload.js
@@ -20,7 +20,7 @@
$( this ).attr( 'href', 
history.updateQueryStringParameter( href, 'returnto', title ) );
} );
 
-   history.hijackLinks( $( '#content_0' ), 
useFuzzyLinkHijacking );
+   history.hijackLinks( M.getLeadSection(), 
useFuzzyLinkHijacking );
} );
 
searchOverlay.on( 'write-results', function() {
diff --git a/javascripts/modules/mf-tables.js b/javascripts/modules/mf-tables.js
index 22503a7..5fc47e4 100644
--- a/javascripts/modules/mf-tables.js
+++ b/javascripts/modules/mf-tables.js
@@ -63,7 +63,7 @@
 
M.
on( 'page-loaded', function() {
-   initTables( $( '#content_0' ) );
+   initTables( M.getLeadSection() );
} ).
on( 'section-rendered', initTables );
 
diff --git a/javascripts/modules/mf-toggle-dynamic.js 
b/javascripts/modules/mf-toggle-dynamic.js
index 7d54b3e..b9244b9 100644
--- a/javascripts/modules/mf-toggle-dynamic.js
+++ b/javascripts/modules/mf-toggle-dynamic.js
@@ -1,13 +1,14 @@
 ( function( M, $ ) {
var currentPage;
 
-   M.on( 'section-toggle', function( section_id ) {
+   M.on( 'section-toggle', function( $heading ) {
var
-   $content = $( '#content_' + section_id ),
+   $content = 

[MediaWiki-commits] [Gerrit] setup.py hack for testing - change (pywikibot/core)

2013-09-11 Thread Hashar (Code Review)
Hashar has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83836


Change subject: setup.py hack for testing
..

setup.py hack for testing

Change-Id: Ia208d5dee95301247d4d6852f64577abc369ce80
---
M setup.py
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/36/83836/1

diff --git a/setup.py b/setup.py
index a73bc36..d49972d 100644
--- a/setup.py
+++ b/setup.py
@@ -26,7 +26,9 @@
 version='2.0b1',
 description='Python Wikipedia Bot Framework',
 license='MIT License',
-packages=find_packages(),
+#package_dir={ 'httplib2': 'externals/httplib2', },
+package_dir={'': 'externals'},
+packages=find_packages('externals'),
 install_requires=[
 'httplib2=0.6.0'
 ],

-- 
To view, visit https://gerrit.wikimedia.org/r/83836
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia208d5dee95301247d4d6852f64577abc369ce80
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Hashar has...@free.fr

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Always call getKeys for message groups if it exists - change (mediawiki...Translate)

2013-09-11 Thread Nikerabbit (Code Review)
Nikerabbit has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83818


Change subject: Always call getKeys for message groups if it exists
..

Always call getKeys for message groups if it exists

Previously limited only to MessageGroupBase and classes derived
from that.

Change-Id: I5b065813afaa07699ae68d24659aac4445d59f9f
---
M utils/MessageIndex.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate 
refs/changes/18/83818/1

diff --git a/utils/MessageIndex.php b/utils/MessageIndex.php
index 0b7c442..708da2c 100644
--- a/utils/MessageIndex.php
+++ b/utils/MessageIndex.php
@@ -185,7 +185,7 @@
 * @param bool $ignore
 */
protected function checkAndAdd( $hugearray, MessageGroup $g, $ignore = 
false ) {
-   if ( $g instanceof MessageGroupBase ) {
+   if ( method_exists( $g, 'getKeys' ) ) {
$keys = $g-getKeys();
} else {
$messages = $g-getDefinitions();

-- 
To view, visit https://gerrit.wikimedia.org/r/83818
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5b065813afaa07699ae68d24659aac4445d59f9f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit niklas.laxst...@gmail.com

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] adding in some mmgt addresses in ulsfo - change (operations/dns)

2013-09-11 Thread Lcarr (Code Review)
Lcarr has submitted this change and it was merged.

Change subject: adding in some mmgt addresses in ulsfo
..


adding in some mmgt addresses in ulsfo

Change-Id: Id142fb3fdc2aa3747551200040289ed7e9f950ef
---
M templates/10.in-addr.arpa
M templates/wmnet
2 files changed, 6 insertions(+), 0 deletions(-)

Approvals:
  Lcarr: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/templates/10.in-addr.arpa b/templates/10.in-addr.arpa
index fb29fad..eb18b16 100644
--- a/templates/10.in-addr.arpa
+++ b/templates/10.in-addr.arpa
@@ -3389,6 +3389,9 @@
 ; 10.128.128.0/17 - ulsfo mgmt
 $ORIGIN 128.128.{{ zonename }}.
 1  1H  IN PTR  fe-0-0-1.mr1-ulsfo.mgmt.ulsfo.wmnet.
+2  1H  IN PTR  me0-cr1-ulsfo.mgmt.ulsfo.wmnet.
+3  1H  IN PTR  me0-cr2-ulsfo.mgmt.ulsfo.wmnet.
+6  1H  IN PTR  vme0-asw-ulsfo.mgmt.ulsfo.wmnet.
 11 1H  IN PTR  scs-ulsfo.mgmt.ulsfo.wmnet.
 
 $ORIGIN 129.128.{{ zonename }}.
diff --git a/templates/wmnet b/templates/wmnet
index 0909f7d..1f5ff0e 100644
--- a/templates/wmnet
+++ b/templates/wmnet
@@ -2981,6 +2981,9 @@
 $ORIGIN mgmt.ulsfo.wmnet.
 
 mr1-ulsfo  1H  IN A10.128.128.1
+cr1-ulsfo  1H  IN A10.128.128.2
+cr2-ulsfo  1H  IN A10.128.128.3
+asw-ulsfo  1H  IN A10.128.128.6
 scs-ulsfo  1H  IN A10.128.128.11
 ; Servers listed sequentially
 lvs40011H  IN A10.128.129.1

-- 
To view, visit https://gerrit.wikimedia.org/r/83426
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Id142fb3fdc2aa3747551200040289ed7e9f950ef
Gerrit-PatchSet: 1
Gerrit-Project: operations/dns
Gerrit-Branch: master
Gerrit-Owner: Lcarr lc...@wikimedia.org
Gerrit-Reviewer: Lcarr lc...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Hygiene: Improve HTML output to avoid validation errors - change (mediawiki...MobileFrontend)

2013-09-11 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Hygiene: Improve HTML output to avoid validation errors
..


Hygiene: Improve HTML output to avoid validation errors

Run HTML Validator when PHP code in includes/skins changes to surface
better visibility (note there is still one error due to bug 38630

Change-Id: Ic05f2a1698ae2f9467fa3a59a96a36fbded75fef
---
M includes/skins/SkinMinerva.php
M scripts/pre-commit
2 files changed, 6 insertions(+), 0 deletions(-)

Approvals:
  Kaldari: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php
index 0fab93d..54505f8 100644
--- a/includes/skins/SkinMinerva.php
+++ b/includes/skins/SkinMinerva.php
@@ -144,6 +144,9 @@
$menu['talk']['class'] = 
$tpl-data['_talkdata']['class'];
}
}
+   // sanitize to avoid invalid HTML5 markup being produced
+   unset( $menu['talk']['primary'] );
+   unset( $menu['talk']['context'] );
 
$watchTemplate = array(
'id' = 'ca-watch',
diff --git a/scripts/pre-commit b/scripts/pre-commit
index d58b1a6..7a08cf2 100755
--- a/scripts/pre-commit
+++ b/scripts/pre-commit
@@ -9,6 +9,9 @@
 if git diff --name-only --cached | grep -P '\.js$' ; then
make qunit
 fi
+if git diff --name-only --cached | grep -P 'includes/skins/.*php$' ; then
+   make validatehtml
+fi
 for file in `git diff --cached --name-only | grep .png\$`
 do
[ -f $file ]  echo Compressing $file   \

-- 
To view, visit https://gerrit.wikimedia.org/r/83821
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic05f2a1698ae2f9467fa3a59a96a36fbded75fef
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson jrob...@wikimedia.org
Gerrit-Reviewer: Kaldari rkald...@wikimedia.org
Gerrit-Reviewer: jenkins-bot

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Adding support for query string params to mw.util.wikiGetlink - change (mediawiki/core)

2013-09-11 Thread Kaldari (Code Review)
Kaldari has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83834


Change subject: Adding support for query string params to mw.util.wikiGetlink
..

Adding support for query string params to mw.util.wikiGetlink

This will enable us to easily migrate from M.pageApi.getPageUrl

Change-Id: I5224a0910a822f1c3b1b34f505dbcdf879052b39
---
M resources/mediawiki/mediawiki.util.js
1 file changed, 8 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/34/83834/1

diff --git a/resources/mediawiki/mediawiki.util.js 
b/resources/mediawiki/mediawiki.util.js
index 071a52b..0ea8a63 100644
--- a/resources/mediawiki/mediawiki.util.js
+++ b/resources/mediawiki/mediawiki.util.js
@@ -160,11 +160,17 @@
 * Get the link to a page name (relative to `wgServer`),
 *
 * @param {string} str Page name to get the link for.
+* @param {Object} params A mapping of query parameter names to 
values,
+* e.g. { action: 'edit' }.
 * @return {string} Location for a page with name of `str` or 
boolean false on error.
 */
-   wikiGetlink: function ( str ) {
-   return mw.config.get( 'wgArticlePath' ).replace( '$1',
+   wikiGetlink: function ( str, params ) {
+   var url = mw.config.get( 'wgArticlePath' ).replace( 
'$1',
util.wikiUrlencode( typeof str === 'string' ? 
str : mw.config.get( 'wgPageName' ) ) );
+   if ( !$.isEmptyObject( params ) ) {
+   url += '?' + $.param( params );
+   }
+   return url;
},
 
/**

-- 
To view, visit https://gerrit.wikimedia.org/r/83834
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5224a0910a822f1c3b1b34f505dbcdf879052b39
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Kaldari rkald...@wikimedia.org

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Fix tooltip dependencies for jquery.wikibase.snaklistview - change (mediawiki...Wikibase)

2013-09-11 Thread Hoo man (Code Review)
Hoo man has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83835


Change subject: Fix tooltip dependencies for jquery.wikibase.snaklistview
..

Fix tooltip dependencies for jquery.wikibase.snaklistview

Change-Id: I08f7f7a8ddfaaa46ee79f33bd830f9582a0b468f
---
M lib/resources/Resources.php
1 file changed, 1 insertion(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/35/83835/1

diff --git a/lib/resources/Resources.php b/lib/resources/Resources.php
index a2394ee..30755ec 100644
--- a/lib/resources/Resources.php
+++ b/lib/resources/Resources.php
@@ -510,6 +510,7 @@
),
'messages' = array(
'wikibase-claimview-snak-tooltip',
+   'wikibase-claimview-snak-new-tooltip',
)
),
 

-- 
To view, visit https://gerrit.wikimedia.org/r/83835
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I08f7f7a8ddfaaa46ee79f33bd830f9582a0b468f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Hoo man h...@online.de

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Add monitoring of datasources - change (analytics/geowiki)

2013-09-11 Thread QChris (Code Review)
QChris has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83812


Change subject: Add monitoring of datasources
..

Add monitoring of datasources

Change-Id: I62fcb0a09e46cba51343d5cc0cf90a1a7bb71719
---
M scripts/check_web_page.sh
1 file changed, 126 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/geowiki 
refs/changes/12/83812/1

diff --git a/scripts/check_web_page.sh b/scripts/check_web_page.sh
index 980f4ab..3e17282 100755
--- a/scripts/check_web_page.sh
+++ b/scripts/check_web_page.sh
@@ -31,6 +31,19 @@
 URL_BASE=http://gp.wmflabs.org/;
 URL_BASE_DASHBOARD=$URL_BASE/dashboards
 URL_BASE_GRAPH=$URL_BASE/graphs
+URL_BASE_DATASOURCE=$URL_BASE/datasources
+
+# Some files have a last data point that is further back. Either
+# because the wiki ran out of active editors, or the file has to be
+# generated by hand. The EXPECTED_LAST_DATE_OVERRIDE array is used to
+# override the default expected date (i.e.: current day) of the last
+# data point of a file.
+declare -A EXPECTED_LAST_DATE_OVERRIDE
+EXPECTED_LAST_DATE_OVERRIDE[global_south_editor_fractions]=2013-08-20
+EXPECTED_LAST_DATE_OVERRIDE[grants_count_by_global_south]=2013-06-01
+EXPECTED_LAST_DATE_OVERRIDE[grants_count_by_program]=2013-06-01
+EXPECTED_LAST_DATE_OVERRIDE[grants_spending_by_global_south]=2013-06-01
+EXPECTED_LAST_DATE_OVERRIDE[grants_spending_by_program]=2013-06-01
 
 # Set DEBUG to local to download files into /tmp and use those copies
 # instead of fetching the files again and again for each run. Files do
@@ -84,6 +97,32 @@
error Could not create temporary file '$TMP_FILE_ABS'
 fi
 TMP_FILES_ABS=( ${TMP_FILES_ABS[@]} ${TMP_FILE_ABS} )
+}
+
+#---
+# Get the expected date for the last data point in a file.
+#
+# The date is typically the current day. However, some wikis do not
+# have any active editors, so for them, the last active data point
+# might be further back. Other files get generated by hand, so their
+# expected last data point is from a different day as well.
+#
+# Input:
+#   $1 - Stub of the file's name for which to set the expected date.
+#E.g.: ee_top10, lg_all, global_south.
+#
+# Output:
+#   EXPECTED_LAST_DATE - The date (in -MM-DD format) of the last
+#data point that is expected for this stub.
+#
+set_EXPECTED_LAST_DATE() {
+local STUB=$1
+
+EXPECTED_LAST_DATE=${EXPECTED_LAST_DATE_OVERRIDE[$STUB]}
+if [ -z $EXPECTED_LAST_DATE ]
+then
+   EXPECTED_LAST_DATE=$(date +'%Y-%m-%d')
+fi
 }
 
 #---
@@ -245,6 +284,64 @@
 }
 
 #---
+# Downloads a datasource file and does some basic checks on the file
+#
+# It is assured (not by parsing the json, but by some basic grepping)
+#   * the file contains a matching id node, and
+#   * the file contains a name node that is a string.
+#
+# Input:
+#   $1 - The file's format. I.e.: json or csv
+#   $2 - The file's stub. E.g.: active_editors_by_region,
+#pt_top10.
+#
+# Output:
+#   -
+#
+check_datasource() {
+local DATASOURCE_FORMAT=$1
+local DATASOURCE_STUB=$2
+
+local DOWNLOADED_FILE_ABS=
+check_json datasource ${DATASOURCE_STUB} 
${URL_BASE_DATASOURCE}/${DATASOURCE_STUB}
+
+
+# We do not parse the json, just to some further datasource specific 
checks.
+
+# check for format
+if ! grep -q 'format[[:space:]]*:[[:space:]]*'$DATASOURCE_FORMAT'' 
${DOWNLOADED_FILE_ABS}
+then
+   error Could not find marker for format '$DATASOURCE_FORMAT' for 
datasource '$DATASOURCE_STUB'
+fi
+
+# check for URL
+# EXPECTED_URL is used as RE.
+local EXPECTED_URL=
+if [ $DATASOURCE_STUB = map-world_countries ]
+then
+   EXPECTED_URL=/data/geo/gp/maps/world-countries.json
+else
+   EXPECTED_URL=/data/datafiles/gp/$DATASOURCE_STUB.$DATASOURCE_FORMAT
+fi
+if ! grep -q 'url[[:space:]]*:[[:space:]]*'$EXPECTED_URL'' 
${DOWNLOADED_FILE_ABS}
+then
+   error Could not URL of the form '$EXPECTED_URL' for datasource 
'$DATASOURCE_STUB'
+fi
+
+# Format specific checks
+case $DATASOURCE_FORMAT in
+   csv )
+   # Check for end date
+   set_EXPECTED_LAST_DATE $DATASOURCE_STUB
+   if ! grep -q 
'end[[:space:]]*:[[:space:]]*'${EXPECTED_LAST_DATE//-//}'' 
${DOWNLOADED_FILE_ABS}
+   then
+   error Could not find end date ${EXPECTED_LAST_DATE} for 
datasource '$DATASOURCE_STUB'
+   fi
+   ;;
+esac
+}
+
+#---
 # Checks that geowiki's dashboards are ok.
 #
 # Input:
@@ -279,6 +376,34 @@
 }
 
 #---
+# Checks that geowiki's datasources are ok.
+#
+# Input:
+#   -
+#
+# Output:
+#   -
+#
+check_datasources() {
+check_datasource csv  

[MediaWiki-commits] [Gerrit] API: Check for nosuchsection in all code paths - change (mediawiki/core)

2013-09-11 Thread Anomie (Code Review)
Anomie has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83833


Change subject: API: Check for nosuchsection in all code paths
..

API: Check for nosuchsection in all code paths

nosuchsection is currently checked only in the appendtext/prependtext
code path. Add a check for out of range section numbers in the main code
path too.

Bug: 53884
Change-Id: I5bafe8625122ca66415602c37cbca7d7f4c17742
---
M includes/api/ApiEditPage.php
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/33/83833/1

diff --git a/includes/api/ApiEditPage.php b/includes/api/ApiEditPage.php
index d14219f..8e6c341 100644
--- a/includes/api/ApiEditPage.php
+++ b/includes/api/ApiEditPage.php
@@ -280,6 +280,9 @@
if ( $section == 0  $params['section'] != '0'  
$params['section'] != 'new' ) {
$this-dieUsage( The section parameter must be 
set to an integer or 'new', invalidsection );
}
+   if ( !$pageObj-getContent()-getSection( $section ) ) {
+   $this-dieUsage( There is no section 
{$section}., 'nosuchsection' );
+   }
$requestArray['wpSection'] = $params['section'];
} else {
$requestArray['wpSection'] = '';

-- 
To view, visit https://gerrit.wikimedia.org/r/83833
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5bafe8625122ca66415602c37cbca7d7f4c17742
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Anomie bjor...@wikimedia.org

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


  1   2   3   >