BryanDavis has uploaded a new change for review.

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

Change subject: Update multiversion/updateBranchPointers whitespace and docs
......................................................................

Update multiversion/updateBranchPointers whitespace and docs

Change-Id: I11247bf9b0f79c96dc2cdf25bb98d471bfedc623
---
M multiversion/updateBranchPointers
1 file changed, 26 insertions(+), 21 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/38/229038/1

diff --git a/multiversion/updateBranchPointers 
b/multiversion/updateBranchPointers
index 31506c3..a7bfe08 100755
--- a/multiversion/updateBranchPointers
+++ b/multiversion/updateBranchPointers
@@ -36,16 +36,15 @@
        usort( $branchDirs, 'version_compare' );
        $branches = array();
 
-       if ($all){
-
-               foreach ($branchDirs as $target) {
-                       $dir = explode('-', basename($target));
-                       $dir = array_pop($dir);
-                       $branches[$dir]=$target;
+       if ( $all ) {
+               foreach ( $branchDirs as $target ) {
+                       $dir = explode( '-', basename( $target ) );
+                       $dir = array_pop( $dir );
+                       $branches[$dir] = $target;
                }
        }
 
-       $branches['current'] = array_pop($branchDirs);
+       $branches['current'] = array_pop( $branchDirs );
 
        // Symlink common/php to the current branch using a relative path so 
that
        // the symlink works from both MEDIAWIKI_STAGING_DIR and
@@ -57,26 +56,32 @@
        updateSymlink( MEDIAWIKI_STAGING_DIR . '/php', $phpLinkTarget, $dryRun 
);
 
        foreach( $branches as $branch => $target ) {
-               updateBranch($dryRun, '/w/static',$branch, $target);
+               updateBranch( $dryRun, '/w/static', $branch, $target );
        }
 }
 
-function updateBranch($dryRun, $prefix, $branch, $target) {
-               echo "Updating $branch branch pointer...\n";
+/**
+ * @param bool $dryRun
+ * @param string $prefix Subdir of MEDIAWIKI_STAGING_DIR to update
+ * @param string $branch WMF release branch to point at (eg 1.26wmf16)
+ * @param string $target Full path under MEDIAWIKI_DEPLOYMENT_DIR of branch
+ */
+function updateBranch( $dryRun, $prefix, $branch, $target ) {
+       echo "Updating $branch branch pointer...\n";
 
-               $parent = MEDIAWIKI_STAGING_DIR . "$prefix/$branch";
+       $parent = MEDIAWIKI_STAGING_DIR . "$prefix/$branch";
 
-               if ( !$dryRun && !file_exists( $parent ) && !mkdir( $parent, 
0775 ) ) {
-                       fwrite( STDERR, __FUNCTION__ . ": $parent does not 
exist and could not be created.\n" );
-                       exit( 1 );
-               }
+       if ( !$dryRun && !file_exists( $parent ) && !mkdir( $parent, 0775 ) ) {
+               fwrite( STDERR, __FUNCTION__ . ": $parent does not exist and 
could not be created.\n" );
+               exit( 1 );
+       }
 
-               foreach( array( 'skins', 'extensions', 'resources' ) as $child 
) {
-                       $link = $parent . '/' . $child;
-                       $dest = $target . '/' . $child;
-                       updateSymlink( $link, $dest, $dryRun );
-               }
-               echo "\n";
+       foreach( array( 'skins', 'extensions', 'resources' ) as $child ) {
+               $link = $parent . '/' . $child;
+               $dest = $target . '/' . $child;
+               updateSymlink( $link, $dest, $dryRun );
+       }
+       echo "\n";
 }
 
 /**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I11247bf9b0f79c96dc2cdf25bb98d471bfedc623
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: BryanDavis <[email protected]>

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

Reply via email to