r79789 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79788‎ | r79789 | r79790 >
Date:02:02, 7 January 2011
Author:reedy
Status:ok
Tags:
Comment:
Storing the repo path in a variable called $mRepo is daft. Hence, rename variable to $mRepoPath
Modified paths:
  • /trunk/extensions/CodeReview/backend/Subversion.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/backend/Subversion.php
@@ -3,9 +3,9 @@
44
55 abstract class SubversionAdaptor {
66 /**
7 - * @var CodeRepository
 7+ * @var string
88 */
9 - protected $mRepo;
 9+ protected $mRepoPath;
1010
1111 public static function newFromRepo( $repo ) {
1212 global $wgSubversionProxy, $wgSubversionProxyTimeout;
@@ -19,10 +19,10 @@
2020 }
2121
2222 /**
23 - * @param $repo CodeRepository
 23+ * @param $repo String Path to SVN Repo
2424 */
25 - function __construct( $repo ) {
26 - $this->mRepo = $repo;
 25+ function __construct( $repoPath ) {
 26+ $this->mRepoPath = $repoPath;
2727 }
2828
2929 abstract function canConnect();
@@ -74,19 +74,19 @@
7575 */
7676 function canConnect() {
7777 //wfSuppressWarnings();
78 - //$result = svn_info( $this->mRepo );
 78+ //$result = svn_info( $this->mRepoPath );
7979 //wfRestoreWarnings();
8080 return true;
8181 }
8282
8383 function getFile( $path, $rev = null ) {
84 - return svn_cat( $this->mRepo . $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->mRepo . $path, $rev1,
90 - $this->mRepo . $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->mRepo . $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->mRepo . $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->mRepo ) );
 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->mRepo . $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->mRepo . $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->mRepo . $path ) );
 173+ wfEscapeShellArg( $this->mRepoPath . $path ) );
174174
175175 $lines = explode( "\n", wfShellExec( $command ) );
176176 $out = array();
@@ -263,7 +263,7 @@
264264 "svn list --xml -r%s %s %s",
265265 wfEscapeShellArg( $this->_rev( $rev, 'HEAD' ) ),
266266 $this->getExtraArgs(),
267 - wfEscapeShellArg( $this->mRepo . $path ) );
 267+ wfEscapeShellArg( $this->mRepoPath . $path ) );
268268 $document = new DOMDocument();
269269
270270 if ( !@$document->loadXML( wfShellExec( $command ) ) )
@@ -340,7 +340,7 @@
341341 function getDiff( $path, $rev1, $rev2 ) {
342342 return $this->_proxy( array(
343343 'action' => 'diff',
344 - 'base' => $this->mRepo,
 344+ 'base' => $this->mRepoPath,
345345 'path' => $path,
346346 'rev1' => $rev1,
347347 'rev2' => $rev2 ) );
@@ -349,7 +349,7 @@
350350 function getLog( $path, $startRev = null, $endRev = null ) {
351351 return $this->_proxy( array(
352352 'action' => 'log',
353 - 'base' => $this->mRepo,
 353+ 'base' => $this->mRepoPath,
354354 'path' => $path,
355355 'start' => $startRev,
356356 'end' => $endRev ) );
@@ -358,7 +358,7 @@
359359 function getDirList( $path, $rev = null ) {
360360 return $this->_proxy( array(
361361 'action' => 'list',
362 - 'base' => $this->mRepo,
 362+ 'base' => $this->mRepoPath,
363363 'path' => $path,
364364 'rev' => $rev ) );
365365 }

Status & tagging log