From: Alexandre Emsenhuber Date: Tue, 10 Apr 2012 08:52:11 +0000 (+0200) Subject: Follow-up I5b02aa914916f64492c85ce6dcc3272b6406551a (#4335), also put a link in the... X-Git-Tag: 1.31.0-rc.0~23937^2 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=17ccccda2ad1202334e548164251ebd725fe223f;p=lhc%2Fweb%2Fwiklou.git Follow-up I5b02aa914916f64492c85ce6dcc3272b6406551a (#4335), also put a link in the debug toolbar. Now that there is a link on the revision hash in Special:Version, do the same in the debug toolbar. Change-Id: I953ac70e17e72be68251e3908e164dfa46c68bf5 --- diff --git a/includes/GitInfo.php b/includes/GitInfo.php index c2066ae801..49539659a4 100644 --- a/includes/GitInfo.php +++ b/includes/GitInfo.php @@ -181,4 +181,10 @@ class GitInfo { return self::repo()->getCurrentBranch(); } + /** + * @see self::getHeadViewUrl() + */ + public static function headViewUrl() { + return self::repo()->getHeadViewUrl(); + } } diff --git a/includes/debug/Debug.php b/includes/debug/Debug.php index 418eede550..10905f2c95 100644 --- a/includes/debug/Debug.php +++ b/includes/debug/Debug.php @@ -260,6 +260,7 @@ class MWDebug { 'phpVersion' => PHP_VERSION, 'gitRevision' => GitInfo::headSHA1(), 'gitBranch' => GitInfo::currentBranch(), + 'gitViewUrl' => GitInfo::headViewUrl(), 'time' => microtime( true ) - $wgRequestTime, 'log' => self::$log, 'debugLog' => self::$debug, diff --git a/resources/mediawiki/mediawiki.debug.js b/resources/mediawiki/mediawiki.debug.js index 2afcbc6f90..e631c76014 100644 --- a/resources/mediawiki/mediawiki.debug.js +++ b/resources/mediawiki/mediawiki.debug.js @@ -161,12 +161,16 @@ var gitInfo = ''; if ( this.data.gitRevision != false ) { - gitInfo = ' (' + this.data.gitRevision.substring( 0, 7 ) + ')'; + gitInfo = '(' + this.data.gitRevision.substring( 0, 7 ) + ')'; + if ( this.data.gitViewUrl != false ) { + gitInfo = $( '' ).attr( 'href', this.data.gitViewUrl ).text( gitInfo ); + } } bitDiv( 'mwversion' ) .append( $( '' ).text( 'MediaWiki' ) ) - .append( ': ' + this.data.mwVersion + gitInfo ); + .append( ': ' + this.data.mwVersion + ' ' ) + .append( gitInfo ); if ( this.data.gitBranch != false ) { bitDiv( 'gitbranch' ).text( 'Git branch: ' + this.data.gitBranch );