Index: trunk/extensions/LocalisationUpdate/KNOWN_ISSUES.txt |
— | — | @@ -7,10 +7,5 @@ |
8 | 8 | * Seems to want to store a copy of the localization updates in each local database. |
9 | 9 | We've got hundreds of wikis run from the same installation set; we don't want to multiply our effort by 1000. |
10 | 10 | |
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 | | - |
16 | 11 | * It doesn't seem to be using available memcached stuff; unsure yet whether this is taken care of |
17 | 12 | 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 @@ |
8 | 8 | |
9 | 9 | // Configuration |
10 | 10 | |
11 | | -$wgLocalisationUpdateSVNURL = "svn.wikimedia.org/svnroot/mediawiki/"; |
| 11 | +$wgLocalisationUpdateSVNURL = "http://svn.wikimedia.org/svnroot/mediawiki/trunk"; |
12 | 12 | $wgLocalisationUpdateRetryAttempts = 5; |
13 | 13 | |
14 | 14 | // Info about me! |
Index: trunk/extensions/LocalisationUpdate/LocalisationUpdate.class.php |
— | — | @@ -27,6 +27,7 @@ |
28 | 28 | |
29 | 29 | // Update all Extension messages |
30 | 30 | foreach ( $wgExtensionMessagesFiles as $extension => $locFile ) { |
| 31 | + var_dump( $locFile ); |
31 | 32 | $result += self::updateExtensionMessages( $locFile, $extension, $verbose ); |
32 | 33 | } |
33 | 34 | |
— | — | @@ -39,17 +40,12 @@ |
40 | 41 | // Update Extension Messages |
41 | 42 | public static function updateExtensionMessages( $file, $extension, $verbose ) { |
42 | 43 | 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 | + |
49 | 45 | // Create a full path |
50 | | - $localfile = $IP . "/" . $file; |
| 46 | + $localfile = $IP . "/" . $file; // note $file should start with "extensions/" |
51 | 47 | |
52 | 48 | // Get the full SVN directory path |
53 | | - $svndir = "http://" . $wgLocalisationUpdateSVNURL . $svnFolder; |
| 49 | + $svndir = "$wgLocalisationUpdateSVNURL/$file"; |
54 | 50 | |
55 | 51 | // Compare the 2 files |
56 | 52 | $result = self::compareExtensionFiles( $extension, $svndir . "/" . basename( $file ), $file, $verbose, false, true ); |
— | — | @@ -67,22 +63,13 @@ |
68 | 64 | $dirname = "languages/messages"; |
69 | 65 | |
70 | 66 | // Get the full path to the directory |
71 | | - $dirname = $IP . "/" . $dirname; |
| 67 | + $localdir = $IP . "/" . $dirname; |
72 | 68 | |
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 | | - |
82 | 69 | // Get the full SVN Path |
83 | | - $svndir = "http://" . $wgLocalisationUpdateSVNURL . $svnFolder; |
| 70 | + $svndir = "$wgLocalisationUpdateSVNURL/phase3/$dirname"; |
84 | 71 | |
85 | 72 | // Open the directory |
86 | | - $dir = opendir( $dirname ); |
| 73 | + $dir = opendir( $localdir ); |
87 | 74 | while ( false !== ( $file = readdir( $dir ) ) ) { |
88 | 75 | $m = array(); |
89 | 76 | |
— | — | @@ -96,7 +83,7 @@ |
97 | 84 | closedir( $dir ); |
98 | 85 | |
99 | 86 | // 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 ); |
101 | 88 | |
102 | 89 | // Count the changes |
103 | 90 | $changedCount = 0; |
— | — | @@ -105,7 +92,7 @@ |
106 | 93 | sort($files); |
107 | 94 | foreach ( $files as $file ) { |
108 | 95 | $svnfile = $svndir . "/" . $file; |
109 | | - $localfile = $dirname . "/" . $file; |
| 96 | + $localfile = $localdir . "/" . $file; |
110 | 97 | |
111 | 98 | // Compare the files |
112 | 99 | $result = self::compareFiles( $svnfile, $localfile, $verbose, $changedEnglishStrings, false, true ); |