r96323 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96322‎ | r96323 | r96324 >
Date:12:07, 6 September 2011
Author:reedy
Status:ok (Comments)
Tags:
Comment:
* (bug 27236) Auto tag based on commit path
Modified paths:
  • /trunk/extensions/CodeReview/CodeReview.php (modified) (history)
  • /trunk/extensions/CodeReview/backend/CodeRevision.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/CodeReview.php
@@ -232,6 +232,15 @@
233233 $wgCodeReviewDeferredPaths = array();
234234
235235 /**
 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+/**
236245 * UDP comment and status changes notification
237246 */
238247 $wgCodeReviewUDPAddress = false;
Index: trunk/extensions/CodeReview/backend/CodeRevision.php
@@ -80,6 +80,16 @@
8181 }
8282 }
8383 }
 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+ }
8494 return $rev;
8595 }
8696

Comments

#Comment by P858snake (talk | contribs)   12:47, 6 September 2011

.

Status & tagging log