diff --git a/Source/Source.API.php b/Source/Source.API.php index 5eaf167..12f885c 100644 --- a/Source/Source.API.php +++ b/Source/Source.API.php @@ -222,15 +222,20 @@ * Given a set of changeset objects, parse the bug links * and save the changes. * @param array Changeset objects + * @param object Repository object */ -function Source_Process_Changesets( $p_changesets ) { +function Source_Process_Changesets( $p_changesets, $p_repo=null ) { global $g_cache_current_user_id; if ( !is_array( $p_changesets ) ) { return; } - $t_repos = SourceRepo::load_by_changesets( $p_changesets ); + if ( is_null( $p_repo ) ) { + $t_repos = SourceRepo::load_by_changesets( $p_changesets ); + } else { + $t_repos = array( $p_repo->id => $p_repo ); + } $t_resolved_threshold = config_get('bug_resolved_status_threshold'); $t_fixed_threshold = config_get('bug_resolution_fixed_threshold'); diff --git a/Source/pages/repo_import_full.php b/Source/pages/repo_import_full.php index 9c56a1c..67830e6 100644 --- a/Source/pages/repo_import_full.php +++ b/Source/pages/repo_import_full.php @@ -48,7 +48,8 @@ break; } - Source_Process_Changesets( $t_changesets ); + $t_new_repo->name = $t_repo->name; + Source_Process_Changesets( $t_changesets, $t_new_repo ); } # if we errored, delete the new repo and stop @@ -62,7 +63,6 @@ # otherwise, rename and save the new repo, then delete the old } else { - $t_new_repo->name = $t_repo->name; $t_new_repo->save(); SourceRepo::delete( $t_repo->id );