From 17ccccda2ad1202334e548164251ebd725fe223f Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Tue, 10 Apr 2012 10:52:11 +0200 Subject: [PATCH] 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 --- includes/GitInfo.php | 6 ++++++ includes/debug/Debug.php | 1 + resources/mediawiki/mediawiki.debug.js | 8 ++++++-- 3 files changed, 13 insertions(+), 2 deletions(-) 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 ); -- 2.20.1