diff --git a/Source/Source.php b/Source/Source.php index bdac5a8..ff55a85 100644 --- a/Source/Source.php +++ b/Source/Source.php @@ -74,9 +74,11 @@ 'EVENT_SOURCE_PRECOMMIT' => EVENT_TYPE_FIRST, # Allow plugins to try finding commit information before Source looks 'EVENT_SOURCE_COMMIT' => EVENT_TYPE_FIRST, # Source control commit handling, passed commit details from checkin script + 'EVENT_SOURCE_POSTCOMMIT' => EVENT_TYPE_EXECUTE, # Allow processing of the newly-committed changesets 'EVENT_SOURCE_IMPORT_FULL' => EVENT_TYPE_FIRST, # Import an existing repository from scratch 'EVENT_SOURCE_IMPORT_LATEST' => EVENT_TYPE_FIRST, # Import the latest changesets from a repository + 'EVENT_SOURCE_POSTIMPORT' => EVENT_TYPE_EXECUTE, # Allow processing of the newly-imported changesets ); } diff --git a/Source/pages/checkin.php b/Source/pages/checkin.php index c905f97..db8ab2f 100644 --- a/Source/pages/checkin.php +++ b/Source/pages/checkin.php @@ -82,10 +82,13 @@ } # Let the plugins handle commit data -$t_status = event_signal( 'EVENT_SOURCE_COMMIT', array( $t_repo, $f_data ) ); +$t_changesets = event_signal( 'EVENT_SOURCE_COMMIT', array( $t_repo, $f_data ) ); # Changesets couldn't be loaded apparently -if ( !$t_status ) { +if ( !is_array( $t_changesets ) ) { die( plugin_lang_get( 'invalid_changeset' ) ); } +# Allow plugins to handle commits afterwards +event_signal( 'EVENT_SOURCE_POSTCOMMIT', array( $t_repo, $t_changesets ) ); + diff --git a/Source/pages/repo_import_latest.php b/Source/pages/repo_import_latest.php index f52da9e..b30041b 100644 --- a/Source/pages/repo_import_latest.php +++ b/Source/pages/repo_import_latest.php @@ -85,10 +85,12 @@ $t_pre_stats = $t_repo->stats(); -$t_status = event_signal( 'EVENT_SOURCE_IMPORT_LATEST', array( $t_repo ) ); +$t_changesets = event_signal( 'EVENT_SOURCE_IMPORT_LATEST', array( $t_repo ) ); -if ( !$t_status ) { +if ( !is_array( $t_changesets ) ) { echo plugin_lang_get( 'import_latest_failed' ), '
'; +} else { + event_signal( 'EVENT_SOURCE_POSTIMPORT', array( $t_repo, $t_changesets ) ); } if ( !$t_remote ) {