Index: trunk/phase3/includes/specials/SpecialVersion.php |
— | — | @@ -114,8 +114,9 @@ |
115 | 115 | public static function getVersion() { |
116 | 116 | global $wgVersion, $IP; |
117 | 117 | wfProfileIn( __METHOD__ ); |
118 | | - $svn = self::getSvnRevision( $IP, false , false); |
119 | | - $version = $svn ? $wgVersion . wfMsg( 'version-svn-revision', $svn ) : $wgVersion; |
| 118 | + $svn = self::getSvnRevision( $IP, false, false , false); |
| 119 | + $svnCo = self::getSvnRevision( $IP, true, false , false); |
| 120 | + $version = $svn ? $wgVersion . wfMsg( 'version-svn-revision', $svn, $svnCo ) : $wgVersion; |
120 | 121 | wfProfileOut( __METHOD__ ); |
121 | 122 | return $version; |
122 | 123 | } |
— | — | @@ -129,12 +130,13 @@ |
130 | 131 | public static function getVersionLinked() { |
131 | 132 | global $wgVersion, $IP; |
132 | 133 | wfProfileIn( __METHOD__ ); |
133 | | - $svn = self::getSvnRevision( $IP, false, false ); |
134 | | - $svnDir = self::getSvnRevision( $IP, false, true ); |
| 134 | + $svn = self::getSvnRevision( $IP, false, false, false ); |
| 135 | + $svnCo = self::getSvnRevision( $IP, true, false, false ); |
| 136 | + $svnDir = self::getSvnRevision( $IP, true, false, true ); |
135 | 137 | $viewvcStart = 'http://svn.wikimedia.org/viewvc/mediawiki/'; |
136 | 138 | $viewvcEnd = '/?pathrev='; |
137 | 139 | $viewvc = $viewvcStart . $svnDir . $viewvcEnd; |
138 | | - $version = $svn ? $wgVersion . " [{$viewvc}{$svn} " . wfMsg( 'version-svn-revision', $svn ) . ']' : $wgVersion; |
| 140 | + $version = $svn ? $wgVersion . " [{$viewvc}{$svnCo} " . wfMsg( 'version-svn-revision', $svn, $svnCo ) . ']' : $wgVersion; |
139 | 141 | wfProfileOut( __METHOD__ ); |
140 | 142 | return $version; |
141 | 143 | } |
— | — | @@ -167,10 +169,12 @@ |
168 | 170 | foreach ( $wgExtensionCredits[$type] as $extension ) { |
169 | 171 | $version = null; |
170 | 172 | $subVersion = null; |
| 173 | + $subVersionCo = null; |
171 | 174 | $viewvc = null; |
172 | 175 | if ( isset( $extension['path'] ) ) { |
173 | | - $subVersion = self::getSvnRevision(dirname($extension['path']), true, false); |
174 | | - $subVersionDir = self::getSvnRevision(dirname($extension['path']), true, true); |
| 176 | + $subVersion = self::getSvnRevision(dirname($extension['path']), false, true, false); |
| 177 | + $subVersionCo = self::getSvnRevision(dirname($extension['path']), true, true, false); |
| 178 | + $subVersionDir = self::getSvnRevision(dirname($extension['path']), false, true, true); |
175 | 179 | if ($subVersionDir) |
176 | 180 | $viewvc = $subVersionDir . $subVersion; |
177 | 181 | } |
— | — | @@ -182,6 +186,7 @@ |
183 | 187 | isset ( $extension['name'] ) ? $extension['name'] : '', |
184 | 188 | $version, |
185 | 189 | $subVersion, |
| 190 | + $subVersionCo, |
186 | 191 | $viewvc, |
187 | 192 | isset ( $extension['author'] ) ? $extension['author'] : '', |
188 | 193 | isset ( $extension['url'] ) ? $extension['url'] : null, |
— | — | @@ -229,10 +234,10 @@ |
230 | 235 | } |
231 | 236 | } |
232 | 237 | |
233 | | - function formatCredits( $name, $version = null, $subVersion = null, $subVersionURL = null, $author = null, $url = null, $description = null, $descriptionMsg = null ) { |
| 238 | + function formatCredits( $name, $version = null, $subVersion = null, $subVersionCo = null, $subVersionURL = null, $author = null, $url = null, $description = null, $descriptionMsg = null ) { |
234 | 239 | $extension = isset( $url ) ? "[$url $name]" : $name; |
235 | 240 | $version = isset( $version ) ? wfMsg( 'version-version', $version ) : ''; |
236 | | - $subVersion = isset( $subVersion ) ? wfMsg( 'version-svn-revision', $subVersion ) : ''; |
| 241 | + $subVersion = isset( $subVersion ) ? wfMsg( 'version-svn-revision', $subVersion, $subVersionCo ) : ''; |
237 | 242 | $subVersion = isset( $subVersionURL ) ? "[$subVersionURL $subVersion]" : $subVersion; |
238 | 243 | |
239 | 244 | # Look for a localized description |
— | — | @@ -348,10 +353,16 @@ |
349 | 354 | /** |
350 | 355 | * Retrieve the revision number of a Subversion working directory. |
351 | 356 | * |
352 | | - * @param string $dir |
353 | | - * @return mixed revision number as int, or false if not a SVN checkout |
| 357 | + * @param String $dir Directory of the svn checkout |
| 358 | + * @param Boolean $coRev optional to return value whether is Last Modified |
| 359 | + * or Checkout revision number |
| 360 | + * @param Boolean $extension optional to check the path whether is from |
| 361 | + * Wikimedia SVN server or not |
| 362 | + * @param Boolean $relPath optional to get the end part of the checkout path |
| 363 | + * @return mixed revision number as int, end part of the checkout path, |
| 364 | + * or false if not a SVN checkout |
354 | 365 | */ |
355 | | - public static function getSvnRevision( $dir , $extension = false, $relPath = false) { |
| 366 | + public static function getSvnRevision( $dir, $coRev = false, $extension = false, $relPath = false) { |
356 | 367 | // http://svnbook.red-bean.com/nightly/en/svn.developer.insidewc.html |
357 | 368 | $entries = $dir . '/.svn/entries'; |
358 | 369 | |
— | — | @@ -416,12 +427,12 @@ |
417 | 428 | } |
418 | 429 | return $endPath; |
419 | 430 | } |
420 | | - if ($extension) |
421 | | - // get the last file revsion number |
422 | | - return intval( $content[10]) ; |
| 431 | + if ($coRev) |
| 432 | + // get the directory checkout revsion number |
| 433 | + return intval( $content[3]) ; |
423 | 434 | else |
424 | | - // get the directory revsion number |
425 | | - return intval( $content[3] ); |
| 435 | + // get the directory last modified revision number |
| 436 | + return intval( $content[10] ); |
426 | 437 | } |
427 | 438 | } |
428 | 439 | |
Index: trunk/phase3/languages/messages/MessagesQqq.php |
— | — | @@ -2853,8 +2853,11 @@ |
2854 | 2854 | 'version-hook-name' => 'Shown in [[Special:Version]]', |
2855 | 2855 | 'version-hook-subscribedby' => 'Shown in [[Special:Version]]', |
2856 | 2856 | 'version-version' => '{{Identical|Version}}', |
2857 | | -'version-svn-revision' => 'This is being used in [[Special:Version]], preceeding the subversion revision numbers of the extensions loaded inside brackets, like this: "({{int:version-revision}} r012345") |
| 2857 | +'version-svn-revision' => 'This is being used in [[Special:Version]], preceeding the subversion revision numbers of both the core and the extensions loaded. |
2858 | 2858 | |
| 2859 | +* $1: last modified directory revision number |
| 2860 | +* $2: checkout directory revision number |
| 2861 | + |
2859 | 2862 | {{Identical|Revision}}', |
2860 | 2863 | 'version-software-product' => 'Shown in [[Special:Version]]', |
2861 | 2864 | 'version-software-version' => '{{Identical|Version}}', |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -3826,7 +3826,7 @@ |
3827 | 3827 | 'version-hook-name' => 'Hook name', |
3828 | 3828 | 'version-hook-subscribedby' => 'Subscribed by', |
3829 | 3829 | 'version-version' => '(Version $1)', |
3830 | | -'version-svn-revision' => '(r$1)', # only translate this message to other languages if you have to change it |
| 3830 | +'version-svn-revision' => '(r$1/r$2)', # only translate this message to other languages if you have to change it |
3831 | 3831 | 'version-license' => 'License', |
3832 | 3832 | 'version-software' => 'Installed software', |
3833 | 3833 | 'version-software-product' => 'Product', |