Chad has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/317731

Change subject: Stop mangling .gitreview
......................................................................

Stop mangling .gitreview

Avoids a pointless commit on extensions/skins/vendor branches.

Ideally we can rewrite this to use the Gerrit REST api to create
branches, but this is a good first step

Change-Id: I3ba2bb8ff3534c12dcb7c8d611693f34fa13c036
---
M make-wmf-branch/MakeWmfBranch.php
1 file changed, 0 insertions(+), 38 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/tools/release 
refs/changes/31/317731/1

diff --git a/make-wmf-branch/MakeWmfBranch.php 
b/make-wmf-branch/MakeWmfBranch.php
index 1565391..2fe5118 100644
--- a/make-wmf-branch/MakeWmfBranch.php
+++ b/make-wmf-branch/MakeWmfBranch.php
@@ -161,8 +161,6 @@
        function createBranch( $branchName, $doPush=true ) {
                $this->runCmd( 'git', 'checkout', '-q', '-b', $branchName );
 
-               $this->fixGitReview();
-               $this->runWriteCmd( 'git', 'commit', '-a', '-q', '-m', 
"Creating new {$branchName} branch" );
                if ( $doPush == true ) {
                        $this->runWriteCmd( 'git', 'push', 'origin', 
$branchName );
                }
@@ -251,9 +249,6 @@
                # Fix $wgVersion
                $this->fixVersion( "includes/DefaultSettings.php" );
 
-               # Point gitreview defaultbranch at wmf/version
-               $this->fixGitReview();
-
                # Do intermediate commit
                $this->runCmd( 'git', 'commit', '-a', '-q', '-m', "Creating new 
WMF {$this->newVersion} branch" );
 
@@ -274,38 +269,5 @@
                $s = preg_replace( '/^( \$wgVersion \s+ = \s+ )  [^;]*  ( ; \s* 
) $/xm',
                        "\\1'{$this->newVersion}'\\2", $s );
                file_put_contents( $fileName, $s );
-       }
-
-       function fixGitReview() {
-               $lines = file( '.gitreview', FILE_IGNORE_NEW_LINES );
-               $outputFile = array();
-               $changed = false;
-
-               foreach ( $lines as $line ) {
-                       $arr = explode( '=', $line );
-
-                       if ( count( $arr ) < 2 ) {
-                               $outputFile[] = $line;
-                               continue;
-                       }
-
-                       list( $k, $v ) = $arr;
-
-                       if ( trim( $k ) === 'defaultbranch' ) {
-                               $v = "{$this->branchPrefix}{$this->newVersion}";
-                               $changed = true;
-                       }
-
-                       $outputFile[] = implode( '=', array( $k, $v ) );
-               }
-
-               $final = implode( "\n", $outputFile );
-               $final .= "\n";
-
-               if ( !$changed ) {
-                       $final .= '# Updated ' . date( 'c' ) . "\n";
-        }
-
-               file_put_contents( '.gitreview', $final );
        }
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/317731
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3ba2bb8ff3534c12dcb7c8d611693f34fa13c036
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/tools/release
Gerrit-Branch: master
Gerrit-Owner: Chad <ch...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to