Merge pull request #694 from filak-sap/migration_skip_inaccessible

migrations: skip repos that cannot be fetched
This commit is contained in:
Lars Hvam 2017-03-24 17:57:27 +01:00 committed by GitHub
commit b298eb355d

View File

@ -35,7 +35,8 @@ CLASS lcl_migrations IMPLEMENTATION.
DATA: lt_repos TYPE lcl_repo_srv=>ty_repo_tt,
lv_shown TYPE abap_bool,
lo_dot_abapgit TYPE REF TO lcl_dot_abapgit.
lo_dot_abapgit TYPE REF TO lcl_dot_abapgit,
lx_exception TYPE REF TO lcx_exception.
FIELD-SYMBOLS: <lo_repo> LIKE LINE OF lt_repos.
@ -56,7 +57,23 @@ CLASS lcl_migrations IMPLEMENTATION.
txt2 = 'Login to remote repositories if needed'.
lv_shown = abap_true.
ENDIF.
<lo_repo>->refresh( ).
" Skip repos that cannot be fetched.
" Particuarly useful on systems where users do not allow
" everybody to fetch their repos.
TRY.
<lo_repo>->refresh( ).
CATCH lcx_exception INTO lx_exception.
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
titel = 'Migration has failed'
txt1 = lx_exception->mv_text
txt2 = 'Please do not use the ''' && <lo_repo>->get_name( ) && ''' repository until migrated.'
txt3 = 'You will be prompted to migrate the repository every time you run abapGit.'
txt4 = 'You can safely remove the repository in its ''Advanced -> Remove'' menu.'.
CONTINUE.
ENDTRY.
lo_dot_abapgit = <lo_repo>->find_remote_dot_abapgit( ).
IF lo_dot_abapgit IS INITIAL.
* .abapgit.xml is not in the remote repo yet