Index: trunk/extensions/CodeReview/ui/CodeRevisionListView.php |
— | — | @@ -4,10 +4,15 @@ |
5 | 5 | class CodeRevisionListView extends CodeView { |
6 | 6 | public $mRepo, $mPath, $batchForm; |
7 | 7 | |
8 | | - function __construct( $repoName ) { |
| 8 | + /** |
| 9 | + * @param $repo CodeRepository or String |
| 10 | + */ |
| 11 | + function __construct( $repo ) { |
9 | 12 | global $wgRequest; |
10 | 13 | parent::__construct(); |
11 | | - $this->mRepo = CodeRepository::newFromName( $repoName ); |
| 14 | + $this->mRepo = ( $repo instanceof CodeRepository ) |
| 15 | + ? $repo |
| 16 | + : CodeRepository::newFromName( $repo ); |
12 | 17 | $this->mPath = htmlspecialchars( trim( $wgRequest->getVal( 'path' ) ) ); |
13 | 18 | if ( strlen( $this->mPath ) && $this->mPath[0] !== '/' ) { |
14 | 19 | $this->mPath = "/{$this->mPath}"; // make sure this is a valid path |