Index: trunk/extensions/CodeReview/CodeRevision.php |
— | — | @@ -118,6 +118,20 @@ |
119 | 119 | 'cr_path' => $this->mCommonPath ), |
120 | 120 | __METHOD__, |
121 | 121 | array( 'IGNORE' ) ); |
| 122 | + // Already exists? Update the row! |
| 123 | + if( !$dbw->affectedRows() ) { |
| 124 | + $dbw->update( 'code_rev', |
| 125 | + array( |
| 126 | + 'cr_author' => $this->mAuthor, |
| 127 | + 'cr_timestamp' => $dbw->timestamp( $this->mTimestamp ), |
| 128 | + 'cr_message' => $this->mMessage, |
| 129 | + 'cr_status' => $this->mStatus, |
| 130 | + 'cr_path' => $this->mCommonPath ), |
| 131 | + array( |
| 132 | + 'cr_repo_id' => $this->mRepo, |
| 133 | + 'cr_id' => $this->mId ), |
| 134 | + __METHOD__ ); |
| 135 | + } |
122 | 136 | |
123 | 137 | if( $this->mPaths ) { |
124 | 138 | $data = array(); |
Index: trunk/extensions/CodeReview/svnImport.php |
— | — | @@ -6,7 +6,7 @@ |
7 | 7 | require "$IP/maintenance/commandLine.inc"; |
8 | 8 | |
9 | 9 | if( !isset( $args[0] ) ){ |
10 | | - echo "Usage: php svnImport.php <repo>\n"; |
| 10 | + echo "Usage: php svnImport.php <repo> [<start>]\n"; |
11 | 11 | die; |
12 | 12 | } |
13 | 13 | |
— | — | @@ -24,9 +24,13 @@ |
25 | 25 | |
26 | 26 | $startTime = microtime( true ); |
27 | 27 | $revCount = 0; |
28 | | -$start = $lastStoredRev + 1; |
| 28 | +$start = isset( $args[1] ) ? intval($args[1]) : $lastStoredRev + 1; |
| 29 | +if( $start > ($lastStoredRev + 1) ){ |
| 30 | + echo "Invalid starting point r{$start}\n"; |
| 31 | + die; |
| 32 | +} |
29 | 33 | |
30 | | -echo "Syncing repo {$args[0]} from r$lastStoredRev to HEAD...\n"; |
| 34 | +echo "Syncing repo {$args[0]} from r$start to HEAD...\n"; |
31 | 35 | while( true ) { |
32 | 36 | $log = $svn->getLog( '', $start, $start + $chunkSize - 1 ); |
33 | 37 | if( empty($log) ) { |