r77631 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77630‎ | r77631 | r77632 >
Date:01:34, 3 December 2010
Author:reedy
Status:ok
Tags:
Comment:
Allow CodeRevisionListView to be constructed with a CodeRepository, or a string for the repo name
Modified paths:
  • /trunk/extensions/CodeReview/ui/CodeRevisionListView.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/ui/CodeRevisionListView.php
@@ -4,10 +4,15 @@
55 class CodeRevisionListView extends CodeView {
66 public $mRepo, $mPath, $batchForm;
77
8 - function __construct( $repoName ) {
 8+ /**
 9+ * @param $repo CodeRepository or String
 10+ */
 11+ function __construct( $repo ) {
912 global $wgRequest;
1013 parent::__construct();
11 - $this->mRepo = CodeRepository::newFromName( $repoName );
 14+ $this->mRepo = ( $repo instanceof CodeRepository )
 15+ ? $repo
 16+ : CodeRepository::newFromName( $repo );
1217 $this->mPath = htmlspecialchars( trim( $wgRequest->getVal( 'path' ) ) );
1318 if ( strlen( $this->mPath ) && $this->mPath[0] !== '/' ) {
1419 $this->mPath = "/{$this->mPath}"; // make sure this is a valid path

Status & tagging log