https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114776

Revision: 114776
Author:   demon
Date:     2012-04-06 21:28:12 +0000 (Fri, 06 Apr 2012)
Log Message:
-----------
Minor tweak to $specialExtensions, let it copy the previous branch *or* a 
specific commit hash

Modified Paths:
--------------
    trunk/tools/make-wmf-branch/default.conf
    trunk/tools/make-wmf-branch/make-wmf-branch

Modified: trunk/tools/make-wmf-branch/default.conf
===================================================================
--- trunk/tools/make-wmf-branch/default.conf    2012-04-06 21:21:08 UTC (rev 
114775)
+++ trunk/tools/make-wmf-branch/default.conf    2012-04-06 21:28:12 UTC (rev 
114776)
@@ -123,8 +123,10 @@
 );
 
 # Extensions extensions that we want to copy their status from the previous 
branch
+# The key is the extension name and the value is either true (copy last 
branch) or
+# a string (use that exact commit hash)
 $specialExtensions = array(
-       # 'ArticleFeedbackv5',
+       # 'ArticleFeedbackv5' => true,
 );
 
 # These items are copied from the old branch to the new one

Modified: trunk/tools/make-wmf-branch/make-wmf-branch
===================================================================
--- trunk/tools/make-wmf-branch/make-wmf-branch 2012-04-06 21:21:08 UTC (rev 
114775)
+++ trunk/tools/make-wmf-branch/make-wmf-branch 2012-04-06 21:28:12 UTC (rev 
114776)
@@ -96,11 +96,15 @@
                # Look for the extensions we want to preserve the old branch's 
state
                $preservedRefs = array();
                if( $this->oldVersion != 'master' ) {
-                       foreach( $this->specialExtensions as $name ) {
-                               if( !file_exists( "extensions/$name" ) ) {
+                       foreach( $this->specialExtensions as $name => $copy ) {
+                               if( !file_exists( "extensions/$name" ) && $copy 
=== true ) {
                                        $this->croak( "Trying to copy state of 
extension ($name) that doesn't exist in the old branch ({$this->oldVersion})" );
                                }
-                               $preservedRefs[$name] = file_get_contents( 
"extensions/$name" );
+                               if( $copy === true ) {
+                                       $preservedRefs[$name] = 
file_get_contents( "extensions/$name" );
+                               } elseif( is_string( $copy ) ) {
+                                       $preservedRefs[$name] = "Subproject 
commit $copy";
+                               }
                        }
                }
 


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to