r54962 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r54961‎ | r54962 | r54963 >
Date:19:12, 13 August 2009
Author:brion
Status:deferred
Tags:
Comment:
Fix up the SVN path so it'll pull correctly from our trunk (or other branch that you can select)
Modified paths:
  • /trunk/extensions/LocalisationUpdate/KNOWN_ISSUES.txt (modified) (history)
  • /trunk/extensions/LocalisationUpdate/LocalisationUpdate.class.php (modified) (history)
  • /trunk/extensions/LocalisationUpdate/LocalisationUpdate.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LocalisationUpdate/KNOWN_ISSUES.txt
@@ -7,10 +7,5 @@
88 * Seems to want to store a copy of the localization updates in each local database.
99 We've got hundreds of wikis run from the same installation set; we don't want to multiply our effort by 1000.
1010
11 -* The SVN URL is missing the protocol and the branch path, which are mysteriously hardcoded to
12 -'http://' (ok in our case) and the SVN checkout of the current working directory of your MW install
13 -(very bad, since it makes it impossible to pull trunk updates for wmf-deployment branch; also
14 -means you couldn't run it on a release tarball)
15 -
1611 * It doesn't seem to be using available memcached stuff; unsure yet whether this is taken care of
1712 by the general message caching or if we're going to end up making extra hits we don't need.
Index: trunk/extensions/LocalisationUpdate/LocalisationUpdate.php
@@ -7,7 +7,7 @@
88
99 // Configuration
1010
11 -$wgLocalisationUpdateSVNURL = "svn.wikimedia.org/svnroot/mediawiki/";
 11+$wgLocalisationUpdateSVNURL = "http://svn.wikimedia.org/svnroot/mediawiki/trunk";
1212 $wgLocalisationUpdateRetryAttempts = 5;
1313
1414 // Info about me!
Index: trunk/extensions/LocalisationUpdate/LocalisationUpdate.class.php
@@ -27,6 +27,7 @@
2828
2929 // Update all Extension messages
3030 foreach ( $wgExtensionMessagesFiles as $extension => $locFile ) {
 31+ var_dump( $locFile );
3132 $result += self::updateExtensionMessages( $locFile, $extension, $verbose );
3233 }
3334
@@ -39,17 +40,12 @@
4041 // Update Extension Messages
4142 public static function updateExtensionMessages( $file, $extension, $verbose ) {
4243 global $IP, $wgLocalisationUpdateSVNURL;
43 -
44 - // Find the right SVN folder
45 - // @fixme this prevents pulling trunk updates when we're on a deployment branch.
46 - // Base URL should be fully configurable and make no branch assumptions.
47 - $svnFolder = SpecialVersion::getSvnRevision( dirname( $file ), false, false, true );
48 -
 44+
4945 // Create a full path
50 - $localfile = $IP . "/" . $file;
 46+ $localfile = $IP . "/" . $file; // note $file should start with "extensions/"
5147
5248 // Get the full SVN directory path
53 - $svndir = "http://" . $wgLocalisationUpdateSVNURL . $svnFolder;
 49+ $svndir = "$wgLocalisationUpdateSVNURL/$file";
5450
5551 // Compare the 2 files
5652 $result = self::compareExtensionFiles( $extension, $svndir . "/" . basename( $file ), $file, $verbose, false, true );
@@ -67,22 +63,13 @@
6864 $dirname = "languages/messages";
6965
7066 // Get the full path to the directory
71 - $dirname = $IP . "/" . $dirname;
 67+ $localdir = $IP . "/" . $dirname;
7268
73 - // Get the SVN folder used for the checkout
74 - $svnFolder = SpecialVersion::getSvnRevision( $dirname, false, false, true );
75 -
76 - // Do not update if not from SVN
77 - if ( empty( $svnFolder ) ) {
78 - self::myLog( 'Cannot update localisation as the files are not retrieved from SVN' );
79 - return 0;
80 - }
81 -
8269 // Get the full SVN Path
83 - $svndir = "http://" . $wgLocalisationUpdateSVNURL . $svnFolder;
 70+ $svndir = "$wgLocalisationUpdateSVNURL/phase3/$dirname";
8471
8572 // Open the directory
86 - $dir = opendir( $dirname );
 73+ $dir = opendir( $localdir );
8774 while ( false !== ( $file = readdir( $dir ) ) ) {
8875 $m = array();
8976
@@ -96,7 +83,7 @@
9784 closedir( $dir );
9885
9986 // Find the changed English strings (as these messages won't be updated in ANY language)
100 - $changedEnglishStrings = self::compareFiles( $dirname . "/MessagesEn.php", $svndir . "/MessagesEn.php", $verbose );
 87+ $changedEnglishStrings = self::compareFiles( $localdir . "/MessagesEn.php", $svndir . "/MessagesEn.php", $verbose );
10188
10289 // Count the changes
10390 $changedCount = 0;
@@ -105,7 +92,7 @@
10693 sort($files);
10794 foreach ( $files as $file ) {
10895 $svnfile = $svndir . "/" . $file;
109 - $localfile = $dirname . "/" . $file;
 96+ $localfile = $localdir . "/" . $file;
11097
11198 // Compare the files
11299 $result = self::compareFiles( $svnfile, $localfile, $verbose, $changedEnglishStrings, false, true );

Status & tagging log