Index: trunk/extensions/CodeReview/backend/Subversion.php |
— | — | @@ -3,9 +3,9 @@ |
4 | 4 | |
5 | 5 | abstract class SubversionAdaptor { |
6 | 6 | /** |
7 | | - * @var CodeRepository |
| 7 | + * @var string |
8 | 8 | */ |
9 | | - protected $mRepo; |
| 9 | + protected $mRepoPath; |
10 | 10 | |
11 | 11 | public static function newFromRepo( $repo ) { |
12 | 12 | global $wgSubversionProxy, $wgSubversionProxyTimeout; |
— | — | @@ -19,10 +19,10 @@ |
20 | 20 | } |
21 | 21 | |
22 | 22 | /** |
23 | | - * @param $repo CodeRepository |
| 23 | + * @param $repo String Path to SVN Repo |
24 | 24 | */ |
25 | | - function __construct( $repo ) { |
26 | | - $this->mRepo = $repo; |
| 25 | + function __construct( $repoPath ) { |
| 26 | + $this->mRepoPath = $repoPath; |
27 | 27 | } |
28 | 28 | |
29 | 29 | abstract function canConnect(); |
— | — | @@ -74,19 +74,19 @@ |
75 | 75 | */ |
76 | 76 | function canConnect() { |
77 | 77 | //wfSuppressWarnings(); |
78 | | - //$result = svn_info( $this->mRepo ); |
| 78 | + //$result = svn_info( $this->mRepoPath ); |
79 | 79 | //wfRestoreWarnings(); |
80 | 80 | return true; |
81 | 81 | } |
82 | 82 | |
83 | 83 | function getFile( $path, $rev = null ) { |
84 | | - return svn_cat( $this->mRepo . $path, $rev ); |
| 84 | + return svn_cat( $this->mRepoPath . $path, $rev ); |
85 | 85 | } |
86 | 86 | |
87 | 87 | function getDiff( $path, $rev1, $rev2 ) { |
88 | 88 | 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 ); |
91 | 91 | |
92 | 92 | if ( $fout ) { |
93 | 93 | // We have to read out the file descriptors. :P |
— | — | @@ -104,13 +104,13 @@ |
105 | 105 | } |
106 | 106 | |
107 | 107 | function getDirList( $path, $rev = null ) { |
108 | | - return svn_ls( $this->mRepo . $path, |
| 108 | + return svn_ls( $this->mRepoPath . $path, |
109 | 109 | $this->_rev( $rev, SVN_REVISION_HEAD ) ); |
110 | 110 | } |
111 | 111 | |
112 | 112 | function getLog( $path, $startRev = null, $endRev = null ) { |
113 | 113 | wfSuppressWarnings(); |
114 | | - $log = svn_log( $this->mRepo . $path, |
| 114 | + $log = svn_log( $this->mRepoPath . $path, |
115 | 115 | $this->_rev( $startRev, SVN_REVISION_INITIAL ), |
116 | 116 | $this->_rev( $endRev, SVN_REVISION_HEAD ) ); |
117 | 117 | wfRestoreWarnings(); |
— | — | @@ -127,7 +127,7 @@ |
128 | 128 | $command = sprintf( |
129 | 129 | "svn info %s %s", |
130 | 130 | $this->getExtraArgs(), |
131 | | - wfEscapeShellArg( $this->mRepo ) ); |
| 131 | + wfEscapeShellArg( $this->mRepoPath ) ); |
132 | 132 | |
133 | 133 | $result = wfShellExec( $command ); |
134 | 134 | if ( $result == "" ) { |
— | — | @@ -146,7 +146,7 @@ |
147 | 147 | $command = sprintf( |
148 | 148 | "svn cat %s %s", |
149 | 149 | $this->getExtraArgs(), |
150 | | - wfEscapeShellArg( $this->mRepo . $path ) ); |
| 150 | + wfEscapeShellArg( $this->mRepoPath . $path ) ); |
151 | 151 | |
152 | 152 | return wfShellExec( $command ); |
153 | 153 | } |
— | — | @@ -157,7 +157,7 @@ |
158 | 158 | intval( $rev1 ), |
159 | 159 | intval( $rev2 ), |
160 | 160 | $this->getExtraArgs(), |
161 | | - wfEscapeShellArg( $this->mRepo . $path ) ); |
| 161 | + wfEscapeShellArg( $this->mRepoPath . $path ) ); |
162 | 162 | |
163 | 163 | return wfShellExec( $command ); |
164 | 164 | } |
— | — | @@ -169,7 +169,7 @@ |
170 | 170 | wfEscapeShellArg( $this->_rev( $startRev, 'BASE' ) ), |
171 | 171 | wfEscapeShellArg( $this->_rev( $endRev, 'HEAD' ) ), |
172 | 172 | $this->getExtraArgs(), |
173 | | - wfEscapeShellArg( $this->mRepo . $path ) ); |
| 173 | + wfEscapeShellArg( $this->mRepoPath . $path ) ); |
174 | 174 | |
175 | 175 | $lines = explode( "\n", wfShellExec( $command ) ); |
176 | 176 | $out = array(); |
— | — | @@ -263,7 +263,7 @@ |
264 | 264 | "svn list --xml -r%s %s %s", |
265 | 265 | wfEscapeShellArg( $this->_rev( $rev, 'HEAD' ) ), |
266 | 266 | $this->getExtraArgs(), |
267 | | - wfEscapeShellArg( $this->mRepo . $path ) ); |
| 267 | + wfEscapeShellArg( $this->mRepoPath . $path ) ); |
268 | 268 | $document = new DOMDocument(); |
269 | 269 | |
270 | 270 | if ( !@$document->loadXML( wfShellExec( $command ) ) ) |
— | — | @@ -340,7 +340,7 @@ |
341 | 341 | function getDiff( $path, $rev1, $rev2 ) { |
342 | 342 | return $this->_proxy( array( |
343 | 343 | 'action' => 'diff', |
344 | | - 'base' => $this->mRepo, |
| 344 | + 'base' => $this->mRepoPath, |
345 | 345 | 'path' => $path, |
346 | 346 | 'rev1' => $rev1, |
347 | 347 | 'rev2' => $rev2 ) ); |
— | — | @@ -349,7 +349,7 @@ |
350 | 350 | function getLog( $path, $startRev = null, $endRev = null ) { |
351 | 351 | return $this->_proxy( array( |
352 | 352 | 'action' => 'log', |
353 | | - 'base' => $this->mRepo, |
| 353 | + 'base' => $this->mRepoPath, |
354 | 354 | 'path' => $path, |
355 | 355 | 'start' => $startRev, |
356 | 356 | 'end' => $endRev ) ); |
— | — | @@ -358,7 +358,7 @@ |
359 | 359 | function getDirList( $path, $rev = null ) { |
360 | 360 | return $this->_proxy( array( |
361 | 361 | 'action' => 'list', |
362 | | - 'base' => $this->mRepo, |
| 362 | + 'base' => $this->mRepoPath, |
363 | 363 | 'path' => $path, |
364 | 364 | 'rev' => $rev ) ); |
365 | 365 | } |