Index: trunk/extensions/CodeReview/repopulateCodePaths.php |
— | — | @@ -39,13 +39,14 @@ |
40 | 40 | |
41 | 41 | $dbr = wfGetDB( DB_SLAVE ); |
42 | 42 | |
43 | | - $res = $dbr->select( 'code_paths', '*', array( 'cp_rev_id' => $revisions, 'cp_repo_id' => $repo->getId() ), |
| 43 | + $res = $dbr->select( 'code_paths', '*', array( 'cp_rev_id' => $revisions, 'cp_repo_id' => $repo->getId() ), |
44 | 44 | __METHOD__ ); |
45 | 45 | |
46 | | - $data = array(); |
| 46 | + $data = array(); |
47 | 47 | foreach ( $res as $row ) { |
48 | | - $data = array_merge(CodeRevision::getPathFragments( |
49 | | - array( 'path' => $row->cp_path, 'action' => $row->cp_action ) ) ); |
| 48 | + $fragments = CodeRevision::getPathFragments( |
| 49 | + array( 'path' => $row->cp_path, 'action' => $row->cp_action ) ); |
| 50 | + $data = array_merge( $data, $fragments ); |
50 | 51 | |
51 | 52 | $this->output( "r{$row->cp_rev_id}, path: " . $row->cp_path . " Fragments: " . |
52 | 53 | count( $fragments ) . "\n" ); |
— | — | @@ -53,7 +54,7 @@ |
54 | 55 | |
55 | 56 | $dbw = wfGetDB( DB_MASTER ); |
56 | 57 | $dbw->begin(); |
57 | | - $this->output( "Commiting paths...\n" ); |
| 58 | + $this->output( "Commiting paths..." ); |
58 | 59 | CodeRevision::insertPaths( $dbw, $data, $repo->getId(), $row->cp_rev_id ); |
59 | 60 | $dbw->commit(); |
60 | 61 | |