r81317 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81316‎ | r81317 | r81318 >
Date:20:36, 1 February 2011
Author:reedy
Status:ok
Tags:
Comment:
Revert r81131, r81199 to fix bug 27079, for ease of sanity
Modified paths:
  • /trunk/extensions/CodeReview/backend/CodeCommentLinker.php (modified) (history)
  • /trunk/extensions/CodeReview/backend/Subversion.php (modified) (history)
  • /trunk/extensions/CodeReview/ui/CodeAuthorListView.php (modified) (history)
  • /trunk/extensions/CodeReview/ui/CodeCommentsAuthorListView.php (modified) (history)
  • /trunk/extensions/CodeReview/ui/CodeCommentsListView.php (modified) (history)
  • /trunk/extensions/CodeReview/ui/CodeReleaseNotes.php (modified) (history)
  • /trunk/extensions/CodeReview/ui/CodeRepoStatsView.php (modified) (history)
  • /trunk/extensions/CodeReview/ui/CodeRevisionAuthorLink.php (modified) (history)
  • /trunk/extensions/CodeReview/ui/CodeRevisionAuthorView.php (modified) (history)
  • /trunk/extensions/CodeReview/ui/CodeRevisionCommitter.php (modified) (history)
  • /trunk/extensions/CodeReview/ui/CodeRevisionListView.php (modified) (history)
  • /trunk/extensions/CodeReview/ui/CodeRevisionStatusView.php (modified) (history)
  • /trunk/extensions/CodeReview/ui/CodeRevisionTagView.php (modified) (history)
  • /trunk/extensions/CodeReview/ui/CodeRevisionView.php (modified) (history)
  • /trunk/extensions/CodeReview/ui/CodeStatusChangeListView.php (modified) (history)
  • /trunk/extensions/CodeReview/ui/CodeStatusListView.php (modified) (history)
  • /trunk/extensions/CodeReview/ui/CodeTagListView.php (modified) (history)
  • /trunk/extensions/CodeReview/ui/CodeView.php (modified) (history)
  • /trunk/extensions/CodeReview/ui/SpecialCode.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/backend/CodeCommentLinker.php
@@ -2,20 +2,10 @@
33
44 abstract class CodeCommentLinker {
55
6 - /**
7 - * @var CodeRepository
8 - */
9 - protected $repo;
10 -
11 - /**
12 - * @var Skin
13 - */
14 - protected $skin;
15 -
166 function __construct( $repo ) {
177 global $wgUser;
188 $this->skin = $wgUser->getSkin();
19 - $this->repo = $repo;
 9+ $this->mRepo = $repo;
2010 }
2111
2212 function link( $text ) {
@@ -39,7 +29,7 @@
4030 function messageBugLink( $arr ) {
4131 $text = $arr[0];
4232 $bugNo = intval( $arr[1] );
43 - $url = $this->repo->getBugPath( $bugNo );
 33+ $url = $this->mRepo->getBugPath( $bugNo );
4434 if ( $url ) {
4535 return $this->makeExternalLink( $url, $text );
4636 } else {
@@ -51,7 +41,7 @@
5242 $text = $matches[0];
5343 $rev = intval( $matches[1] );
5444
55 - $repo = $this->repo->getName();
 45+ $repo = $this->mRepo->getName();
5646 $title = SpecialPage::getTitleFor( 'Code', "$repo/$rev" );
5747
5848 return $this->makeInternalLink( $title, $text );
Index: trunk/extensions/CodeReview/backend/Subversion.php
@@ -5,7 +5,7 @@
66 /**
77 * @var string
88 */
9 - protected $repoPath;
 9+ protected $mRepoPath;
1010
1111 public static function newFromRepo( $repo ) {
1212 global $wgSubversionProxy, $wgSubversionProxyTimeout;
@@ -22,7 +22,7 @@
2323 * @param $repo String Path to SVN Repo
2424 */
2525 function __construct( $repoPath ) {
26 - $this->repoPath = $repoPath;
 26+ $this->mRepoPath = $repoPath;
2727 }
2828
2929 abstract function canConnect();
@@ -80,13 +80,13 @@
8181 }
8282
8383 function getFile( $path, $rev = null ) {
84 - return svn_cat( $this->repoPath . $path, $rev );
 84+ return svn_cat( $this->mRepoPath . $path, $rev );
8585 }
8686
8787 function getDiff( $path, $rev1, $rev2 ) {
8888 list( $fout, $ferr ) = svn_diff(
89 - $this->repoPath . $path, $rev1,
90 - $this->repoPath . $path, $rev2 );
 89+ $this->mRepoPath . $path, $rev1,
 90+ $this->mRepoPath . $path, $rev2 );
9191
9292 if ( $fout ) {
9393 // We have to read out the file descriptors. :P
@@ -104,13 +104,13 @@
105105 }
106106
107107 function getDirList( $path, $rev = null ) {
108 - return svn_ls( $this->repoPath . $path,
 108+ return svn_ls( $this->mRepoPath . $path,
109109 $this->_rev( $rev, SVN_REVISION_HEAD ) );
110110 }
111111
112112 function getLog( $path, $startRev = null, $endRev = null ) {
113113 wfSuppressWarnings();
114 - $log = svn_log( $this->repoPath . $path,
 114+ $log = svn_log( $this->mRepoPath . $path,
115115 $this->_rev( $startRev, SVN_REVISION_INITIAL ),
116116 $this->_rev( $endRev, SVN_REVISION_HEAD ) );
117117 wfRestoreWarnings();
@@ -127,7 +127,7 @@
128128 $command = sprintf(
129129 "svn info %s %s",
130130 $this->getExtraArgs(),
131 - wfEscapeShellArg( $this->repoPath ) );
 131+ wfEscapeShellArg( $this->mRepoPath ) );
132132
133133 $result = wfShellExec( $command );
134134 if ( $result == "" ) {
@@ -146,7 +146,7 @@
147147 $command = sprintf(
148148 "svn cat %s %s",
149149 $this->getExtraArgs(),
150 - wfEscapeShellArg( $this->repoPath . $path ) );
 150+ wfEscapeShellArg( $this->mRepoPath . $path ) );
151151
152152 return wfShellExec( $command );
153153 }
@@ -157,7 +157,7 @@
158158 intval( $rev1 ),
159159 intval( $rev2 ),
160160 $this->getExtraArgs(),
161 - wfEscapeShellArg( $this->repoPath . $path ) );
 161+ wfEscapeShellArg( $this->mRepoPath . $path ) );
162162
163163 return wfShellExec( $command );
164164 }
@@ -169,7 +169,7 @@
170170 wfEscapeShellArg( $this->_rev( $startRev, 'BASE' ) ),
171171 wfEscapeShellArg( $this->_rev( $endRev, 'HEAD' ) ),
172172 $this->getExtraArgs(),
173 - wfEscapeShellArg( $this->repoPath . $path ) );
 173+ wfEscapeShellArg( $this->mRepoPath . $path ) );
174174
175175 $lines = explode( "\n", wfShellExec( $command ) );
176176 $out = array();
@@ -265,7 +265,7 @@
266266 "svn list --xml -r%s %s %s",
267267 wfEscapeShellArg( $this->_rev( $rev, 'HEAD' ) ),
268268 $this->getExtraArgs(),
269 - wfEscapeShellArg( $this->repoPath . $path ) );
 269+ wfEscapeShellArg( $this->mRepoPath . $path ) );
