Making WordPress.org

Changeset 2542


Ignore:
Timestamp:
02/22/2016 07:22:56 AM (10 years ago)
Author:
dd32
Message:

Themes Directory: Switch up the Theme upload process to commit to SVN before creating the Trac ticket & Post.

This allows us to abort early if the code cannot be commited for whatever reason, avoiding manual work needing to be done to allow the upload.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/class-wporg-themes-upload.php

    r2541 r2542  
    262262        // Let's save everything and get things wrapped up.
    263263
     264        // Create a new version in SVN.
     265        $result = $this->add_to_svn();
     266        if ( ! $result ) {
     267            /* translators: %s: mailto link */
     268            return sprintf( __( 'There was an error comitting your theme to SVN. Please try again, if this error persists report the error to %s.', 'wporg-themes' ),
     269                '<a href="mailto:themes@wordpress.org">themes@wordpress.org</a>'
     270            );
     271        }
     272
    264273        // Get all Trac ticket information set up.
    265274        $this->prepare_trac_ticket();
     
    277286        // Add a or update the Theme Directory entry for this theme.
    278287        $this->create_or_update_theme_post( $ticket_id );
    279 
    280         // Create a new version in SVN.
    281         $this->add_to_svn();
    282288
    283289        // Send theme author an email for peace of mind.
     
    669675        $password   = escapeshellarg( THEME_DROPBOX_PASSWORD );
    670676
    671         exec( "{$svn} --non-interactive --username themedropbox --password {$password} --no-auto-props -m {$import_msg} import {$theme_path} {$svn_path}" );
     677        $result = exec( "{$svn} --non-interactive --username themedropbox --password {$password} --no-auto-props -m {$import_msg} import {$theme_path} {$svn_path} 2>&1" );
     678
     679        return ( false !== strpos( $result, 'Committed revision' ) );
    672680    }
    673681
Note: See TracChangeset for help on using the changeset viewer.