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

Revision: 114780
Author:   demon
Date:     2012-04-06 21:37:07 +0000 (Fri, 06 Apr 2012)
Log Message:
-----------
Make branch prefix configurable and update usage to match (now I don't have to 
fix fixVersion())

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:34:52 UTC (rev 
114779)
+++ trunk/tools/make-wmf-branch/default.conf    2012-04-06 21:37:07 UTC (rev 
114780)
@@ -136,6 +136,8 @@
 
 $baseRepoPath = 'ssh://gerrit.wikimedia.org:29418/mediawiki';
 
+$branchPrefix = 'wmf/';
+
 $patches = array(
        # array( 'rev' => 97505, 'base' => '^/branches/wmf/1.18wmf1' ),
 );

Modified: trunk/tools/make-wmf-branch/make-wmf-branch
===================================================================
--- trunk/tools/make-wmf-branch/make-wmf-branch 2012-04-06 21:34:52 UTC (rev 
114779)
+++ trunk/tools/make-wmf-branch/make-wmf-branch 2012-04-06 21:37:07 UTC (rev 
114780)
@@ -8,7 +8,7 @@
 
 if ( count( $argv ) < 3 ) {
        echo "Usage: make-wmf-branch <new-version> <old-version>\n";
-       echo "Example: make-wmf-branch wmf/1.20r2 wmf/1.20r1\n";
+       echo "Example: make-wmf-branch 1.20wmf2 1.20wmf1\n";
        exit( 1 );
 }
 
@@ -42,6 +42,7 @@
                $this->patches = $patches;
                $this->preservedItems = $preservedItems;
                $this->baseRepoPath = $baseRepoPath;
+               $this->branchPrefix = $branchPrefix;
        }
 
        function runCmd( /*...*/ ) {
@@ -89,7 +90,8 @@
                $this->chdir( $this->buildDir );
 
                # Clone the repository
-               $this->runCmd( 'git', 'clone', '-q', 
"{$this->baseRepoPath}/core.git", '-b', $this->oldVersion, 'wmf' );
+               $oldVersion = $this->oldVersion == 'master' ? 'master' : 
$this->branchPrefix . $this->oldVersion;
+               $this->runCmd( 'git', 'clone', '-q', 
"{$this->baseRepoPath}/core.git", '-b', $oldVersion, 'wmf' );
 
                $this->chdir( 'wmf' );
                
@@ -109,7 +111,8 @@
                }
 
                # Create a new branch from master and switch to it
-               $this->runCmd( 'git', 'checkout', '-q', '-b', 
"{$this->newVersion}" );
+               $newVersion = $this->branchPrefix . $this->newVersion;
+               $this->runCmd( 'git', 'checkout', '-q', '-b', $newVersion );
 
                # Delete extensions/README and extensions/.gitignore
                $this->runWriteCmd( 'git', 'rm', '-q', "extensions/README", 
"extensions/.gitignore" );


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

Reply via email to