270270 $document = new DOMDocument();
271271
272272 if ( !@$document->loadXML( wfShellExec( $command ) ) )
@@ -326,8 +326,8 @@
327327 class SubversionProxy extends SubversionAdaptor {
328328 function __construct( $repo, $proxy, $timeout = 30 ) {
329329 parent::__construct( $repo );
330 - $this->proxy = $proxy;
331 - $this->timeout = $timeout;
 330+ $this->mProxy = $proxy;
 331+ $this->mTimeout = $timeout;
332332 }
333333
334334 function canConnect() {
@@ -342,7 +342,7 @@
343343 function getDiff( $path, $rev1, $rev2 ) {
344344 return $this->_proxy( array(
345345 'action' => 'diff',
346 - 'base' => $this->repoPath,
 346+ 'base' => $this->mRepoPath,
347347 'path' => $path,
348348 'rev1' => $rev1,
349349 'rev2' => $rev2 ) );
@@ -351,7 +351,7 @@
352352 function getLog( $path, $startRev = null, $endRev = null ) {
353353 return $this->_proxy( array(
354354 'action' => 'log',
355 - 'base' => $this->repoPath,
 355+ 'base' => $this->mRepoPath,
356356 'path' => $path,
357357 'start' => $startRev,
358358 'end' => $endRev ) );
@@ -360,7 +360,7 @@
361361 function getDirList( $path, $rev = null ) {
362362 return $this->_proxy( array(
363363 'action' => 'list',
364 - 'base' => $this->repoPath,
 364+ 'base' => $this->mRepoPath,
365365 'path' => $path,
366366 'rev' => $rev ) );
367367 }
@@ -372,8 +372,8 @@
373373 unset( $params[$key] );
374374 }
375375 }
376 - $target = $this->proxy . '?' . wfArrayToCgi( $params );
377 - $blob = Http::get( $target, $this->timeout );
 376+ $target = $this->mProxy . '?' . wfArrayToCgi( $params );
 377+ $blob = Http::get( $target, $this->mTimeout );
378378 if ( $blob === false ) {
379379 throw new MWException( "SVN proxy error" );
380380 }
Index: trunk/extensions/CodeReview/ui/CodeRepoStatsView.php
@@ -5,14 +5,14 @@
66
77 function __construct( $repoName ) {
88 parent::__construct();
9 - $this->repo = CodeRepository::newFromName( $repoName );
 9+ $this->mRepo = CodeRepository::newFromName( $repoName );
1010 }
1111
1212 function execute() {
1313 global $wgOut, $wgLang;
1414
15 - $stats = RepoStats::newFromRepo( $this->repo );
16 - $repoName = $this->repo->getName();
 15+ $stats = RepoStats::newFromRepo( $this->mRepo );
 16+ $repoName = $this->mRepo->getName();
1717 $wgOut->wrapWikiMsg( '<h2 id="stats-main">$1</h2>', array( 'code-stats-header', $repoName ) );
1818 $wgOut->addWikiMsg( 'code-stats-main',
1919 $wgLang->timeanddate( $stats->time, true ),
Index: trunk/extensions/CodeReview/ui/SpecialCode.php
@@ -129,7 +129,7 @@
130130
131131 // If a repository was specified, but it does not exist, redirect to the
132132 // repository list with an appropriate message.
133 - if ( !$view->repo ) {
 133+ if ( !$view->mRepo ) {
134134 $view = new CodeRepoListView();
135135 global $wgOut;
136136 $wgOut->addWikiMsg( 'code-repo-not-found', wfEscapeWikiText( $params[0] ) );
Index: trunk/extensions/CodeReview/ui/CodeStatusChangeListView.php
@@ -2,11 +2,11 @@
33
44 // Special:Code/MediaWiki
55 class CodeStatusChangeListView extends CodeView {
6 - public $repo;
 6+ public $mRepo;
77
88 function __construct( $repoName ) {
99 parent::__construct();
10 - $this->repo = CodeRepository::newFromName( $repoName );
 10+ $this->mRepo = CodeRepository::newFromName( $repoName );
1111 }
1212
1313 function execute() {
@@ -27,7 +27,7 @@
2828 }
2929
3030 function getRepo() {
31 - return $this->repo;
 31+ return $this->mRepo;
3232 }
3333 }
3434
@@ -44,7 +44,7 @@
4545 return array(
4646 'tables' => array( 'code_prop_changes', 'code_rev' ),
4747 'fields' => array_keys( $this->getFieldNames() ),
48 - 'conds' => array( 'cpc_repo_id' => $this->repo->getId(), 'cpc_attrib' => 'status' ),
 48+ 'conds' => array( 'cpc_repo_id' => $this->mRepo->getId(), 'cpc_attrib' => 'status' ),
4949 'join_conds' => array(
5050 'code_rev' => array( 'LEFT JOIN', 'cpc_repo_id = cr_repo_id AND cpc_rev_id = cr_id' )
5151 )
@@ -67,20 +67,20 @@
6868 function formatValue( $name, $value ) {
6969 switch( $name ) {
7070 case 'cpc_rev_id':
71 - return $this->view->skin->link(
72 - SpecialPage::getTitleFor( 'Code', $this->repo->getName() . '/' . $value . '#code-changes' ),
 71+ return $this->mView->skin->link(
 72+ SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() . '/' . $value . '#code-changes' ),
7373 htmlspecialchars( $value ) );
7474 case 'cr_author':
75 - return $this->view->authorLink( $value );
 75+ return $this->mView->authorLink( $value );
7676 case 'cr_message':
77 - return $this->view->messageFragment( $value );
 77+ return $this->mView->messageFragment( $value );
7878 case 'cr_status':
79 - return $this->view->skin->link(
 79+ return $this->mView->skin->link(
8080 SpecialPage::getTitleFor( 'Code',
81 - $this->repo->getName() . '/status/' . $value ),
82 - htmlspecialchars( $this->view->statusDesc( $value ) ) );
 81+ $this->mRepo->getName() . '/status/' . $value ),
 82+ htmlspecialchars( $this->mView->statusDesc( $value ) ) );
8383 case 'cpc_user_text':
84 - return $this->view->skin->userLink( - 1, $value );
 84+ return $this->mView->skin->userLink( - 1, $value );
8585 case 'cpc_removed':
8686 return wfMsgHtml( $value ? "code-status-$value" : "code-status-new" );
8787 case 'cpc_added':
@@ -92,6 +92,6 @@
9393 }
9494
9595 function getTitle() {
96 - return SpecialPage::getTitleFor( 'Code', $this->repo->getName() . '/statuschanges' );
 96+ return SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() . '/statuschanges' );
9797 }
9898 }
Index: trunk/extensions/CodeReview/ui/CodeRevisionCommitter.php
@@ -9,13 +9,13 @@
1010 parent::execute();
1111 return;
1212 }
13 - if ( !$this->rev ) {
 13+ if ( !$this->mRev ) {
1414 parent::execute();
1515 return;
1616 }
1717
18 - $commentId = $this->revisionUpdate( $this->status, $this->addTags, $this->removeTags,
19 - $this->signoffFlags, $this->strikeSignoffs, $this->addReference, $this->removeReferences,
 18+ $commentId = $this->revisionUpdate( $this->mStatus, $this->mAddTags, $this->mRemoveTags,
 19+ $this->mSignoffFlags, $this->mStrikeSignoffs, $this->mAddReference, $this->mRemoveReferences,
2020 $this->text, $wgRequest->getIntOrNull( 'wpParent' ),
2121 $wgRequest->getInt( 'wpReview' )
2222 );
@@ -31,18 +31,18 @@
3232 if ( !$redirTarget ) {
3333 // Was "next & unresolved" clicked?
3434 if ( $this->jumpToNext ) {
35 - $next = $this->rev->getNextUnresolved( $this->path );
 35+ $next = $this->mRev->getNextUnresolved( $this->mPath );
3636 if ( $next ) {
37 - $redirTarget = SpecialPage::getTitleFor( 'Code', $this->repo->getName() . '/' . $next );
 37+ $redirTarget = SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() . '/' . $next );
3838 } else {
39 - $redirTarget = SpecialPage::getTitleFor( 'Code', $this->repo->getName() );
 39+ $redirTarget = SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() );
4040 }
4141 } else {
4242 # $redirTarget already set for comments
4343 $redirTarget = $this->revLink();
4444 }
4545 }
46 - $wgOut->redirect( $redirTarget->getFullUrl( array( 'path' => $this->path ) ) );
 46+ $wgOut->redirect( $redirTarget->getFullUrl( array( 'path' => $this->mPath ) ) );
4747 }
4848
4949 /**
@@ -63,7 +63,7 @@
6464 public function revisionUpdate( $status, $addTags, $removeTags, $addSignoffs, $strikeSignoffs,
6565 $addReferences, $removeReferences, $commentText,
6666 $parent = null, $review = 0 ) {
67 - if ( !$this->rev ) {
 67+ if ( !$this->mRev ) {
6868 return false;
6969 }
7070
@@ -74,8 +74,8 @@
7575 $dbw->begin();
7676 // Change the status if allowed
7777 $statusChanged = false;
78 - if ( $this->rev->isValidStatus( $status ) && $this->validPost( 'codereview-set-status' ) ) {
79 - $statusChanged = $this->rev->setStatus( $status, $wgUser );
 78+ if ( $this->mRev->isValidStatus( $status ) && $this->validPost( 'codereview-set-status' ) ) {
 79+ $statusChanged = $this->mRev->setStatus( $status, $wgUser );
8080 }
8181 $validAddTags = $validRemoveTags = array();
8282 if ( count( $addTags ) && $this->validPost( 'codereview-add-tag' ) ) {
@@ -86,23 +86,23 @@
8787 }
8888 // If allowed to change any tags, then do so
8989 if ( count( $validAddTags ) || count( $validRemoveTags ) ) {
90 - $this->rev->changeTags( $validAddTags, $validRemoveTags, $wgUser );
 90+ $this->mRev->changeTags( $validAddTags, $validRemoveTags, $wgUser );
9191 }
9292 // Add any signoffs
9393 if ( count( $addSignoffs ) && $this->validPost( 'codereview-signoff' ) ) {
94 - $this->rev->addSignoff( $wgUser, $addSignoffs );
 94+ $this->mRev->addSignoff( $wgUser, $addSignoffs );
9595 }
9696 // Strike any signoffs
9797 if ( count( $strikeSignoffs ) && $this->validPost( 'codereview-signoff' ) ) {
98 - $this->rev->strikeSignoffs( $wgUser, $strikeSignoffs );
 98+ $this->mRev->strikeSignoffs( $wgUser, $strikeSignoffs );
9999 }
100100 // Add reference if requested
101101 if ( count( $addReferences ) && $this->validPost( 'codereview-associate' ) ) {
102 - $this->rev->addReferencesFrom( $addReferences );
 102+ $this->mRev->addReferencesFrom( $addReferences );
103103 }
104104 // Remove references if requested
105105 if ( count( $removeReferences ) && $this->validPost( 'codereview-associate' ) ) {
106 - $this->rev->removeReferencesFrom( $removeReferences );
 106+ $this->mRev->removeReferencesFrom( $removeReferences );
107107 }
108108
109109 // Add any comments
@@ -110,7 +110,7 @@
111111 $commentId = 0;
112112 if ( strlen( $commentText ) && $this->validPost( 'codereview-post-comment' ) ) {
113113 // $isPreview = $wgRequest->getCheck( 'wpPreview' );
114 - $commentId = $this->rev->saveComment( $commentText, $review, $parent );
 114+ $commentId = $this->mRev->saveComment( $commentText, $review, $parent );
115115
116116 $commentAdded = ($commentId !== 0);
117117 }
@@ -118,19 +118,19 @@
119119
120120 if ( $statusChanged || $commentAdded ) {
121121 if ( $statusChanged && $commentAdded ) {
122 - $url = $this->rev->getFullUrl( $commentId );
123 - $this->rev->emailNotifyUsersOfChanges( 'codereview-email-subj4', 'codereview-email-body4',
124 - $wgUser->getName(), $this->rev->getIdStringUnique(), $this->rev->getOldStatus(), $this->rev->getStatus(),
 122+ $url = $this->mRev->getFullUrl( $commentId );
 123+ $this->mRev->emailNotifyUsersOfChanges( 'codereview-email-subj4', 'codereview-email-body4',
 124+ $wgUser->getName(), $this->mRev->getIdStringUnique(), $this->mRev->getOldStatus(), $this->mRev->getStatus(),
125125 $url, $this->text
126126 );
127127 } else if ( $statusChanged ) {
128 - $this->rev->emailNotifyUsersOfChanges( 'codereview-email-subj3', 'codereview-email-body3',
129 - $wgUser->getName(), $this->rev->getIdStringUnique(), $this->rev->getOldStatus(), $this->rev->getStatus()
 128+ $this->mRev->emailNotifyUsersOfChanges( 'codereview-email-subj3', 'codereview-email-body3',
 129+ $wgUser->getName(), $this->mRev->getIdStringUnique(), $this->mRev->getOldStatus(), $this->mRev->getStatus()
130130 );
131131 } else if ( $commentAdded ) {
132 - $url = $this->rev->getFullUrl( $commentId );
133 - $this->rev->emailNotifyUsersOfChanges( 'codereview-email-subj', 'codereview-email-body',
134 - $wgUser->getName(), $url, $this->rev->getIdStringUnique(), $this->text
 132+ $url = $this->mRev->getFullUrl( $commentId );
 133+ $this->mRev->emailNotifyUsersOfChanges( 'codereview-email-subj', 'codereview-email-body',
 134+ $wgUser->getName(), $url, $this->mRev->getIdStringUnique(), $this->text
135135 );
136136 }
137137 }
Index: trunk/extensions/CodeReview/ui/CodeRevisionTagView.php
@@ -3,18 +3,18 @@
44 class CodeRevisionTagView extends CodeRevisionListView {
55 function __construct( $repoName, $tag ) {
66 parent::__construct( $repoName );
7 - $this->tag = $tag;
 7+ $this->mTag = $tag;
88 }
99
1010 function getPager() {
11 - return new SvnRevTagTablePager( $this, $this->tag );
 11+ return new SvnRevTagTablePager( $this, $this->mTag );
1212 }
1313 }
1414
1515 class SvnRevTagTablePager extends SvnRevTablePager {
1616 function __construct( $view, $tag ) {
1717 parent::__construct( $view );
18 - $this->tag = $tag;
 18+ $this->mTag = $tag;
1919 }
2020
2121 function getDefaultSort() {
@@ -28,12 +28,12 @@
2929 array_unshift( $info['tables'], 'code_tags' );
3030 $info['conds'][] = 'cr_repo_id=ct_repo_id';
3131 $info['conds'][] = 'cr_id=ct_rev_id';
32 - $info['conds']['ct_tag'] = $this->tag; // fixme: normalize input?
 32+ $info['conds']['ct_tag'] = $this->mTag; // fixme: normalize input?
3333 return $info;
3434 }
3535
3636 function getTitle() {
37 - $repo = $this->repo->getName();
38 - return SpecialPage::getTitleFor( 'Code', "$repo/tag/$this->tag" );
 37+ $repo = $this->mRepo->getName();
 38+ return SpecialPage::getTitleFor( 'Code', "$repo/tag/$this->mTag" );
3939 }
4040 }
Index: trunk/extensions/CodeReview/ui/CodeRevisionListView.php
@@ -5,30 +5,29 @@
66 /**
77 * @var CodeRepository
88 */
9 - public $repo;
 9+ public $mRepo;
 10+ public $mPath, $batchForm;
1011
11 - public $path, $batchForm;
12 -
1312 /**
1413 * @param $repo CodeRepository|String
1514 */
1615 function __construct( $repo ) {
1716 global $wgRequest;
1817 parent::__construct();
19 - $this->repo = ( $repo instanceof CodeRepository )
 18+ $this->mRepo = ( $repo instanceof CodeRepository )
2019 ? $repo
2120 : CodeRepository::newFromName( $repo );
22 - $this->path = htmlspecialchars( trim( $wgRequest->getVal( 'path' ) ) );
23 - if ( strlen( $this->path ) && $this->path[0] !== '/' ) {
24 - $this->path = "/{$this->path}"; // make sure this is a valid path
 21+ $this->mPath = htmlspecialchars( trim( $wgRequest->getVal( 'path' ) ) );
 22+ if ( strlen( $this->mPath ) && $this->mPath[0] !== '/' ) {
 23+ $this->mPath = "/{$this->mPath}"; // make sure this is a valid path
2524 }
26 - $this->author = $wgRequest->getText( 'author' );
27 - $this->appliedFilter = null;
 25+ $this->mAuthor = $wgRequest->getText( 'author' );
 26+ $this->mAppliedFilter = null;
2827 }
2928
3029 function execute() {
3130 global $wgOut, $wgUser, $wgRequest, $wgLang;
32 - if ( !$this->repo ) {
 31+ if ( !$this->mRepo ) {
3332 $view = new CodeRepoListView();
3433 $view->execute();
3534 return;
@@ -89,9 +88,9 @@
9089 // Grab data from the DB
9190 $dbr = wfGetDB( DB_SLAVE );
9291 $revObjects = array();
93 - $res = $dbr->select( 'code_rev', '*', array( 'cr_id' => $revisions, 'cr_repo_id' => $this->repo->getId() ), __METHOD__ );
 92+ $res = $dbr->select( 'code_rev', '*', array( 'cr_id' => $revisions, 'cr_repo_id' => $this->mRepo->getId() ), __METHOD__ );
9493 foreach ( $res as $row ) {
95 - $revObjects[] = CodeRevision::newFromRow( $this->repo, $row );
 94+ $revObjects[] = CodeRevision::newFromRow( $this->mRepo, $row );
9695 }
9796
9897 if ( $wgUser->isAllowed( 'codereview-add-tag' ) &&
@@ -160,26 +159,26 @@
161160 */
162161 function showForm() {
163162 global $wgScript;
164 - if ( $this->author ) {
165 - $special = SpecialPage::getTitleFor( 'Code', $this->repo->getName() . '/author/' . $this->author );
 163+ if ( $this->mAuthor ) {
 164+ $special = SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() . '/author/' . $this->mAuthor );
166165 } else {
167 - $special = SpecialPage::getTitleFor( 'Code', $this->repo->getName() . '/path' );
 166+ $special = SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() . '/path' );
168167 }
169168
170169 $ret = Xml::openElement( 'form', array( 'action' => $wgScript, 'method' => 'get' ) ) .
171170 "<fieldset><legend>" . wfMsgHtml( 'code-pathsearch-legend' ) . "</legend>" .
172171 '<table width="100%"><tr><td>' .
173 - Xml::inputlabel( wfMsg( "code-pathsearch-path" ), 'path', 'path', 55, $this->path ) .
 172+ Xml::inputlabel( wfMsg( "code-pathsearch-path" ), 'path', 'path', 55, $this->mPath ) .
174173 '&#160;' . Xml::submitButton( wfMsg( 'allpagessubmit' ) ) .
175174 '</td>';
176175
177 - if ( strlen( $this->appliedFilter ) ) {
 176+ if ( strlen( $this->mAppliedFilter ) ) {
178177 $ret .= '<td>' .
179178 Xml::label( wfMsg( 'code-pathsearch-filter' ), 'revFilter' ) . '&#160;<strong>' .
180 - Xml::span( $this->appliedFilter, '' ) . '</strong>&#160;' .
 179+ Xml::span( $this->mAppliedFilter, '' ) . '</strong>&#160;' .
181180 Xml::submitButton( wfMsg( 'code-revfilter-clear' ) ) .
182181 '</td>' .
183 - Html::hidden( 'title', SpecialPage::getTitleFor( 'Code', $this->repo->getName() ) );
 182+ Html::hidden( 'title', SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() ) );
184183 } else {
185184 $ret .= Html::hidden( 'title', $special->getPrefixedDBKey() ) ;
186185 }
@@ -219,7 +218,7 @@
220219 }
221220
222221 function getRepo() {
223 - return $this->repo;
 222+ return $this->mRepo;
224223 }
225224 }
226225
@@ -227,11 +226,11 @@
228227 class SvnRevTablePager extends SvnTablePager {
229228
230229 function getSVNPath() {
231 - return $this->view->path;
 230+ return $this->mView->mPath;
232231 }
233232
234233 function getDefaultSort() {
235 - return strlen( $this->view->path ) ? 'cp_rev_id' : 'cr_id';
 234+ return strlen( $this->mView->mPath ) ? 'cp_rev_id' : 'cr_id';
236235 }
237236
238237 function getQueryInfo() {
@@ -242,7 +241,7 @@
243242 'tables' => array( 'code_paths', 'code_rev', 'code_comment' ),
244243 'fields' => $this->getSelectFields(),
245244 'conds' => array(
246 - 'cp_repo_id' => $this->repo->getId(),
 245+ 'cp_repo_id' => $this->mRepo->getId(),
247246 'cp_path' => $this->getSVNPath(),
248247 ),
249248 'options' => array( 'GROUP BY' => $defaultSort, 'USE INDEX' => array( 'code_path' => 'cp_repo_id' ) ),
@@ -256,15 +255,15 @@
257256 $query = array(
258257 'tables' => array( 'code_rev', 'code_comment' ),
259258 'fields' => $this->getSelectFields(),
260 - 'conds' => array( 'cr_repo_id' => $this->repo->getId() ),
 259+ 'conds' => array( 'cr_repo_id' => $this->mRepo->getId() ),
261260 'options' => array( 'GROUP BY' => $defaultSort ),
262261 'join_conds' => array(
263262 'code_comment' => array( 'LEFT JOIN', 'cc_repo_id = cr_repo_id AND cc_rev_id = cr_id' ),
264263 )
265264 );
266265 }
267 - if( $this->view->author ) {
268 - $query['conds']['cr_author'] = $this->view->author;
 266+ if( $this->mView->mAuthor ) {
 267+ $query['conds']['cr_author'] = $this->mView->mAuthor;
269268 }
270269 return $query;
271270 }
@@ -302,7 +301,7 @@
303302 'cr_timestamp' => wfMsg( 'code-field-timestamp' ),
304303 );
305304 # Only show checkboxen as needed
306 - if ( $this->view->batchForm ) {
 305+ if ( $this->mView->batchForm ) {
307306 $fields = array( 'selectforchange' => wfMsg( 'code-field-select' ) ) + $fields;
308307 }
309308 return $fields;
@@ -312,7 +311,7 @@
313312
314313 function formatRevValue( $name, $value, $row ) {
315314 global $wgLang;
316 - $pathQuery = ( strlen( $this->view->path ) ) ? array( 'path' => $this->view->path ) : array();
 315+ $pathQuery = ( strlen( $this->mView->mPath ) ) ? array( 'path' => $this->mView->mPath ) : array();
317316
318317 switch( $name ) {
319318 case 'selectforchange':
@@ -320,37 +319,37 @@
321320 return Xml::check( "wpRevisionSelected[]", false, array( 'value' => $row->$sort ) );
322321 case 'cp_rev_id':
323322 case 'cr_id':
324 - return $this->view->skin->link(
325 - SpecialPage::getTitleFor( 'Code', $this->repo->getName() . '/' . $value ),
 323+ return $this->mView->skin->link(
 324+ SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() . '/' . $value ),
326325 htmlspecialchars( $value ),
327326 array(),
328327 $pathQuery
329328 );
330329 case 'cr_status':
331 - return $this->view->skin->link(
332 - SpecialPage::getTitleFor( 'Code', $this->repo->getName() . '/status/' . $value ),
333 - htmlspecialchars( $this->view->statusDesc( $value ) ),
 330+ return $this->mView->skin->link(
 331+ SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() . '/status/' . $value ),
 332+ htmlspecialchars( $this->mView->statusDesc( $value ) ),
334333 array(),
335334 $pathQuery
336335 );
337336 case 'cr_author':
338 - return $this->view->authorLink( $value, $pathQuery );
 337+ return $this->mView->authorLink( $value, $pathQuery );
339338 case 'cr_message':
340 - return $this->view->messageFragment( $value );
 339+ return $this->mView->messageFragment( $value );
341340 case 'cr_timestamp':
342341 return $wgLang->timeanddate( $value, true );
343342 case 'comments':
344343 if ( $value ) {
345 - $special = SpecialPage::getTitleFor( 'Code', $this->repo->getName() . '/' . $row-> { $this->getDefaultSort() } );
 344+ $special = SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() . '/' . $row-> { $this->getDefaultSort() } );
346345 $special->setFragment( '#code-comments' );
347 - return $this->view->skin->link( $special, htmlspecialchars( $value ) );
 346+ return $this->mView->skin->link( $special, htmlspecialchars( $value ) );
348347 } else {
349348 return '-';
350349 }
351350 case 'cr_path':
352351 return Xml::openElement( 'div', array( 'title' => (string)$value ) ) .
353 - $this->view->skin->link(
354 - SpecialPage::getTitleFor( 'Code', $this->repo->getName() . '/path' ),
 352+ $this->mView->skin->link(
 353+ SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() . '/path' ),
355354 $wgLang->truncate( (string)$value, 50 ),
356355 array( 'title' => (string)$value ),
357356 array( 'path' => (string)$value ) ) . "</div>";
@@ -358,6 +357,6 @@
359358 }
360359
361360 function getTitle() {
362 - return SpecialPage::getTitleFor( 'Code', $this->repo->getName() );
 361+ return SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() );
363362 }
364363 }
Index: trunk/extensions/CodeReview/ui/CodeAuthorListView.php
@@ -4,15 +4,15 @@
55 class CodeAuthorListView extends CodeView {
66 function __construct( $repoName ) {
77 parent::__construct();
8 - $this->repo = CodeRepository::newFromName( $repoName );
 8+ $this->mRepo = CodeRepository::newFromName( $repoName );
99 }
1010
1111 function execute() {
1212 global $wgOut, $wgLang;
13 - $authors = $this->repo->getAuthorList();
14 - $repo = $this->repo->getName();
 13+ $authors = $this->mRepo->getAuthorList();
 14+ $repo = $this->mRepo->getName();
1515 $text = wfMsg( 'code-authors-text' ) . "\n\n";
16 - $text .= '<strong>' . wfMsg( 'code-author-total', $wgLang->formatNum( $this->repo->getAuthorCount() ) ) . "</strong>\n";
 16+ $text .= '<strong>' . wfMsg( 'code-author-total', $wgLang->formatNum( $this->mRepo->getAuthorCount() ) ) . "</strong>\n";
1717
1818 $wgOut->addWikiText( $text );
1919
@@ -25,7 +25,7 @@
2626 $wgOut->addHTML( "<tr><td>" );
2727 $author = $committer["author"];
2828 $text = "[[Special:Code/$repo/author/$author|$author]]";
29 - $user = $this->repo->authorWikiUser( $author );
 29+ $user = $this->mRepo->authorWikiUser( $author );
3030 if ( $user ) {
3131 $title = htmlspecialchars( $user->getUserPage()->getPrefixedText() );
3232 $name = htmlspecialchars( $user->getName() );
Index: trunk/extensions/CodeReview/ui/CodeReleaseNotes.php
@@ -4,18 +4,18 @@
55 function __construct( $repoName ) {
66 global $wgRequest, $IP;
77 parent::__construct( $repoName );
8 - $this->repo = CodeRepository::newFromName( $repoName );
9 - $this->path = htmlspecialchars( trim( $wgRequest->getVal( 'path' ) ) );
10 - if ( strlen( $this->path ) && $this->path[0] !== '/' ) {
11 - $this->path = "/{$this->path}"; // make sure this is a valid path
 8+ $this->mRepo = CodeRepository::newFromName( $repoName );
 9+ $this->mPath = htmlspecialchars( trim( $wgRequest->getVal( 'path' ) ) );
 10+ if ( strlen( $this->mPath ) && $this->mPath[0] !== '/' ) {
 11+ $this->mPath = "/{$this->mPath}"; // make sure this is a valid path
1212 }
13 - $this->path = preg_replace( '/\/$/', '', $this->path ); // kill last slash
14 - $this->startRev = $wgRequest->getIntOrNull( 'startrev' );
15 - $this->endRev = $wgRequest->getIntOrNull( 'endrev' );
 13+ $this->mPath = preg_replace( '/\/$/', '', $this->mPath ); // kill last slash
 14+ $this->mStartRev = $wgRequest->getIntOrNull( 'startrev' );
 15+ $this->mEndRev = $wgRequest->getIntOrNull( 'endrev' );
1616 }
1717
1818 function execute() {
19 - if ( !$this->repo ) {
 19+ if ( !$this->mRepo ) {
2020 $view = new CodeRepoListView();
2121 $view->execute();
2222 return;
@@ -23,23 +23,23 @@
2424 $this->showForm();
2525
2626 # Show notes if we have at least a starting revision
27 - if ( $this->startRev ) {
 27+ if ( $this->mStartRev ) {
2828 $this->showReleaseNotes();
2929 }
3030 }
3131
3232 protected function showForm() {
3333 global $wgOut, $wgScript;
34 - $special = SpecialPage::getTitleFor( 'Code', $this->repo->getName() . '/releasenotes' );
 34+ $special = SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() . '/releasenotes' );
3535 $wgOut->addHTML(
3636 Xml::openElement( 'form', array( 'action' => $wgScript, 'method' => 'get' ) ) .
3737 "<fieldset><legend>" . wfMsgHtml( 'code-release-legend' ) . "</legend>" .
3838 Html::hidden( 'title', $special->getPrefixedDBKey() ) . '<b>' .
39 - Xml::inputlabel( wfMsg( "code-release-startrev" ), 'startrev', 'startrev', 10, $this->startRev ) .
 39+ Xml::inputlabel( wfMsg( "code-release-startrev" ), 'startrev', 'startrev', 10, $this->mStartRev ) .
4040 '</b>&#160;' .
41 - Xml::inputlabel( wfMsg( "code-release-endrev" ), 'endrev', 'endrev', 10, $this->endRev ) .
 41+ Xml::inputlabel( wfMsg( "code-release-endrev" ), 'endrev', 'endrev', 10, $this->mEndRev ) .
4242 '&#160;' .
43 - Xml::inputlabel( wfMsg( "code-pathsearch-path" ), 'path', 'path', 45, $this->path ) .
 43+ Xml::inputlabel( wfMsg( "code-pathsearch-path" ), 'path', 'path', 45, $this->mPath ) .
4444 '&#160;' .
4545 Xml::submitButton( wfMsg( 'allpagessubmit' ) ) . "\n" .
4646 "</fieldset>" . Xml::closeElement( 'form' )
@@ -48,22 +48,22 @@
4949
5050 protected function showReleaseNotes() {
5151 global $wgOut;
52 - $linker = new CodeCommentLinkerHtml( $this->repo );
 52+ $linker = new CodeCommentLinkerHtml( $this->mRepo );
5353 $dbr = wfGetDB( DB_SLAVE );
5454 $where = array();
55 - if ( $this->endRev ) {
56 - $where[] = 'cr_id BETWEEN ' . intval( $this->startRev ) . ' AND ' . intval( $this->endRev );
 55+ if ( $this->mEndRev ) {
 56+ $where[] = 'cr_id BETWEEN ' . intval( $this->mStartRev ) . ' AND ' . intval( $this->mEndRev );
5757 } else {
58 - $where[] = 'cr_id >= ' . intval( $this->startRev );
 58+ $where[] = 'cr_id >= ' . intval( $this->mStartRev );
5959 }
60 - if ( $this->path ) {
61 - $where['cr_path'] = $this->path;
 60+ if ( $this->mPath ) {
 61+ $where['cr_path'] = $this->mPath;
6262 }
6363 # Select commits within this range...
6464 $res = $dbr->select( array( 'code_rev', 'code_tags' ),
6565 array( 'cr_message', 'cr_author', 'cr_id', 'ct_tag AS rnotes' ),
6666 array_merge( array(
67 - 'cr_repo_id' => $this->repo->getId(), // this repo
 67+ 'cr_repo_id' => $this->mRepo->getId(), // this repo
6868 "cr_status NOT IN('reverted','deferred','fixme')", // not reverted/deferred/fixme
6969 "cr_message != ''",
7070 ), $where ),
Index: trunk/extensions/CodeReview/ui/CodeRevisionView.php
@@ -12,67 +12,67 @@
1313 function __construct( $repo, $rev, $replyTarget = null ) {
1414 global $wgRequest;
1515 parent::__construct();
16 - $this->repo = ( $repo instanceof CodeRepository )
 16+ $this->mRepo = ( $repo instanceof CodeRepository )
1717 ? $repo
1818 : CodeRepository::newFromName( $repo );
1919
2020 if ( $rev instanceof CodeRevision ) {
21 - $this->revId = $rev->getId();
22 - $this->rev = $rev;
 21+ $this->mRevId = $rev->getId();
 22+ $this->mRev = $rev;
2323 } else {
24 - $this->revId = intval( ltrim( $rev, 'r' ) );
25 - $this->rev = $this->repo
26 - ? $this->repo->getRevision( $this->revId )
 24+ $this->mRevId = intval( ltrim( $rev, 'r' ) );
 25+ $this->mRev = $this->mRepo
 26+ ? $this->mRepo->getRevision( $this->mRevId )
2727 : null;
2828 }
2929
30 - $this->previewText = false;
 30+ $this->mPreviewText = false;
3131 # Search path for navigation links
32 - $this->path = htmlspecialchars( trim( $wgRequest->getVal( 'path' ) ) );
33 - if ( strlen( $this->path ) && $this->path[0] !== '/' ) {
34 - $this->path = "/{$this->path}"; // make sure this is a valid path
 32+ $this->mPath = htmlspecialchars( trim( $wgRequest->getVal( 'path' ) ) );
 33+ if ( strlen( $this->mPath ) && $this->mPath[0] !== '/' ) {
 34+ $this->mPath = "/{$this->mPath}"; // make sure this is a valid path
3535 }
3636 # URL params...
37 - $this->addTags = $wgRequest->getText( 'wpTag' );
38 - $this->removeTags = $wgRequest->getText( 'wpRemoveTag' );
39 - $this->status = $wgRequest->getText( 'wpStatus' );
 37+ $this->mAddTags = $wgRequest->getText( 'wpTag' );
 38+ $this->mRemoveTags = $wgRequest->getText( 'wpRemoveTag' );
 39+ $this->mStatus = $wgRequest->getText( 'wpStatus' );
4040 $this->jumpToNext = $wgRequest->getCheck( 'wpSaveAndNext' );
41 - $this->replyTarget = $replyTarget ?
 41+ $this->mReplyTarget = $replyTarget ?
4242 (int)$replyTarget : $wgRequest->getIntOrNull( 'wpParent' );
43 - $this->text = $wgRequest->getText( "wpReply{$this->replyTarget}" );
44 - $this->skipCache = ( $wgRequest->getVal( 'action' ) == 'purge' );
 43+ $this->text = $wgRequest->getText( "wpReply{$this->mReplyTarget}" );
 44+ $this->mSkipCache = ( $wgRequest->getVal( 'action' ) == 'purge' );
4545 # Make tag arrays
46 - $this->addTags = $this->splitTags( $this->addTags );
47 - $this->removeTags = $this->splitTags( $this->removeTags );
48 - $this->signoffFlags = $wgRequest->getCheck( 'wpSignoff' ) ?
 46+ $this->mAddTags = $this->splitTags( $this->mAddTags );
 47+ $this->mRemoveTags = $this->splitTags( $this->mRemoveTags );
 48+ $this->mSignoffFlags = $wgRequest->getCheck( 'wpSignoff' ) ?
4949 $wgRequest->getArray( 'wpSignoffFlags' ) : array();
50 - $this->selectedSignoffs = $wgRequest->getArray( 'wpSignoffs' );
51 - $this->strikeSignoffs = $wgRequest->getCheck( 'wpStrikeSignoffs' ) ?
52 - $this->selectedSignoffs : array();
53 - $this->addReference = $wgRequest->getCheck( 'wpAddReferenceSubmit' ) ?
 50+ $this->mSelectedSignoffs = $wgRequest->getArray( 'wpSignoffs' );
 51+ $this->mStrikeSignoffs = $wgRequest->getCheck( 'wpStrikeSignoffs' ) ?
 52+ $this->mSelectedSignoffs : array();
 53+ $this->mAddReference = $wgRequest->getCheck( 'wpAddReferenceSubmit' ) ?
5454 $wgRequest->getIntArray( 'wpAddReference', array() ) : array();
55 - $this->removeReferences = $wgRequest->getCheck( 'wpRemoveReferences' ) ?
 55+ $this->mRemoveReferences = $wgRequest->getCheck( 'wpRemoveReferences' ) ?
5656 $wgRequest->getIntArray( 'wpReferences', array() ) : array();
5757 }
5858
5959 function execute() {
6060 global $wgOut, $wgLang;
61 - if ( !$this->repo ) {
 61+ if ( !$this->mRepo ) {
6262 $view = new CodeRepoListView();
6363 $view->execute();
6464 return;
6565 }
66 - if ( !$this->rev ) {
67 - if ( $this->revId !== 0 ) {
68 - $wgOut->addWikiMsg( 'code-rev-not-found', $this->revId );
 66+ if ( !$this->mRev ) {
 67+ if ( $this->mRevId !== 0 ) {
 68+ $wgOut->addWikiMsg( 'code-rev-not-found', $this->mRevId );
6969 }
7070
71 - $view = new CodeRevisionListView( $this->repo->getName() );
 71+ $view = new CodeRevisionListView( $this->mRepo->getName() );
7272 $view->execute();
7373 return;
7474 }
75 - if ( $this->status == '' ) {
76 - $this->status = $this->rev->getStatus();
 75+ if ( $this->mStatus == '' ) {
 76+ $this->mStatus = $this->mRev->getStatus();
7777 }
7878
7979 $redirectOnPost = $this->checkPostings();
@@ -81,16 +81,16 @@
8282 return;
8383 }
8484
85 - $pageTitle = $this->repo->getName() . wfMsg( 'word-separator' ) . $this->rev->getIdString();
86 - $htmlTitle = $this->rev->getIdString() . wfMsg( 'word-separator' ) . $this->repo->getName();
 85+ $pageTitle = $this->mRepo->getName() . wfMsg( 'word-separator' ) . $this->mRev->getIdString();
 86+ $htmlTitle = $this->mRev->getIdString() . wfMsg( 'word-separator' ) . $this->mRepo->getName();
8787 $wgOut->setPageTitle( wfMsgHtml( 'code-rev-title', $pageTitle ) );
8888 $wgOut->setHTMLTitle( wfMsgHtml( 'code-rev-title', $htmlTitle ) );
8989
90 - $repoLink = $this->skin->link( SpecialPage::getTitleFor( 'Code', $this->repo->getName() ),
91 - htmlspecialchars( $this->repo->getName() ) );
 90+ $repoLink = $this->skin->link( SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() ),
 91+ htmlspecialchars( $this->mRepo->getName() ) );
9292 $revText = $this->navigationLinks();
9393 $paths = '';
94 - $modifiedPaths = $this->rev->getModifiedPaths();
 94+ $modifiedPaths = $this->mRev->getModifiedPaths();
9595 foreach ( $modifiedPaths as $row ) {
9696 $paths .= $this->formatPathLine( $row->cp_path, $row->cp_action );
9797 }
@@ -105,18 +105,18 @@
106106 $fields = array(
107107 'code-rev-repo' => $repoLink,
108108 'code-rev-rev' => $revText,
109 - 'code-rev-date' => $wgLang->timeanddate( $this->rev->getTimestamp(), true ),
110 - 'code-rev-author' => $this->authorLink( $this->rev->getAuthor() ),
 109+ 'code-rev-date' => $wgLang->timeanddate( $this->mRev->getTimestamp(), true ),
 110+ 'code-rev-author' => $this->authorLink( $this->mRev->getAuthor() ),
111111 'code-rev-status' => $this->statusForm() . $commentsLink,
112112 'code-rev-tags' => $this->tagForm(),
113 - 'code-rev-message' => $this->formatMessage( $this->rev->getMessage() ),
 113+ 'code-rev-message' => $this->formatMessage( $this->mRev->getMessage() ),
114114 'code-rev-paths' => $paths,
115115 );
116 - $special = SpecialPage::getTitleFor( 'Code', $this->repo->getName() . '/' . $this->rev->getId() );
 116+ $special = SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() . '/' . $this->mRev->getId() );
117117
118118 $html = '';
119 - if ( $this->path != '' ) {
120 - $html .= wfMsgExt( 'code-browsing-path', 'parse', $this->path );
 119+ if ( $this->mPath != '' ) {
 120+ $html .= wfMsgExt( 'code-browsing-path', 'parse', $this->mPath );
121121 }
122122 # Output form
123123 $html .= Xml::openElement( 'form', array( 'action' => $special->getLocalUrl(), 'method' => 'post' ) );
@@ -127,7 +127,7 @@
128128
129129 $html .= $this->formatMetaData( $fields );
130130 # Output diff
131 - if ( $this->rev->isDiffable() ) {
 131+ if ( $this->mRev->isDiffable() ) {
132132 $diffHtml = $this->formatDiff();
133133 $html .=
134134 "<h2>" . wfMsgHtml( 'code-rev-diff' ) .
@@ -148,8 +148,8 @@
149149 "</h2>\n" . $comments;
150150 }
151151
152 - if ( $this->replyTarget ) {
153 - $id = intval( $this->replyTarget );
 152+ if ( $this->mReplyTarget ) {
 153+ $id = intval( $this->mReplyTarget );
154154 $html .= Html::inlineScript(
155155 "addOnloadHook(function(){document.getElementById('wpReplyTo$id').focus();});"
156156 ) . "\n";
@@ -171,21 +171,21 @@
172172 protected function navigationLinks() {
173173 global $wgLang;
174174
175 - $rev = $this->rev->getId();
176 - $prev = $this->rev->getPrevious( $this->path );
177 - $next = $this->rev->getNext( $this->path );
178 - $repo = $this->repo->getName();
 175+ $rev = $this->mRev->getId();
 176+ $prev = $this->mRev->getPrevious( $this->mPath );
 177+ $next = $this->mRev->getNext( $this->mPath );
 178+ $repo = $this->mRepo->getName();
179179
180180 $links = array();
181181
182182 if ( $prev ) {
183183 $prevTarget = SpecialPage::getTitleFor( 'Code', "$repo/$prev" );
184 - $links[] = '&lt;&#160;' . $this->skin->link( $prevTarget, $this->rev->getIdString( $prev ),
185 - array(), array( 'path' => $this->path ) );
 184+ $links[] = '&lt;&#160;' . $this->skin->link( $prevTarget, $this->mRev->getIdString( $prev ),
 185+ array(), array( 'path' => $this->mPath ) );
186186 }
187187
188 - $revText = "<b>" . $this->rev->getIdString( $rev ) . "</b>";
189 - $viewvc = $this->repo->getViewVcBase();
 188+ $revText = "<b>" . $this->mRev->getIdString( $rev ) . "</b>";
 189+ $viewvc = $this->mRepo->getViewVcBase();
190190 if ( $viewvc ) {
191191 $url = htmlspecialchars( "$viewvc/?view=rev&revision=$rev" );
192192 $viewvcTxt = wfMsgHtml( 'code-rev-rev-viewvc' );
@@ -195,8 +195,8 @@
196196
197197 if ( $next ) {
198198 $nextTarget = SpecialPage::getTitleFor( 'Code', "$repo/$next" );
199 - $links[] = $this->skin->link( $nextTarget, $this->rev->getIdString( $next ),
200 - array(), array( 'path' => $this->path ) ) . '&#160;&gt;';
 199+ $links[] = $this->skin->link( $nextTarget, $this->mRev->getIdString( $next ),
 200+ array(), array( 'path' => $this->mPath ) ) . '&#160;&gt;';
201201 }
202202
203203 return $wgLang->pipeList( $links );
@@ -206,11 +206,11 @@
207207 global $wgRequest, $wgUser;
208208 if ( $wgRequest->wasPosted() && $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) ) ) {
209209 // Look for a posting...
210 - $text = $wgRequest->getText( "wpReply{$this->replyTarget}" );
 210+ $text = $wgRequest->getText( "wpReply{$this->mReplyTarget}" );
211211 $isPreview = $wgRequest->getCheck( 'wpPreview' );
212212 if ( $isPreview ) {
213213 // Save the text for reference on later comment display...
214 - $this->previewText = $text;
 214+ $this->mPreviewText = $text;
215215 }
216216 }
217217 return false;
@@ -246,11 +246,11 @@
247247 $from = isset( $matches[0] ) ? $matches[0] : '';
248248 // Remove ' (from x)' from rename comment in the path.
249249 $path = preg_replace( '/ \([^\)]+\)$/', '', $path );
250 - $viewvc = $this->repo->getViewVcBase();
 250+ $viewvc = $this->mRepo->getViewVcBase();
251251 $diff = '';
252252 $safePath = wfUrlEncode( $path );
253253 if ( $viewvc ) {
254 - $rev = $this->rev->getId();
 254+ $rev = $this->mRev->getId();
255255 $prev = $rev - 1;
256256 if ( $action !== 'D' ) {
257257 $link = $this->skin->makeExternalLink(
@@ -274,7 +274,7 @@
275275
276276 protected function tagForm() {
277277 global $wgUser;
278 - $tags = $this->rev->getTags();
 278+ $tags = $this->mRev->getTags();
279279 $list = '';
280280 if ( count( $tags ) ) {
281281 $list = implode( ", ",
@@ -284,16 +284,16 @@
285285 ) . '&#160;';
286286 }
287287 if ( $wgUser->isAllowed( 'codereview-add-tag' ) ) {
288 - $list .= $this->addTagForm( $this->addTags, $this->removeTags );
 288+ $list .= $this->addTagForm( $this->mAddTags, $this->mRemoveTags );
289289 }
290290 return $list;
291291 }
292292
293293 protected function splitTags( $input ) {
294 - if ( !$this->rev ) return array();
 294+ if ( !$this->mRev ) return array();
295295 $tags = array_map( 'trim', explode( ",", $input ) );
296296 foreach ( $tags as $key => $tag ) {
297 - $normal = $this->rev->normalizeTag( $tag );
 297+ $normal = $this->mRev->normalizeTag( $tag );
298298 if ( $normal === false ) {
299299 return null;
300300 }
@@ -313,10 +313,10 @@
314314 global $wgUser;
315315 if ( $wgUser->isAllowed( 'codereview-set-status' ) ) {
316316 return Xml::openElement( 'select', array( 'name' => 'wpStatus' ) ) .
317 - self::buildStatusList( $this->status, $this ) .
 317+ self::buildStatusList( $this->mStatus, $this ) .
318318 xml::closeElement( 'select' );
319319 } else {
320 - return htmlspecialchars( $this->statusDesc( $this->rev->getStatus() ) );
 320+ return htmlspecialchars( $this->statusDesc( $this->mRev->getStatus() ) );
321321 }
322322 }
323323
@@ -340,7 +340,7 @@
341341 }
342342
343343 protected function formatTag( $tag ) {
344 - $repo = $this->repo->getName();
 344+ $repo = $this->mRepo->getName();
345345 $special = SpecialPage::getTitleFor( 'Code', "$repo/tag/$tag" );
346346 return $this->skin->link( $special, htmlspecialchars( $tag ) );
347347 }
@@ -352,7 +352,7 @@
353353 // And JS in the client, but tough shit eh? ;)
354354 $deferDiffs = $wgEnableAPI;
355355
356 - if ( $this->skipCache ) {
 356+ if ( $this->mSkipCache ) {
357357 // We're purging the cache on purpose, probably
358358 // because the cached data was corrupt.
359359 $cache = 'skipcache';
@@ -365,7 +365,7 @@
366366 } else {
367367 $cache = '';
368368 }
369 - $diff = $this->repo->getDiff( $this->rev->getId(), $cache );
 369+ $diff = $this->mRepo->getDiff( $this->mRev->getId(), $cache );
370370 if ( is_integer($diff) && $deferDiffs ) {
371371 // We'll try loading it by AJAX...
372372 return $this->stubDiffLoader();
@@ -381,7 +381,7 @@
382382 global $wgCodeReviewImgRegex;
383383 // Get image diffs
384384 $imgDiffs = $html = '';
385 - $modifiedPaths = $this->rev->getModifiedPaths();
 385+ $modifiedPaths = $this->mRev->getModifiedPaths();
386386 foreach ( $modifiedPaths as $row ) {
387387 // Typical image file?
388388 if ( preg_match( $wgCodeReviewImgRegex, $row->cp_path ) ) {
@@ -391,13 +391,13 @@
392392 // What was done to it?
393393 $action = $row->cp_action == 'D' ? 'code-rev-modified-d' : 'code-rev-modified-r';
394394 // Link to old image
395 - $imgDiffs .= $this->formatImgCell( $row->cp_path, $this->rev->getPrevious(), $action );
 395+ $imgDiffs .= $this->formatImgCell( $row->cp_path, $this->mRev->getPrevious(), $action );
396396 }
397397 if ( $row->cp_action !== 'D' ) { // new
398398 // What was done to it?
399399 $action = $row->cp_action == 'A' ? 'code-rev-modified-a' : 'code-rev-modified-m';
400400 // Link to new image
401 - $imgDiffs .= $this->formatImgCell( $row->cp_path, $this->rev->getId(), $action );
 401+ $imgDiffs .= $this->formatImgCell( $row->cp_path, $this->mRev->getId(), $action );
402402 }
403403 $imgDiffs .= "</tr></table>\n";
404404 }
@@ -410,7 +410,7 @@
411411 }
412412
413413 protected function formatImgCell( $path, $rev, $message ) {
414 - $viewvc = $this->repo->getViewVcBase();
 414+ $viewvc = $this->mRepo->getViewVcBase();
415415 $safePath = wfUrlEncode( $path );
416416 $url = "{$viewvc}{$safePath}?&pathrev=$rev&revision=$rev";
417417
@@ -430,8 +430,8 @@
431431
432432 protected function stubDiffLoader() {
433433 global $wgOut;
434 - $encRepo = Xml::encodeJsVar( $this->repo->getName() );
435 - $encRev = Xml::encodeJsVar( $this->rev->getId() );
 434+ $encRepo = Xml::encodeJsVar( $this->mRepo->getName() );
 435+ $encRev = Xml::encodeJsVar( $this->mRev->getId() );
436436 $wgOut->addModules( 'ext.codereview.loaddiff' );
437437 $wgOut->addInlineScript(
438438 "addOnloadHook(
@@ -449,7 +449,7 @@
450450 */
451451 protected function formatSignoffs( $showButtons ) {
452452 $signoffs = implode( "\n",
453 - array_map( array( $this, 'formatSignoffInline' ), $this->rev->getSignoffs() )
 453+ array_map( array( $this, 'formatSignoffInline' ), $this->mRev->getSignoffs() )
454454 );
455455 $header = '<th></th>';
456456 $header .= '<th>' . wfMsgHtml( 'code-signoff-field-user' ) . '</th>';
@@ -461,9 +461,9 @@
462462
463463 protected function formatComments() {
464464 $comments = implode( "\n",
465 - array_map( array( $this, 'formatCommentInline' ), $this->rev->getComments() )
 465+ array_map( array( $this, 'formatCommentInline' ), $this->mRev->getComments() )
466466 );
467 - if ( !$this->replyTarget ) {
 467+ if ( !$this->mReplyTarget ) {
468468 $comments .= $this->postCommentForm();
469469 }
470470 if ( !$comments ) {
@@ -474,7 +474,7 @@
475475
476476 protected function formatPropChanges() {
477477 $changes = implode( "\n",
478 - array_map( array( $this, 'formatChangeInline' ), $this->rev->getPropChanges() )
 478+ array_map( array( $this, 'formatChangeInline' ), $this->mRev->getPropChanges() )
479479 );
480480 if ( !$changes ) {
481481 return false;
@@ -484,7 +484,7 @@
485485
486486 protected function formatReferences( $showButtons ) {
487487 $refs = implode( "\n",
488 - array_map( array( $this, 'formatReferenceInline' ), $this->rev->getReferences() )
 488+ array_map( array( $this, 'formatReferenceInline' ), $this->mRev->getReferences() )
489489 );
490490 $header = '<th></th>';
491491 $header .= '<th>' . wfMsgHtml( 'code-field-id' ) . '</th>';
@@ -522,7 +522,7 @@
523523 * @return string
524524 */
525525 protected function formatCommentInline( $comment ) {
526 - if ( $comment->id === $this->replyTarget ) {
 526+ if ( $comment->id === $this->mReplyTarget ) {
527527 return $this->formatComment( $comment,
528528 $this->postCommentForm( $comment->id ) );
529529 } else {
@@ -574,12 +574,12 @@
575575 protected function formatReferenceInline( $row ) {
576576 global $wgLang;
577577 $rev = intval( $row->cr_id );
578 - $repo = $this->repo->getName();
 578+ $repo = $this->mRepo->getName();
579579 // Borrow the code revision list css
580580 $css = 'mw-codereview-status-' . htmlspecialchars( $row->cr_status );
581581 $date = $wgLang->timeanddate( $row->cr_timestamp, true );
582582 $title = SpecialPage::getTitleFor( 'Code', "$repo/$rev" );
583 - $revLink = $this->skin->link( $title, $this->rev->getIdString( $rev ) );
 583+ $revLink = $this->skin->link( $title, $this->mRev->getIdString( $rev ) );
584584 $summary = $this->messageFragment( $row->cr_message );
585585 $author = $this->authorLink( $row->cr_author );
586586 $checkbox = Html::input( 'wpReferences[]', $rev, 'checkbox' );
@@ -587,22 +587,22 @@
588588 }
589589
590590 protected function commentLink( $commentId ) {
591 - $repo = $this->repo->getName();
592 - $rev = $this->rev->getId();
 591+ $repo = $this->mRepo->getName();
 592+ $rev = $this->mRev->getId();
593593 $title = SpecialPage::getTitleFor( 'Code', "$repo/$rev" );
594594 $title->setFragment( "#c{$commentId}" );
595595 return $title;
596596 }
597597
598598 protected function revLink() {
599 - $repo = $this->repo->getName();
600 - $rev = $this->rev->getId();
 599+ $repo = $this->mRepo->getName();
 600+ $rev = $this->mRev->getId();
601601 $title = SpecialPage::getTitleFor( 'Code', "$repo/$rev" );
602602 return $title;
603603 }
604604
605605 protected function previewComment( $text, $review = 0 ) {
606 - $comment = $this->rev->previewComment( $text, $review );
 606+ $comment = $this->mRev->previewComment( $text, $review );
607607 return $this->formatComment( $comment );
608608 }
609609
@@ -613,7 +613,7 @@
614614 */
615615 protected function formatComment( $comment, $replyForm = '' ) {
616616 global $wgOut, $wgLang;
617 - $linker = new CodeCommentLinkerWiki( $this->repo );
 617+ $linker = new CodeCommentLinkerWiki( $this->mRepo );
618618
619619 if ( $comment->id === 0 ) {
620620 $linkId = 'cpreview';
@@ -653,8 +653,8 @@
654654
655655 protected function commentReplyLink( $id ) {
656656 if ( !$this->canPostComments() ) return '';
657 - $repo = $this->repo->getName();
658 - $rev = $this->rev->getId();
 657+ $repo = $this->mRepo->getName();
 658+ $rev = $this->mRev->getId();
659659 $self = SpecialPage::getTitleFor( 'Code', "$repo/$rev/reply/$id" );
660660 $self->setFragment( "#c$id" );
661661 return '[' . $this->skin->link( $self, wfMsg( 'codereview-reply-link' ) ) . ']';
@@ -662,9 +662,9 @@
663663
664664 protected function postCommentForm( $parent = null ) {
665665 global $wgUser;
666 - if ( $this->previewText !== false && $parent === $this->replyTarget ) {
667 - $preview = $this->previewComment( $this->previewText );
668 - $text = htmlspecialchars( $this->previewText );
 666+ if ( $this->mPreviewText !== false && $parent === $this->mReplyTarget ) {
 667+ $preview = $this->previewComment( $this->mPreviewText );
 668+ $text = htmlspecialchars( $this->mPreviewText );
669669 } else {
670670 $preview = '';
671671 $text = $this->text;
@@ -676,7 +676,7 @@
677677 return '<div class="mw-codereview-post-comment">' .
678678 $preview .
679679 Html::hidden( 'wpEditToken', $wgUser->editToken() ) .
680 - Html::hidden( 'path', $this->path ) .
 680+ Html::hidden( 'path', $this->mPath ) .
681681 ( $parent ? Html::hidden( 'wpParent', $parent ) : '' ) .
682682 '<div>' .
683683 Xml::openElement( 'textarea', array(
Index: trunk/extensions/CodeReview/ui/CodeRevisionStatusView.php
@@ -3,29 +3,29 @@
44 class CodeRevisionStatusView extends CodeRevisionListView {
55 function __construct( $repoName, $status ) {
66 parent::__construct( $repoName );
7 - $this->status = $status;
8 - $this->appliedFilter = wfMsg( 'code-revfilter-cr_status', $status );
 7+ $this->mStatus = $status;
 8+ $this->mAppliedFilter = wfMsg( 'code-revfilter-cr_status', $status );
99 }
1010
1111 function getPager() {
12 - return new SvnRevStatusTablePager( $this, $this->status );
 12+ return new SvnRevStatusTablePager( $this, $this->mStatus );
1313 }
1414 }
1515
1616 class SvnRevStatusTablePager extends SvnRevTablePager {
1717 function __construct( $view, $status ) {
1818 parent::__construct( $view );
19 - $this->status = $status;
 19+ $this->mStatus = $status;
2020 }
2121
2222 function getQueryInfo() {
2323 $info = parent::getQueryInfo();
24 - $info['conds']['cr_status'] = $this->status; // FIXME: normalize input?
 24+ $info['conds']['cr_status'] = $this->mStatus; // FIXME: normalize input?
2525 return $info;
2626 }
2727
2828 function getTitle() {
29 - $repo = $this->repo->getName();
30 - return SpecialPage::getTitleFor( 'Code', "$repo/status/$this->status" );
 29+ $repo = $this->mRepo->getName();
 30+ return SpecialPage::getTitleFor( 'Code', "$repo/status/$this->mStatus" );
3131 }
3232 }
Index: trunk/extensions/CodeReview/ui/CodeCommentsAuthorListView.php
@@ -3,6 +3,6 @@
44 class CodeCommentsAuthorListView extends CodeCommentsListView {
55 function __construct( $repo, $author ) {
66 parent::__construct( $repo );
7 - $this->author = $author;
 7+ $this->mAuthor = $author;
88 }
99 }
Index: trunk/extensions/CodeReview/ui/CodeRevisionAuthorLink.php
@@ -3,15 +3,15 @@
44 // Special:Code/MediaWiki/author/johndoe/link
55
66 class CodeRevisionAuthorLink extends CodeRevisionAuthorView {
7 - function __construct( $repo, $author ) {
 7+ function __construct( $repoName, $author ) {
88 global $wgRequest;
9 - parent::__construct( $repo, $author );
10 - $this->target = $wgRequest->getVal( 'linktouser' );
 9+ parent::__construct( $repoName, $author );
 10+ $this->mTarget = $wgRequest->getVal( 'linktouser' );
1111 }
1212
1313 function getTitle() {
14 - $repo = $this->repo->getName();
15 - $auth = $this->author;
 14+ $repo = $this->mRepo->getName();
 15+ $auth = $this->mAuthor;
1616 return SpecialPage::getTitleFor( 'Code', "$repo/author/$auth/link" );
1717 }
1818
@@ -39,7 +39,7 @@
4040
4141 $additional = '';
4242 // Is there already a user linked to this author?
43 - if ( $this->user ) {
 43+ if ( $this->mUser ) {
4444 $form .= Xml::element( 'legend', array(), wfMsg( 'code-author-alterlink' ) );
4545 $additional = Xml::openElement( 'fieldset' ) .
4646 Xml::element( 'legend', array(), wfMsg( 'code-author-orunlink' ) ) .
@@ -67,29 +67,29 @@
6868 return;
6969 }
7070
71 - if ( strlen( $this->target ) && $wgRequest->getCheck( 'newname' ) ) {
72 - $user = User::newFromName( $this->target, false );
 71+ if ( strlen( $this->mTarget ) && $wgRequest->getCheck( 'newname' ) ) {
 72+ $user = User::newFromName( $this->mTarget, false );
7373 if ( !$user || !$user->getId() ) {
74 - $wgOut->addWikiMsg( 'nosuchusershort', $this->target );
 74+ $wgOut->addWikiMsg( 'nosuchusershort', $this->mTarget );
7575 return;
7676 }
77 - $this->repo->linkUser( $this->author, $user );
 77+ $this->mRepo->linkUser( $this->mAuthor, $user );
7878 $userlink = $this->skin->userLink( $user->getId(), $user->getName() );
7979 $wgOut->addHTML(
8080 '<div class="successbox">' .
81 - wfMsgHtml( 'code-author-success', $this->authorLink( $this->author ), $userlink ) .
 81+ wfMsgHtml( 'code-author-success', $this->authorLink( $this->mAuthor ), $userlink ) .
8282 '</div>'
8383 );
8484 // Unlink an author to a wiki users
8585 } else if ( $wgRequest->getVal( 'unlink' ) ) {
86 - if ( !$this->user ) {
 86+ if ( !$this->mUser ) {
8787 $wgOut->addHTML( wfMsg( 'code-author-orphan' ) );
8888 return;
8989 }
90 - $this->repo->unlinkUser( $this->author );
 90+ $this->mRepo->unlinkUser( $this->mAuthor );
9191 $wgOut->addHTML(
9292 '<div class="successbox">' .
93 - wfMsgHtml( 'code-author-unlinksuccess', $this->authorLink( $this->author ) ) .
 93+ wfMsgHtml( 'code-author-unlinksuccess', $this->authorLink( $this->mAuthor ) ) .
9494 '</div>'
9595 );
9696 }
Index: trunk/extensions/CodeReview/ui/CodeTagListView.php
@@ -4,12 +4,12 @@
55 class CodeTagListView extends CodeView {
66 function __construct( $repoName ) {
77 parent::__construct();
8 - $this->repo = CodeRepository::newFromName( $repoName );
 8+ $this->mRepo = CodeRepository::newFromName( $repoName );
99 }
1010
1111 function execute() {
1212 global $wgOut;
13 - $list = $this->repo->getTagList();
 13+ $list = $this->mRepo->getTagList();
1414
1515 if( count( $list ) === 0 ) {
1616 $wgOut->addWikiMsg( 'code-tags-no-tags' );
@@ -21,7 +21,7 @@
2222 }
2323
2424 public function linkCallback( $tag, $weight ) {
25 - $query = $this->repo->getName() . '/tag/' . $tag;
 25+ $query = $this->mRepo->getName() . '/tag/' . $tag;
2626 return Html::element( 'a', array(
2727 'href' => SpecialPage::getTitleFor( 'Code', $query )->getFullURL(),
2828 'class' => 'plainlinks mw-wordcloud-size-' . $weight ), $tag );
Index: trunk/extensions/CodeReview/ui/CodeView.php
@@ -7,7 +7,7 @@
88 /**
99 * @var CodeRepository
1010 */
11 - var $repo;
 11+ var $mRepo;
1212
1313 function __construct() {
1414 global $wgUser;
@@ -24,7 +24,7 @@
2525 abstract function execute();
2626
2727 function authorLink( $author, $extraParams = array() ) {
28 - $repo = $this->repo->getName();
 28+ $repo = $this->mRepo->getName();
2929 $special = SpecialPage::getTitleFor( 'Code', "$repo/author/$author" );
3030 return $this->skin->link( $special, htmlspecialchars( $author ), array(), $extraParams );
3131 }
@@ -35,7 +35,7 @@
3636
3737 function formatMessage( $text ) {
3838 $text = nl2br( htmlspecialchars( $text ) );
39 - $linker = new CodeCommentLinkerHtml( $this->repo );
 39+ $linker = new CodeCommentLinkerHtml( $this->mRepo );
4040 return $linker->link( $text );
4141 }
4242
@@ -72,8 +72,8 @@
7373 }
7474
7575 function getRepo() {
76 - if ( $this->repo ) {
77 - return $this->repo;
 76+ if ( $this->mRepo ) {
 77+ return $this->mRepo;
7878 }
7979 return false;
8080 }
@@ -84,12 +84,12 @@
8585 /**
8686 * @var CodeRepository
8787 */
88 - protected $repo;
 88+ protected $mRepo;
8989
9090 /**
9191 * @var CodeView
9292 */
93 - protected $view;
 93+ protected $mView;
9494
9595 /**
9696 * @param $view CodeView
@@ -97,10 +97,10 @@
9898 */
9999 function __construct( $view ) {
100100 global $IP;
101 - $this->view = $view;
102 - $this->repo = $view->repo;
103 - $this->defaultDirection = true;
104 - $this->curSVN = SpecialVersion::getSvnRevision( $IP );
 101+ $this->mView = $view;
 102+ $this->mRepo = $view->mRepo;
 103+ $this->mDefaultDirection = true;
 104+ $this->mCurSVN = SpecialVersion::getSvnRevision( $IP );
105105 parent::__construct();
106106 }
107107
Index: trunk/extensions/CodeReview/ui/CodeStatusListView.php
@@ -4,12 +4,12 @@
55 class CodeStatusListView extends CodeView {
66 function __construct( $repoName ) {
77 parent::__construct();
8 - $this->repo = CodeRepository::newFromName( $repoName );
 8+ $this->mRepo = CodeRepository::newFromName( $repoName );
99 }
1010
1111 function execute() {
1212 global $wgOut;
13 - $name = $this->repo->getName();
 13+ $name = $this->mRepo->getName();
1414 $states = CodeRevision::getPossibleStates();
1515 $wgOut->addWikiText( "== " . wfMsg ( "code-field-status" ) . " ==\n" );
1616
Index: trunk/extensions/CodeReview/ui/CodeCommentsListView.php
@@ -2,18 +2,17 @@
33
44 // Special:Code/MediaWiki
55 class CodeCommentsListView extends CodeView {
 6+ public $mRepo;
67
7 - protected $author;
8 -
98 function __construct( $repo ) {
109 parent::__construct();
1110
12 - $this->repo = ( $repo instanceof CodeRepository )
 11+ $this->mRepo = ( $repo instanceof CodeRepository )
1312 ? $repo
1413 : CodeRepository::newFromName( $repo );
1514
1615 global $wgRequest;
17 - $this->author = $wgRequest->getText( 'author' );
 16+ $this->mAuthor = $wgRequest->getText( 'author' );
1817 }
1918
2019 function execute() {
@@ -29,22 +28,12 @@
3029 );
3130 }
3231
33 - function getAuthor() {
34 - return $this->author;
35 - }
36 -
37 - /**
38 - * @return CodeCommentsTablePager
39 - */
4032 function getPager() {
4133 return new CodeCommentsTablePager( $this );
4234 }
4335
44 - /**
45 - * @return CodeRepository|null
46 - */
4736 function getRepo() {
48 - return $this->repo;
 37+ return $this->mRepo;
4938 }
5039 }
5140
@@ -63,14 +52,14 @@
6453 $query = array(
6554 'tables' => array( 'code_comment', 'code_rev' ),
6655 'fields' => array_keys( $this->getFieldNames() ),
67 - 'conds' => array( 'cc_repo_id' => $this->repo->getId() ),
 56+ 'conds' => array( 'cc_repo_id' => $this->mRepo->getId() ),
6857 'join_conds' => array(
6958 'code_rev' => array( 'LEFT JOIN', 'cc_repo_id = cr_repo_id AND cc_rev_id = cr_id' )
7059 )
7160 );
7261
73 - if( $this->view instanceof CodeCommentsListView ) {
74 - $query['conds']['cc_user_text'] = $this->view->getAuthor();
 62+ if( $this->mView->mAuthor ) {
 63+ $query['conds']['cc_user_text'] = $this->mView->mAuthor;
7564 }
7665
7766 return $query;
@@ -91,18 +80,18 @@
9281 global $wgLang;
9382 switch( $name ) {
9483 case 'cc_rev_id':
95 - return $this->view->skin->link(
96 - SpecialPage::getTitleFor( 'Code', $this->repo->getName() . '/' . $value . '#code-comments' ),
 84+ return $this->mView->skin->link(
 85+ SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() . '/' . $value . '#code-comments' ),
9786 htmlspecialchars( $value ) );
9887 case 'cr_status':
99 - return $this->view->skin->link(
 88+ return $this->mView->skin->link(
10089 SpecialPage::getTitleFor( 'Code',
101 - $this->repo->getName() . '/status/' . $value ),
102 - htmlspecialchars( $this->view->statusDesc( $value ) ) );
 90+ $this->mRepo->getName() . '/status/' . $value ),
 91+ htmlspecialchars( $this->mView->statusDesc( $value ) ) );
10392 case 'cc_user_text':
104 - return $this->view->skin->userLink( - 1, $value );
 93+ return $this->mView->skin->userLink( - 1, $value );
10594 case 'cr_message':
106 - return $this->view->messageFragment( $value );
 95+ return $this->mView->messageFragment( $value );
10796 case 'cc_text':
10897 # Truncate this, blah blah...
10998 return htmlspecialchars( $wgLang->truncate( $value, 300 ) );
@@ -113,6 +102,6 @@
114103 }
115104
116105 function getTitle() {
117 - return SpecialPage::getTitleFor( 'Code', $this->repo->getName() . '/comments' );
 106+ return SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() . '/comments' );
118107 }
119108 }
Index: trunk/extensions/CodeReview/ui/CodeRevisionAuthorView.php
@@ -1,24 +1,24 @@
22 <?php
33
44 class CodeRevisionAuthorView extends CodeRevisionListView {
5 - function __construct( $repo, $author ) {
6 - parent::__construct( $repo );
7 - $this->author = $author;
8 - $this->user = $this->repo->authorWikiUser( $author );
9 - $this->appliedFilter = wfMsg( 'code-revfilter-cr_author', $author );
 5+ function __construct( $repoName, $author ) {
 6+ parent::__construct( $repoName );
 7+ $this->mAuthor = $author;
 8+ $this->mUser = $this->mRepo->authorWikiUser( $author );
 9+ $this->mAppliedFilter = wfMsg( 'code-revfilter-cr_author', $author );
1010 }
1111
1212 function getPager() {
13 - return new SvnRevAuthorTablePager( $this, $this->author );
 13+ return new SvnRevAuthorTablePager( $this, $this->mAuthor );
1414 }
1515
1616 function linkStatus() {
17 - if ( !$this->user )
 17+ if ( !$this->mUser )
1818 return wfMsg( 'code-author-orphan' );
1919
2020 return wfMsgHtml( 'code-author-haslink',
21 - $this->skin->userLink( $this->user->getId(), $this->user->getName() ) .
22 - $this->skin->userToolLinks( $this->user->getId(), $this->user->getName() ) );
 21+ $this->skin->userLink( $this->mUser->getId(), $this->mUser->getName() ) .
 22+ $this->skin->userToolLinks( $this->mUser->getId(), $this->mUser->getName() ) );
2323 }
2424
2525 function execute() {
@@ -27,17 +27,17 @@
2828 $linkInfo = $this->linkStatus();
2929
3030 if ( $wgUser->isAllowed( 'codereview-link-user' ) ) {
31 - $repo = $this->repo->getName();
32 - $page = SpecialPage::getTitleFor( 'Code', "$repo/author/$this->author/link" );
 31+ $repo = $this->mRepo->getName();
 32+ $page = SpecialPage::getTitleFor( 'Code', "$repo/author/$this->mAuthor/link" );
3333 $linkInfo .= ' (' . $this->skin->link( $page,
34 - wfMsg( 'code-author-' . ( $this->user ? 'un':'' ) . 'link' ) ) . ')' ;
 34+ wfMsg( 'code-author-' . ( $this->mUser ? 'un':'' ) . 'link' ) ) . ')' ;
3535 }
3636
37 - $repoLink = $wgUser->getSkin()->link( SpecialPage::getTitleFor( 'Code', $this->repo->getName() ),
38 - htmlspecialchars( $this->repo->getName() ) );
 37+ $repoLink = $wgUser->getSkin()->link( SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() ),
 38+ htmlspecialchars( $this->mRepo->getName() ) );
3939 $fields = array(
4040 'code-rev-repo' => $repoLink,
41 - 'code-rev-author' => $this->authorLink( $this->author ),
 41+ 'code-rev-author' => $this->authorLink( $this->mAuthor ),
4242 );
4343
4444 $wgOut->addHTML( $this->formatMetaData( $fields ) . $linkInfo );
@@ -49,17 +49,17 @@
5050 class SvnRevAuthorTablePager extends SvnRevTablePager {
5151 function __construct( $view, $author ) {
5252 parent::__construct( $view );
53 - $this->author = $author;
 53+ $this->mAuthor = $author;
5454 }
5555
5656 function getQueryInfo() {
5757 $info = parent::getQueryInfo();
58 - $info['conds']['cr_author'] = $this->author; // fixme: normalize input?
 58+ $info['conds']['cr_author'] = $this->mAuthor; // fixme: normalize input?
5959 return $info;
6060 }
6161
6262 function getTitle() {
63 - $repo = $this->repo->getName();
64 - return SpecialPage::getTitleFor( 'Code', "$repo/author/$this->author" );
 63+ $repo = $this->mRepo->getName();
 64+ return SpecialPage::getTitleFor( 'Code', "$repo/author/$this->mAuthor" );
6565 }
6666 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r81131Rename all variables with m prefixes...reedy13:22, 28 January 2011
r811991 minor revert to r81131reedy22:08, 29 January 2011

Status & tagging log