Index: trunk/extensions/CodeReview/CodeReview.php |
— | — | @@ -232,6 +232,15 @@ |
233 | 233 | $wgCodeReviewDeferredPaths = array(); |
234 | 234 | |
235 | 235 | /** |
| 236 | + * Key is repository name. Value is an array of key value pairs of the path and then tags |
| 237 | + * |
| 238 | + * An array (or string, for 1 tag) of tags to add to a revision upon commit |
| 239 | + * |
| 240 | + * $wgCodeReviewAutoTagPath = array( 'RepoName' => array( '%^/path/to/use%' => 'sometag', '%^/another/path/to/use%' => array( 'tag1', 'tag2' ) ) ) |
| 241 | + */ |
| 242 | +$wgCodeReviewAutoTagPath = array(); |
| 243 | + |
| 244 | +/** |
236 | 245 | * UDP comment and status changes notification |
237 | 246 | */ |
238 | 247 | $wgCodeReviewUDPAddress = false; |
Index: trunk/extensions/CodeReview/backend/CodeRevision.php |
— | — | @@ -80,6 +80,16 @@ |
81 | 81 | } |
82 | 82 | } |
83 | 83 | } |
| 84 | + |
| 85 | + global $wgCodeReviewAutoTagPath; |
| 86 | + if ( isset( $wgCodeReviewAutoTagPath[ $repo->getName() ] ) ) { |
| 87 | + foreach ( $wgCodeReviewAutoTagPath[ $repo->getName() ] as $path => $tags ) { |
| 88 | + if ( preg_match( $path, $rev->commonPath ) ) { |
| 89 | + $rev->changeTags( $tags, array() ); |
| 90 | + break; |
| 91 | + } |
| 92 | + } |
| 93 | + } |
84 | 94 | return $rev; |
85 | 95 | } |
86 | 96 | |