Index: trunk/extensions/CodeReview/backend/CodeRevision.php |
— | — | @@ -5,9 +5,9 @@ |
6 | 6 | /** |
7 | 7 | * @var CodeRepository |
8 | 8 | */ |
9 | | - public $mRepo; |
| 9 | + protected $repo; |
10 | 10 | |
11 | | - public $mRepoId, $mId, $mAuthor, $mTimestamp, $mMessage, $mPaths, $mStatus, $mOldStatus, $mCommonPath; |
| 11 | + protected $repoId, $id, $author, $timestamp, $message, $paths, $status, $oldStatus, $commonPath; |
12 | 12 | |
13 | 13 | /** |
14 | 14 | * @static |
— | — | @@ -17,25 +17,25 @@ |
18 | 18 | */ |
19 | 19 | public static function newFromSvn( CodeRepository $repo, $data ) { |
20 | 20 | $rev = new CodeRevision(); |
21 | | - $rev->mRepoId = $repo->getId(); |
22 | | - $rev->mRepo = $repo; |
23 | | - $rev->mId = intval( $data['rev'] ); |
24 | | - $rev->mAuthor = $data['author']; |
25 | | - $rev->mTimestamp = wfTimestamp( TS_MW, strtotime( $data['date'] ) ); |
26 | | - $rev->mMessage = rtrim( $data['msg'] ); |
27 | | - $rev->mPaths = $data['paths']; |
28 | | - $rev->mStatus = 'new'; |
29 | | - $rev->mOldStatus = ''; |
| 21 | + $rev->repoId = $repo->getId(); |
| 22 | + $rev->repo = $repo; |
| 23 | + $rev->id = intval( $data['rev'] ); |
| 24 | + $rev->author = $data['author']; |
| 25 | + $rev->timestamp = wfTimestamp( TS_MW, strtotime( $data['date'] ) ); |
| 26 | + $rev->message = rtrim( $data['msg'] ); |
| 27 | + $rev->paths = $data['paths']; |
| 28 | + $rev->status = 'new'; |
| 29 | + $rev->oldStatus = ''; |
30 | 30 | |
31 | 31 | $common = null; |
32 | | - if ( $rev->mPaths ) { |
33 | | - if ( count( $rev->mPaths ) == 1 ) { |
34 | | - $common = $rev->mPaths[0]['path']; |
| 32 | + if ( $rev->paths ) { |
| 33 | + if ( count( $rev->paths ) == 1 ) { |
| 34 | + $common = $rev->paths[0]['path']; |
35 | 35 | } else { |
36 | | - $first = array_shift( $rev->mPaths ); |
| 36 | + $first = array_shift( $rev->paths ); |
37 | 37 | $common = explode( '/', $first['path'] ); |
38 | 38 | |
39 | | - foreach ( $rev->mPaths as $path ) { |
| 39 | + foreach ( $rev->paths as $path ) { |
40 | 40 | $compare = explode( '/', $path['path'] ); |
41 | 41 | |
42 | 42 | // make sure $common is the shortest path |
— | — | @@ -55,19 +55,19 @@ |
56 | 56 | } |
57 | 57 | $common = implode( '/', $common ); |
58 | 58 | |
59 | | - array_unshift( $rev->mPaths, $first ); |
| 59 | + array_unshift( $rev->paths, $first ); |
60 | 60 | } |
61 | 61 | |
62 | | - $rev->mPaths = CodeRevision::getPathFragments( $rev->mPaths ); |
| 62 | + $rev->paths = CodeRevision::getPathFragments( $rev->paths ); |
63 | 63 | } |
64 | | - $rev->mCommonPath = $common; |
| 64 | + $rev->commonPath = $common; |
65 | 65 | |
66 | 66 | // Check for ignored paths |
67 | 67 | global $wgCodeReviewDeferredPaths; |
68 | 68 | if ( isset( $wgCodeReviewDeferredPaths[ $repo->getName() ] ) ) { |
69 | 69 | foreach ( $wgCodeReviewDeferredPaths[ $repo->getName() ] as $defer ) { |
70 | | - if ( preg_match( $defer, $rev->mCommonPath ) ) { |
71 | | - $rev->mStatus = 'deferred'; |
| 70 | + if ( preg_match( $defer, $rev->commonPath ) ) { |
| 71 | + $rev->status = 'deferred'; |
72 | 72 | break; |
73 | 73 | } |
74 | 74 | } |
— | — | @@ -108,18 +108,18 @@ |
109 | 109 | */ |
110 | 110 | public static function newFromRow( CodeRepository $repo, $row ) { |
111 | 111 | $rev = new CodeRevision(); |
112 | | - $rev->mRepoId = intval( $row->cr_repo_id ); |
113 | | - if ( $rev->mRepoId != $repo->getId() ) { |
| 112 | + $rev->repoId = intval( $row->cr_repo_id ); |
| 113 | + if ( $rev->repoId != $repo->getId() ) { |
114 | 114 | throw new MWException( "Invalid repo ID in " . __METHOD__ ); |
115 | 115 | } |
116 | | - $rev->mRepo = $repo; |
117 | | - $rev->mId = intval( $row->cr_id ); |
118 | | - $rev->mAuthor = $row->cr_author; |
119 | | - $rev->mTimestamp = wfTimestamp( TS_MW, $row->cr_timestamp ); |
120 | | - $rev->mMessage = $row->cr_message; |
121 | | - $rev->mStatus = $row->cr_status; |
122 | | - $rev->mOldStatus = ''; |
123 | | - $rev->mCommonPath = $row->cr_path; |
| 116 | + $rev->repo = $repo; |
| 117 | + $rev->id = intval( $row->cr_id ); |
| 118 | + $rev->author = $row->cr_author; |
| 119 | + $rev->timestamp = wfTimestamp( TS_MW, $row->cr_timestamp ); |
| 120 | + $rev->message = $row->cr_message; |
| 121 | + $rev->status = $row->cr_status; |
| 122 | + $rev->oldStatus = ''; |
| 123 | + $rev->commonPath = $row->cr_path; |
124 | 124 | return $rev; |
125 | 125 | } |
126 | 126 | |
— | — | @@ -127,7 +127,7 @@ |
128 | 128 | * @return int |
129 | 129 | */ |
130 | 130 | public function getId() { |
131 | | - return intval( $this->mId ); |
| 131 | + return intval( $this->id ); |
132 | 132 | } |
133 | 133 | |
134 | 134 | /** |
— | — | @@ -140,7 +140,7 @@ |
141 | 141 | if ( $id === null ) { |
142 | 142 | $id = $this->getId(); |
143 | 143 | } |
144 | | - return $this->mRepo->getRevIdString( $id ); |
| 144 | + return $this->repo->getRevIdString( $id ); |
145 | 145 | } |
146 | 146 | |
147 | 147 | /** |
— | — | @@ -158,56 +158,63 @@ |
159 | 159 | if ( $id === null ) { |
160 | 160 | $id = $this->getId(); |
161 | 161 | } |
162 | | - return $this->mRepo->getRevIdStringUnique( $id ); |
| 162 | + return $this->repo->getRevIdStringUnique( $id ); |
163 | 163 | } |
164 | 164 | |
165 | 165 | /** |
166 | 166 | * @return int |
167 | 167 | */ |
168 | 168 | public function getRepoId() { |
169 | | - return intval( $this->mRepoId ); |
| 169 | + return intval( $this->repoId ); |
170 | 170 | } |
171 | 171 | |
172 | 172 | /** |
173 | | - * @return |
| 173 | + * @return String |
174 | 174 | */ |
175 | 175 | public function getAuthor() { |
176 | | - return $this->mAuthor; |
| 176 | + return $this->author; |
177 | 177 | } |
178 | 178 | |
179 | 179 | /** |
180 | 180 | * @return |
181 | 181 | */ |
182 | 182 | public function getWikiUser() { |
183 | | - return $this->mRepo->authorWikiUser( $this->getAuthor() ); |
| 183 | + return $this->repo->authorWikiUser( $this->getAuthor() ); |
184 | 184 | } |
185 | 185 | |
186 | 186 | /** |
187 | 187 | * @return |
188 | 188 | */ |
189 | 189 | public function getTimestamp() { |
190 | | - return $this->mTimestamp; |
| 190 | + return $this->timestamp; |
191 | 191 | } |
192 | 192 | |
193 | 193 | /** |
194 | | - * @return |
| 194 | + * @return String |
195 | 195 | */ |
196 | 196 | public function getMessage() { |
197 | | - return $this->mMessage; |
| 197 | + return $this->message; |
198 | 198 | } |
199 | 199 | |
200 | 200 | /** |
201 | | - * @return |
| 201 | + * @return String |
202 | 202 | */ |
203 | 203 | public function getStatus() { |
204 | | - return $this->mStatus; |
| 204 | + return $this->status; |
205 | 205 | } |
206 | 206 | |
207 | 207 | /** |
208 | 208 | * @return String |
209 | 209 | */ |
| 210 | + public function getOldStatus() { |
| 211 | + return $this->oldStatus; |
| 212 | + } |
| 213 | + |
| 214 | + /** |
| 215 | + * @return String |
| 216 | + */ |
210 | 217 | public function getCommonPath() { |
211 | | - return $this->mCommonPath; |
| 218 | + return $this->commonPath; |
212 | 219 | } |
213 | 220 | |
214 | 221 | /** |
— | — | @@ -247,21 +254,21 @@ |
248 | 255 | } |
249 | 256 | // Get the old status from the master |
250 | 257 | $dbw = wfGetDB( DB_MASTER ); |
251 | | - $this->mOldStatus = $dbw->selectField( 'code_rev', |
| 258 | + $this->oldStatus = $dbw->selectField( 'code_rev', |
252 | 259 | 'cr_status', |
253 | | - array( 'cr_repo_id' => $this->mRepoId, 'cr_id' => $this->mId ), |
| 260 | + array( 'cr_repo_id' => $this->repoId, 'cr_id' => $this->id ), |
254 | 261 | __METHOD__ |
255 | 262 | ); |
256 | | - if ( $this->mOldStatus === $status ) { |
| 263 | + if ( $this->oldStatus === $status ) { |
257 | 264 | return false; // nothing to do here |
258 | 265 | } |
259 | 266 | // Update status |
260 | | - $this->mStatus = $status; |
| 267 | + $this->status = $status; |
261 | 268 | $dbw->update( 'code_rev', |
262 | 269 | array( 'cr_status' => $status ), |
263 | 270 | array( |
264 | | - 'cr_repo_id' => $this->mRepoId, |
265 | | - 'cr_id' => $this->mId ), |
| 271 | + 'cr_repo_id' => $this->repoId, |
| 272 | + 'cr_id' => $this->id ), |
266 | 273 | __METHOD__ |
267 | 274 | ); |
268 | 275 | // Log this change |
— | — | @@ -271,7 +278,7 @@ |
272 | 279 | 'cpc_repo_id' => $this->getRepoId(), |
273 | 280 | 'cpc_rev_id' => $this->getId(), |
274 | 281 | 'cpc_attrib' => 'status', |
275 | | - 'cpc_removed' => $this->mOldStatus, |
| 282 | + 'cpc_removed' => $this->oldStatus, |
276 | 283 | 'cpc_added' => $status, |
277 | 284 | 'cpc_timestamp' => $dbw->timestamp(), |
278 | 285 | 'cpc_user' => $user->getId(), |
— | — | @@ -281,7 +288,7 @@ |
282 | 289 | ); |
283 | 290 | } |
284 | 291 | |
285 | | - $this->sendStatusToUDP( $status, $this->mOldStatus ); |
| 292 | + $this->sendStatusToUDP( $status, $this->oldStatus ); |
286 | 293 | |
287 | 294 | return true; |
288 | 295 | } |
— | — | @@ -316,13 +323,13 @@ |
317 | 324 | |
318 | 325 | $dbw->insert( 'code_rev', |
319 | 326 | array( |
320 | | - 'cr_repo_id' => $this->mRepoId, |
321 | | - 'cr_id' => $this->mId, |
322 | | - 'cr_author' => $this->mAuthor, |
323 | | - 'cr_timestamp' => $dbw->timestamp( $this->mTimestamp ), |
324 | | - 'cr_message' => $this->mMessage, |
325 | | - 'cr_status' => $this->mStatus, |
326 | | - 'cr_path' => $this->mCommonPath, |
| 327 | + 'cr_repo_id' => $this->repoId, |
| 328 | + 'cr_id' => $this->id, |
| 329 | + 'cr_author' => $this->author, |
| 330 | + 'cr_timestamp' => $dbw->timestamp( $this->timestamp ), |
| 331 | + 'cr_message' => $this->message, |
| 332 | + 'cr_status' => $this->status, |
| 333 | + 'cr_path' => $this->commonPath, |
327 | 334 | 'cr_flags' => '' ), |
328 | 335 | __METHOD__, |
329 | 336 | array( 'IGNORE' ) |
— | — | @@ -333,20 +340,20 @@ |
334 | 341 | if ( !$newRevision ) { |
335 | 342 | $dbw->update( 'code_rev', |
336 | 343 | array( |
337 | | - 'cr_author' => $this->mAuthor, |
338 | | - 'cr_timestamp' => $dbw->timestamp( $this->mTimestamp ), |
339 | | - 'cr_message' => $this->mMessage, |
340 | | - 'cr_path' => $this->mCommonPath ), |
| 344 | + 'cr_author' => $this->author, |
| 345 | + 'cr_timestamp' => $dbw->timestamp( $this->timestamp ), |
| 346 | + 'cr_message' => $this->message, |
| 347 | + 'cr_path' => $this->commonPath ), |
341 | 348 | array( |
342 | | - 'cr_repo_id' => $this->mRepoId, |
343 | | - 'cr_id' => $this->mId ), |
| 349 | + 'cr_repo_id' => $this->repoId, |
| 350 | + 'cr_id' => $this->id ), |
344 | 351 | __METHOD__ |
345 | 352 | ); |
346 | 353 | } |
347 | 354 | |
348 | 355 | // Update path tracking used for output and searching |
349 | | - if ( $this->mPaths ) { |
350 | | - CodeRevision::insertPaths( $dbw, $this->mPaths, $this->mRepoId, $this->mId ); |
| 356 | + if ( $this->paths ) { |
| 357 | + CodeRevision::insertPaths( $dbw, $this->paths, $this->repoId, $this->id ); |
351 | 358 | } |
352 | 359 | |
353 | 360 | $affectedRevs = $this->getUniqueAffectedRevs(); |
— | — | @@ -361,7 +368,7 @@ |
362 | 369 | // Get committer wiki user name, or repo name at least |
363 | 370 | $commitAuthor = $this->getWikiUser(); |
364 | 371 | # Author might not have a username in the wiki: |
365 | | - $committer = $commitAuthor ? $commitAuthor->getName() : htmlspecialchars( $this->mAuthor ); |
| 372 | + $committer = $commitAuthor ? $commitAuthor->getName() : htmlspecialchars( $this->author ); |
366 | 373 | // Get the authors of these revisions |
367 | 374 | $res = $dbw->select( 'code_rev', |
368 | 375 | array( |
— | — | @@ -374,11 +381,11 @@ |
375 | 382 | 'cr_path', |
376 | 383 | ), |
377 | 384 | array( |
378 | | - 'cr_repo_id' => $this->mRepoId, |
| 385 | + 'cr_repo_id' => $this->repoId, |
379 | 386 | 'cr_id' => $affectedRevs, |
380 | | - 'cr_id < ' . intval( $this->mId ), # just in case |
| 387 | + 'cr_id < ' . intval( $this->id ), # just in case |
381 | 388 | // No sense in notifying if it's the same person |
382 | | - 'cr_author != ' . $dbw->addQuotes( $this->mAuthor ) |
| 389 | + 'cr_author != ' . $dbw->addQuotes( $this->author ) |
383 | 390 | ), |
384 | 391 | __METHOD__, |
385 | 392 | array( 'USE INDEX' => 'PRIMARY' ) |
— | — | @@ -388,7 +395,7 @@ |
389 | 396 | $url = $this->getFullUrl(); |
390 | 397 | |
391 | 398 | foreach ( $res as $row ) { |
392 | | - $revision = CodeRevision::newFromRow( $this->mRepo, $row ); |
| 399 | + $revision = CodeRevision::newFromRow( $this->repo, $row ); |
393 | 400 | $users = $revision->getCommentingUsers(); |
394 | 401 | |
395 | 402 | $rowUrl = $revision->getFullUrl(); |
— | — | @@ -406,10 +413,10 @@ |
407 | 414 | // Send message in receiver's language |
408 | 415 | $lang = array( 'language' => $user->getOption( 'language' ) ); |
409 | 416 | $user->sendMail( |
410 | | - wfMsgExt( 'codereview-email-subj2', $lang, $this->mRepo->getName(), |
| 417 | + wfMsgExt( 'codereview-email-subj2', $lang, $this->repo->getName(), |
411 | 418 | $this->getIdString( $row->cr_id ) ), |
412 | 419 | wfMsgExt( 'codereview-email-body2', $lang, $committer, |
413 | | - $this->getIdStringUnique( $row->cr_id ), $url, $this->mMessage, $rowUrl ) |
| 420 | + $this->getIdStringUnique( $row->cr_id ), $url, $this->message, $rowUrl ) |
414 | 421 | ); |
415 | 422 | } |
416 | 423 | } |
— | — | @@ -447,10 +454,10 @@ |
448 | 455 | public function getAffectedRevs() { |
449 | 456 | $affectedRevs = array(); |
450 | 457 | $m = array(); |
451 | | - if ( preg_match_all( '/\br(\d{2,})\b/', $this->mMessage, $m ) ) { |
| 458 | + if ( preg_match_all( '/\br(\d{2,})\b/', $this->message, $m ) ) { |
452 | 459 | foreach ( $m[1] as $rev ) { |
453 | 460 | $affectedRev = intval( $rev ); |
454 | | - if ( $affectedRev != $this->mId ) { |
| 461 | + if ( $affectedRev != $this->id ) { |
455 | 462 | $affectedRevs[] = $affectedRev; |
456 | 463 | } |
457 | 464 | } |
— | — | @@ -469,12 +476,12 @@ |
470 | 477 | // Update bug references table... |
471 | 478 | $affectedBugs = array(); |
472 | 479 | $m = array(); |
473 | | - if ( preg_match_all( '/\bbug (\d+)\b/', $this->mMessage, $m ) ) { |
| 480 | + if ( preg_match_all( '/\bbug (\d+)\b/', $this->message, $m ) ) { |
474 | 481 | $data = array(); |
475 | 482 | foreach ( $m[1] as $bug ) { |
476 | 483 | $data[] = array( |
477 | | - 'cb_repo_id' => $this->mRepoId, |
478 | | - 'cb_from' => $this->mId, |
| 484 | + 'cb_repo_id' => $this->repoId, |
| 485 | + 'cb_from' => $this->id, |
479 | 486 | 'cb_bug' => $bug |
480 | 487 | ); |
481 | 488 | $affectedBugs[] = intval( $bug ); |
— | — | @@ -488,9 +495,9 @@ |
489 | 496 | $res = $dbw->select( 'code_bugs', |
490 | 497 | array( 'cb_from' ), |
491 | 498 | array( |
492 | | - 'cb_repo_id' => $this->mRepoId, |
| 499 | + 'cb_repo_id' => $this->repoId, |
493 | 500 | 'cb_bug' => $affectedBugs, |
494 | | - 'cb_from < ' . intval( $this->mId ), # just in case |
| 501 | + 'cb_from < ' . intval( $this->id ), # just in case |
495 | 502 | ), |
496 | 503 | __METHOD__, |
497 | 504 | array( 'USE INDEX' => 'cb_repo_id' ) |
— | — | @@ -511,7 +518,7 @@ |
512 | 519 | return $dbr->select( |
513 | 520 | 'code_paths', |
514 | 521 | array( 'cp_path', 'cp_action' ), |
515 | | - array( 'cp_repo_id' => $this->mRepoId, 'cp_rev_id' => $this->mId ), |
| 522 | + array( 'cp_repo_id' => $this->repoId, 'cp_rev_id' => $this->id ), |
516 | 523 | __METHOD__ |
517 | 524 | ); |
518 | 525 | } |
— | — | @@ -605,7 +612,7 @@ |
606 | 613 | // Send message in receiver's language |
607 | 614 | $lang = array( 'language' => $user->getOption( 'language' ) ); |
608 | 615 | |
609 | | - $localSubject = wfMsgExt( $subject, $lang, $this->mRepo->getName(), $this->getIdString() ); |
| 616 | + $localSubject = wfMsgExt( $subject, $lang, $this->repo->getName(), $this->getIdString() ); |
610 | 617 | $localBody = call_user_func_array( 'wfMsgExt', array_merge( array( $body, $lang, $wgUser->getName() ), $args ) ); |
611 | 618 | |
612 | 619 | $user->sendMail( $localSubject, $localBody ); |
— | — | @@ -625,8 +632,8 @@ |
626 | 633 | $ts = wfTimestamp( TS_MW ); |
627 | 634 | $sortkey = $this->threadedSortkey( $parent, $ts ); |
628 | 635 | return array( |
629 | | - 'cc_repo_id' => $this->mRepoId, |
630 | | - 'cc_rev_id' => $this->mId, |
| 636 | + 'cc_repo_id' => $this->repoId, |
| 637 | + 'cc_rev_id' => $this->id, |
631 | 638 | 'cc_text' => $text, |
632 | 639 | 'cc_parent' => $parent, |
633 | 640 | 'cc_user' => $wgUser->getId(), |
— | — | @@ -677,8 +684,8 @@ |
678 | 685 | 'cc_review', |
679 | 686 | 'cc_sortkey' ), |
680 | 687 | array( |
681 | | - 'cc_repo_id' => $this->mRepoId, |
682 | | - 'cc_rev_id' => $this->mId ), |
| 688 | + 'cc_repo_id' => $this->repoId, |
| 689 | + 'cc_rev_id' => $this->id ), |
683 | 690 | __METHOD__, |
684 | 691 | array( |
685 | 692 | 'ORDER BY' => 'cc_sortkey' ) |
— | — | @@ -698,8 +705,8 @@ |
699 | 706 | $result = $dbr->select( 'code_comment', |
700 | 707 | array( 'cc_id' ), |
701 | 708 | array( |
702 | | - 'cc_repo_id' => $this->mRepoId, |
703 | | - 'cc_rev_id' => $this->mId ), |
| 709 | + 'cc_repo_id' => $this->repoId, |
| 710 | + 'cc_rev_id' => $this->id ), |
704 | 711 | __METHOD__ |
705 | 712 | ); |
706 | 713 | |
— | — | @@ -725,8 +732,8 @@ |
726 | 733 | 'cpc_user_text', |
727 | 734 | 'user_name' |
728 | 735 | ), array( |
729 | | - 'cpc_repo_id' => $this->mRepoId, |
730 | | - 'cpc_rev_id' => $this->mId, |
| 736 | + 'cpc_repo_id' => $this->repoId, |
| 737 | + 'cpc_rev_id' => $this->id, |
731 | 738 | ), |
732 | 739 | __METHOD__, |
733 | 740 | array( 'ORDER BY' => 'cpc_timestamp DESC' ), |
— | — | @@ -747,8 +754,8 @@ |
748 | 755 | $result = $dbr->select( 'code_prop_changes', |
749 | 756 | 'DISTINCT(cpc_user)', |
750 | 757 | array( |
751 | | - 'cpc_repo_id' => $this->mRepoId, |
752 | | - 'cpc_rev_id' => $this->mId, |
| 758 | + 'cpc_repo_id' => $this->repoId, |
| 759 | + 'cpc_rev_id' => $this->id, |
753 | 760 | ), |
754 | 761 | __METHOD__ |
755 | 762 | ); |
— | — | @@ -774,8 +781,8 @@ |
775 | 782 | $res = $dbr->select( 'code_comment', |
776 | 783 | 'DISTINCT(cc_user)', |
777 | 784 | array( |
778 | | - 'cc_repo_id' => $this->mRepoId, |
779 | | - 'cc_rev_id' => $this->mId, |
| 785 | + 'cc_repo_id' => $this->repoId, |
| 786 | + 'cc_rev_id' => $this->id, |
780 | 787 | 'cc_user != 0' // users only |
781 | 788 | ), |
782 | 789 | __METHOD__ |
— | — | @@ -801,15 +808,15 @@ |
802 | 809 | array( 'code_relations', 'code_rev' ), |
803 | 810 | array( 'cr_id', 'cr_status', 'cr_timestamp', 'cr_author', 'cr_message' ), |
804 | 811 | array( |
805 | | - 'cf_repo_id' => $this->mRepoId, |
806 | | - 'cf_to' => $this->mId, |
| 812 | + 'cf_repo_id' => $this->repoId, |
| 813 | + 'cf_to' => $this->id, |
807 | 814 | 'cr_repo_id = cf_repo_id', |
808 | 815 | 'cr_id = cf_from' |
809 | 816 | ), |
810 | 817 | __METHOD__ |
811 | 818 | ); |
812 | 819 | foreach( $res as $row ) { |
813 | | - if ( $this->mId < intval( $row->cr_id ) ) { |
| 820 | + if ( $this->id < intval( $row->cr_id ) ) { |
814 | 821 | $refs[] = $row; |
815 | 822 | } |
816 | 823 | } |
— | — | @@ -891,8 +898,8 @@ |
892 | 899 | $result = $db->select( 'code_signoffs', |
893 | 900 | array( 'cs_user', 'cs_user_text', 'cs_flag', 'cs_timestamp', 'cs_timestamp_struck' ), |
894 | 901 | array( |
895 | | - 'cs_repo_id' => $this->mRepoId, |
896 | | - 'cs_rev_id' => $this->mId, |
| 902 | + 'cs_repo_id' => $this->repoId, |
| 903 | + 'cs_rev_id' => $this->id, |
897 | 904 | ), |
898 | 905 | __METHOD__, |
899 | 906 | array( 'ORDER BY' => 'cs_timestamp' ) |
— | — | @@ -915,8 +922,8 @@ |
916 | 923 | $rows = array(); |
917 | 924 | foreach ( (array)$flags as $flag ) { |
918 | 925 | $rows[] = array( |
919 | | - 'cs_repo_id' => $this->mRepoId, |
920 | | - 'cs_rev_id' => $this->mId, |
| 926 | + 'cs_repo_id' => $this->repoId, |
| 927 | + 'cs_rev_id' => $this->id, |
921 | 928 | 'cs_user' => $user->getID(), |
922 | 929 | 'cs_user_text' => $user->getName(), |
923 | 930 | 'cs_flag' => $flag, |
— | — | @@ -953,8 +960,8 @@ |
954 | 961 | $result = $db->select( 'code_tags', |
955 | 962 | array( 'ct_tag' ), |
956 | 963 | array( |
957 | | - 'ct_repo_id' => $this->mRepoId, |
958 | | - 'ct_rev_id' => $this->mId ), |
| 964 | + 'ct_repo_id' => $this->repoId, |
| 965 | + 'ct_rev_id' => $this->id ), |
959 | 966 | __METHOD__ ); |
960 | 967 | |
961 | 968 | $tags = array(); |
— | — | @@ -990,8 +997,8 @@ |
991 | 998 | if ( $removeTags ) { |
992 | 999 | $dbw->delete( 'code_tags', |
993 | 1000 | array( |
994 | | - 'ct_repo_id' => $this->mRepoId, |
995 | | - 'ct_rev_id' => $this->mId, |
| 1001 | + 'ct_repo_id' => $this->repoId, |
| 1002 | + 'ct_rev_id' => $this->id, |
996 | 1003 | 'ct_tag' => $removeTags ), |
997 | 1004 | __METHOD__ |
998 | 1005 | ); |
— | — | @@ -1035,8 +1042,8 @@ |
1036 | 1043 | foreach ( $tags as $tag ) { |
1037 | 1044 | if ( $tag == '' ) continue; |
1038 | 1045 | $data[] = array( |
1039 | | - 'ct_repo_id' => $this->mRepoId, |
1040 | | - 'ct_rev_id' => $this->mId, |
| 1046 | + 'ct_repo_id' => $this->repoId, |
| 1047 | + 'ct_rev_id' => $this->id, |
1041 | 1048 | 'ct_tag' => $this->normalizeTag( $tag ) ); |
1042 | 1049 | } |
1043 | 1050 | return $data; |
— | — | @@ -1072,14 +1079,14 @@ |
1073 | 1080 | */ |
1074 | 1081 | public function getPrevious( $path = '' ) { |
1075 | 1082 | $dbr = wfGetDB( DB_SLAVE ); |
1076 | | - $encId = $dbr->addQuotes( $this->mId ); |
| 1083 | + $encId = $dbr->addQuotes( $this->id ); |
1077 | 1084 | $tables = array( 'code_rev' ); |
1078 | 1085 | if ( $path != '' ) { |
1079 | 1086 | $conds = $this->getPathConds( $path ); |
1080 | 1087 | $order = 'cp_rev_id DESC'; |
1081 | 1088 | $tables[] = 'code_paths'; |
1082 | 1089 | } else { |
1083 | | - $conds = array( 'cr_repo_id' => $this->mRepoId ); |
| 1090 | + $conds = array( 'cr_repo_id' => $this->repoId ); |
1084 | 1091 | $order = 'cr_id DESC'; |
1085 | 1092 | } |
1086 | 1093 | $conds[] = "cr_id < $encId"; |
— | — | @@ -1101,14 +1108,14 @@ |
1102 | 1109 | */ |
1103 | 1110 | public function getNext( $path = '' ) { |
1104 | 1111 | $dbr = wfGetDB( DB_SLAVE ); |
1105 | | - $encId = $dbr->addQuotes( $this->mId ); |
| 1112 | + $encId = $dbr->addQuotes( $this->id ); |
1106 | 1113 | $tables = array( 'code_rev' ); |
1107 | 1114 | if ( $path != '' ) { |
1108 | 1115 | $conds = $this->getPathConds( $path ); |
1109 | 1116 | $order = 'cp_rev_id ASC'; |
1110 | 1117 | $tables[] = 'code_paths'; |
1111 | 1118 | } else { |
1112 | | - $conds = array( 'cr_repo_id' => $this->mRepoId ); |
| 1119 | + $conds = array( 'cr_repo_id' => $this->repoId ); |
1113 | 1120 | $order = 'cr_id ASC'; |
1114 | 1121 | } |
1115 | 1122 | $conds[] = "cr_id > $encId"; |
— | — | @@ -1130,7 +1137,7 @@ |
1131 | 1138 | */ |
1132 | 1139 | protected function getPathConds( $path ) { |
1133 | 1140 | return array( |
1134 | | - 'cp_repo_id' => $this->mRepoId, |
| 1141 | + 'cp_repo_id' => $this->repoId, |
1135 | 1142 | 'cp_path' => $path, |
1136 | 1143 | // join conds |
1137 | 1144 | 'cr_repo_id = cp_repo_id', |
— | — | @@ -1144,14 +1151,14 @@ |
1145 | 1152 | */ |
1146 | 1153 | public function getNextUnresolved( $path = '' ) { |
1147 | 1154 | $dbr = wfGetDB( DB_SLAVE ); |
1148 | | - $encId = $dbr->addQuotes( $this->mId ); |
| 1155 | + $encId = $dbr->addQuotes( $this->id ); |
1149 | 1156 | $tables = array( 'code_rev' ); |
1150 | 1157 | if ( $path != '' ) { |
1151 | 1158 | $conds = $this->getPathConds( $path ); |
1152 | 1159 | $order = 'cp_rev_id ASC'; |
1153 | 1160 | $tables[] = 'code_paths'; |
1154 | 1161 | } else { |
1155 | | - $conds = array( 'cr_repo_id' => $this->mRepoId ); |
| 1162 | + $conds = array( 'cr_repo_id' => $this->repoId ); |
1156 | 1163 | $order = 'cr_id ASC'; |
1157 | 1164 | } |
1158 | 1165 | $conds[] = "cr_id > $encId"; |
— | — | @@ -1173,7 +1180,7 @@ |
1174 | 1181 | * @return \type |
1175 | 1182 | */ |
1176 | 1183 | public function getFullUrl( $commentId = '' ) { |
1177 | | - $title = SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() . '/' . $this->mId ); |
| 1184 | + $title = SpecialPage::getTitleFor( 'Code', $this->repo->getName() . '/' . $this->id ); |
1178 | 1185 | |
1179 | 1186 | if ( $commentId !== '' ) { |
1180 | 1187 | $title->setFragment( "#c{$commentId}" ); |
— | — | @@ -1196,7 +1203,7 @@ |
1197 | 1204 | $url = $this->getFullUrl( $commentId ); |
1198 | 1205 | } |
1199 | 1206 | |
1200 | | - $line = wfMsg( 'code-rev-message' ) . " \00314(" . $this->mRepo->getName() . |
| 1207 | + $line = wfMsg( 'code-rev-message' ) . " \00314(" . $this->repo->getName() . |
1201 | 1208 | ")\003 \0037" . $this->getIdString() . "\003 \00303" . RecentChange::cleanupForIRC( $wgUser->getName() ) . |
1202 | 1209 | "\003: \00310" . RecentChange::cleanupForIRC( $wgLang->truncate( $text, 100 ) ) . "\003 " . $url; |
1203 | 1210 | |
— | — | @@ -1215,7 +1222,7 @@ |
1216 | 1223 | if( $wgCodeReviewUDPAddress ) { |
1217 | 1224 | $url = $this->getFullUrl(); |
1218 | 1225 | |
1219 | | - $line = wfMsg( 'code-rev-status' ) . " \00314(" . $this->mRepo->getName() . |
| 1226 | + $line = wfMsg( 'code-rev-status' ) . " \00314(" . $this->repo->getName() . |
1220 | 1227 | ")\00303 " . RecentChange::cleanupForIRC( $wgUser->getName() ) . "\003 " . |
1221 | 1228 | /* Remove three apostrophes as they are intended for the parser */ |
1222 | 1229 | str_replace( "'''", '', wfMsg( 'code-change-status', "\0037" . $this->getIdString() . "\003" ) ) . |
Index: trunk/extensions/CodeReview/svnImport.php |
— | — | @@ -114,8 +114,8 @@ |
115 | 115 | |
116 | 116 | $this->output( sprintf( "%d %s %s (%0.1f revs/sec)\n", |
117 | 117 | $codeRev->getId(), |
118 | | - wfTimestamp( TS_DB, $codeRev->mTimestamp ), |
119 | | - $codeRev->mAuthor, |
| 118 | + wfTimestamp( TS_DB, $codeRev->getTimestamp() ), |
| 119 | + $codeRev->getAuthor(), |
120 | 120 | $revSpeed ) ); |
121 | 121 | } |
122 | 122 | wfWaitForSlaves( 5 ); |
Index: trunk/extensions/CodeReview/ui/CodeRevisionCommitter.php |
— | — | @@ -120,12 +120,12 @@ |
121 | 121 | if ( $statusChanged && $commentAdded ) { |
122 | 122 | $url = $this->mRev->getFullUrl( $commentId ); |
123 | 123 | $this->mRev->emailNotifyUsersOfChanges( 'codereview-email-subj4', 'codereview-email-body4', |
124 | | - $wgUser->getName(), $this->mRev->getIdStringUnique(), $this->mRev->mOldStatus, $this->mRev->mStatus, |
| 124 | + $wgUser->getName(), $this->mRev->getIdStringUnique(), $this->mRev->getOldStatus(), $this->mRev->getStatus(), |
125 | 125 | $url, $this->text |
126 | 126 | ); |
127 | 127 | } else if ( $statusChanged ) { |
128 | 128 | $this->mRev->emailNotifyUsersOfChanges( 'codereview-email-subj3', 'codereview-email-body3', |
129 | | - $wgUser->getName(), $this->mRev->getIdStringUnique(), $this->mRev->mOldStatus, $this->mRev->mStatus |
| 129 | + $wgUser->getName(), $this->mRev->getIdStringUnique(), $this->mRev->getOldStatus(), $this->mRev->getStatus() |
130 | 130 | ); |
131 | 131 | } else if ( $commentAdded ) { |
132 | 132 | $url = $this->mRev->getFullUrl( $commentId ); |