Page MenuHomePhabricator

Special:Version doesn't list hashes of extensions checked out from git
Closed, ResolvedPublic

Description

Testing head, any extensions that are from the git repo don't get version hashes, but the SVN ones do.

Oversight?


Version: 1.19
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=39994

Details

Reference
bz35649

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 12:17 AM
bzimport set Reference to bz35649.
bzimport added a subscriber: Unknown Object (MLST).

I guess it is:

/**

  • Return a string of the MediaWiki version with SVN revision if available. *
  • @param $flags String
  • @return mixed
	 */

public static function getVersion( $flags = '' ) {

		global $wgVersion, $IP;
		wfProfileIn( __METHOD__ );

		$info = self::getSvnInfo( $IP );
		if ( !$info ) {
			$version = $wgVersion;
		} elseif( $flags === 'nodb' ) {
			$version = "$wgVersion (r{$info['checkout-rev']})";
		} else {
			$version = $wgVersion . ' ' .
				wfMsg(
					'version-svn-revision',
					isset( $info['directory-rev'] ) ? $info['directory-rev'] : '',
					$info['checkout-rev']
				);
		}

		wfProfileOut( __METHOD__ );
		return $version;

}

vs for core:

/**

  • Return a wikitext-formatted string of the MediaWiki version with a link to
  • the SVN revision or the git SHA1 of head if available.
  • Git is prefered over Svn
  • The fallback is just $wgVersion *
  • @return mixed
	 */

public static function getVersionLinked() {

		global $wgVersion;
		wfProfileIn( __METHOD__ );

		if( $gitVersion = self::getVersionLinkedGit() ) {
			$v = $gitVersion;
		} elseif( $svnVersion = self::getVersionLinkedSvn() ) {
			$v = $svnVersion;
		} else {
			$v = $wgVersion; // fallback
		}

		wfProfileOut( __METHOD__ );
		return $v;

}

Fix pending review in Git changeset #4332.

Gerrit changeset #4332 is better :)