diff --git a/Source/lang/strings_english.txt b/Source/lang/strings_english.txt index 3c0c338..8a7ca47 100644 --- a/Source/lang/strings_english.txt +++ b/Source/lang/strings_english.txt @@ -62,9 +62,12 @@ $s_plugin_Source_ensure_delete = 'Do you really want to delete the "%s" repository and all of its history?'; $s_plugin_Source_ensure_import_full = 'This will import to a new copy of your repository, and then destroy the old repository data, and may require use of shell access. Do you wish to continue?'; $s_plugin_Source_ensure_import_latest = 'This will attempt to import recent data for your repository, and may require use of shell access. Do you wish to continue?'; +$s_plugin_Source_import_stats = 'Imported %s changesets, %s files, and %s bug references.'; $s_plugin_Source_invalid_checkin_url = 'Invalid remote check-in address'; $s_plugin_Source_invalid_repo = 'Invalid repository name'; $s_plugin_Source_invalid_changeset = 'Changeset information could not be loaded'; +$s_plugin_Source_import_latest_failed = 'Importing latest repository data failed.'; +$s_plugin_Source_import_full_failed = 'Full repository data importing failed.'; diff --git a/Source/pages/repo_import_full.php b/Source/pages/repo_import_full.php index 24d96c8..67a7bbb 100644 --- a/Source/pages/repo_import_full.php +++ b/Source/pages/repo_import_full.php @@ -36,7 +36,10 @@ SourceRepo::delete( $t_repo->id ); + $t_stats = $t_new_repo->stats(); + echo '
'; + echo sprintf( plugin_lang_get( 'import_stats' ), $t_stats['changesets'], $t_stats['files'], $t_stats['bugs'] ), '
'; print_bracket_link( plugin_page( 'repo_manage_page' ) . '&id=' . $t_new_repo->id, 'Return To Repository' ); echo '
'; @@ -44,6 +47,7 @@ SourceRepo::delete( $t_new_repo->id ); echo '
'; + echo plugin_lang_get( 'import_full_failed' ), '
'; print_bracket_link( plugin_page( 'repo_manage_page' ) . '&id=' . $t_repo->id, 'Return To Repository' ); echo '
'; } diff --git a/Source/pages/repo_import_latest.php b/Source/pages/repo_import_latest.php index 69657b5..b045317 100644 --- a/Source/pages/repo_import_latest.php +++ b/Source/pages/repo_import_latest.php @@ -25,13 +25,22 @@ html_page_top1(); html_page_top2(); +$t_pre_stats = $t_repo->stats(); + $t_status = event_signal( 'EVENT_SOURCE_IMPORT_LATEST', array( $t_repo ) ); -if ( !$t_status ) { - echo 'Importing latest changes failed.'; -} +$t_stats = $t_repo->stats(); +$t_stats['changesets'] -= $t_pre_stats['changesets']; +$t_stats['files'] -= $t_pre_stats['files']; +$t_stats['bugs'] -= $t_pre_stats['bugs']; echo '
'; +echo sprintf( plugin_lang_get( 'import_stats' ), $t_stats['changesets'], $t_stats['files'], $t_stats['bugs'] ), '
'; + +if ( !$t_status ) { + echo plugin_lang_get( 'import_latest_failed' ), '
'; +} + print_bracket_link( plugin_page( 'repo_manage_page' ) . '&id=' . $t_repo->id, 'Return To Repository' ); echo '
';