r49948 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49947‎ | r49948 | r49949 >
Date:13:00, 27 April 2009
Author:shinjiman
Status:reverted (Comments)
Tags:
Comment:
* (bug 18593) Unify svn-revision references in Special:Version
Modified paths:
  • /trunk/phase3/includes/specials/SpecialVersion.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialVersion.php
@@ -115,7 +115,7 @@
116116 global $wgVersion, $IP;
117117 wfProfileIn( __METHOD__ );
118118 $svn = self::getSvnRevision( $IP, false );
119 - $version = $svn ? "$wgVersion (r$svn)" : $wgVersion;
 119+ $version = $svn ? $wgVersion . wfMsg( 'version-svn-revision', $svn ) : $wgVersion;
120120 wfProfileOut( __METHOD__ );
121121 return $version;
122122 }
@@ -131,7 +131,7 @@
132132 wfProfileIn( __METHOD__ );
133133 $svn = self::getSvnRevision( $IP, false );
134134 $viewvc = 'http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/?pathrev=';
135 - $version = $svn ? "$wgVersion ([{$viewvc}{$svn} r$svn])" : $wgVersion;
 135+ $version = $svn ? $wgVersion . " [{$viewvc}{$svn} " . wfMsg( 'version-svn-revision', $svn ) . ']' : $wgVersion;
136136 wfProfileOut( __METHOD__ );
137137 return $version;
138138 }
@@ -221,9 +221,10 @@
222222 }
223223
224224 function formatCredits( $name, $version = null, $subVersion = null, $author = null, $url = null, $description = null, $descriptionMsg = null ) {
 225+ $viewvc = 'http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/?pathrev=';
225226 $extension = isset( $url ) ? "[$url $name]" : $name;
226227 $version = isset( $version ) ? wfMsg( 'version-version', $version ) : '';
227 - $subVersion = isset( $subVersion ) ? wfMsg( 'version-svn-revision', $subVersion ) : '';
 228+ $subVersion = isset( $subVersion ) ? " [{$viewvc}{$subVersion} " . wfMsg( 'version-svn-revision', $subVersion ) . ']' : '';
228229
229230 # Look for a localized description
230231 if( isset( $descriptionMsg ) ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r49995* (bug 18593) Unify svn-revision references in Special:Version, in addition w...shinjiman05:24, 28 April 2009

Comments

#Comment by Brion VIBBER (talk | contribs)   17:57, 27 April 2009

This was partially reverted in r49950 apparently on the basis that it looks funny. :)

More seriously, it has some real problems:

  • Hardcoded Wikimedia SVN URL means that extensions checked out from a third-party SVN will be totally wrong
  • Hardcoded trunk path means that extensions checked out from branch will link to the totally wrong place
  • Hardcoded path points just to 'extensions' and fails to specify the particular directory

You should be able to extract the actual source path out of the .svn files just like the version, in which case we can identify whether it's our own SVN and we can stick a pretty viewvc link on it -- with the correct path.

Status & tagging log