r79393 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79392‎ | r79393 | r79394 >
Date:00:21, 1 January 2011
Author:reedy
Status:ok
Tags:
Comment:
Few more changing around of lines..
Modified paths:
  • /trunk/extensions/CodeReview/repopulateCodePaths.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/repopulateCodePaths.php
@@ -42,20 +42,19 @@
4343 $res = $dbr->select( 'code_paths', '*', array( 'cp_rev_id' => $revisions, 'cp_repo_id' => $repo->getId() ),
4444 __METHOD__ );
4545
46 - $data = array();
 46+ $dbw = wfGetDB( DB_MASTER );
 47+ $dbw->begin();
 48+
4749 foreach ( $res as $row ) {
4850 $fragments = CodeRevision::getPathFragments(
4951 array( array( 'path' => $row->cp_path, 'action' => $row->cp_action ) ) );
50 - $data = array_merge( $data, $fragments );
5152
 53+ CodeRevision::insertPaths( $dbw, $fragments, $repo->getId(), $row->cp_rev_id );
 54+
5255 $this->output( "r{$row->cp_rev_id}, path: " . $row->cp_path . " Fragments: " .
5356 count( $fragments ) . "\n" );
5457 }
5558
56 - $dbw = wfGetDB( DB_MASTER );
57 - $dbw->begin();
58 - $this->output( "Commiting paths..." );
59 - CodeRevision::insertPaths( $dbw, $data, $repo->getId(), $row->cp_rev_id );
6059 $dbw->commit();
6160
6261 $this->output( "Done!\n" );

Status & tagging log