Add refresh after failed uninstall (#4334)

* Add refresh after failed uninstall

If uninstall does not complete successfully, the old state of the repo will be shown. This will refresh the state and properly show which objects were deleted and which still remain.

* Update src/zcl_abapgit_repo_srv.clas.abap

Co-authored-by: Lars Hvam <larshp@hotmail.com>

Co-authored-by: Lars Hvam <larshp@hotmail.com>
This commit is contained in:
Marc Bernard 2020-12-16 09:09:29 -05:00 committed by GitHub
parent a0736db371
commit 4402ed8cab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -527,6 +527,7 @@ CLASS zcl_abapgit_repo_srv IMPLEMENTATION.
* todo, this should be a method on the repo instead? * todo, this should be a method on the repo instead?
DATA: lt_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt. DATA: lt_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt.
DATA: lx_error TYPE REF TO zcx_abapgit_exception.
CREATE OBJECT ri_log TYPE zcl_abapgit_log. CREATE OBJECT ri_log TYPE zcl_abapgit_log.
ri_log->set_title( 'Uninstall Log' ). ri_log->set_title( 'Uninstall Log' ).
@ -539,9 +540,15 @@ CLASS zcl_abapgit_repo_srv IMPLEMENTATION.
lt_tadir = zcl_abapgit_factory=>get_tadir( )->read( io_repo->get_package( ) ). lt_tadir = zcl_abapgit_factory=>get_tadir( )->read( io_repo->get_package( ) ).
zcl_abapgit_objects=>delete( it_tadir = lt_tadir TRY.
is_checks = is_checks zcl_abapgit_objects=>delete( it_tadir = lt_tadir
ii_log = ri_log ). is_checks = is_checks
ii_log = ri_log ).
CATCH zcx_abapgit_exception INTO lx_error.
" If uninstall fails, repo needs a refresh to show which objects where deleted and which not
io_repo->refresh( ).
RAISE EXCEPTION lx_error.
ENDTRY.
delete( io_repo ). delete( io_repo ).