Index: trunk/extensions/CodeReview/CodeRevision.php |
— | — | @@ -180,12 +180,22 @@ |
181 | 181 | 'cp_path' => $path['path'], |
182 | 182 | 'cp_action' => $path['action'] ); |
183 | 183 | } |
184 | | - $dbw->insert( 'code_paths', |
185 | | - $data, |
186 | | - __METHOD__, |
187 | | - array( 'IGNORE' ) ); |
| 184 | + $dbw->insert( 'code_paths', $data, __METHOD__, array( 'IGNORE' ) ); |
188 | 185 | } |
189 | | - |
| 186 | + // Update code relations (One-digit revs skipped due to some false-positives) |
| 187 | + if ( preg_match( '/\br(\d{2,})\b/', $this->mMessage, $m ) ) { |
| 188 | + $data = array(); |
| 189 | + unset($m[0]); // ignore the whole match |
| 190 | + foreach( $m as $rev ) { |
| 191 | + $data[] = array( |
| 192 | + 'cf_repo_id' => $this->mRepoId, |
| 193 | + 'cf_from' => $this->mId, |
| 194 | + 'cf_to' => intval($rev) |
| 195 | + ); |
| 196 | + } |
| 197 | + $dbw->insert( 'code_relations', $data, __METHOD__, array( 'IGNORE' ) ); |
| 198 | + } |
| 199 | + |
190 | 200 | $dbw->commit(); |
191 | 201 | } |
192 | 202 | |