refactor lcl app (#1203)

* refactor lcl_app repo_srv away

* remove lcl_app gui

* fix indentation
This commit is contained in:
Lars Hvam 2018-02-15 13:39:20 +01:00 committed by GitHub
parent b361d46a41
commit eae23e8e9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 83 additions and 155 deletions

View File

@ -32,7 +32,6 @@ SELECTION-SCREEN END OF SCREEN 1001.
INCLUDE zabapgit_password_dialog. " !!! Contains SELECTION SCREEN
INCLUDE zabapgit_app. " Some deferred definitions here
INCLUDE zabapgit_authorizations.
INCLUDE zabapgit_exit.
@ -57,7 +56,6 @@ INCLUDE zabapgit_gui_pages_userexit IF FOUND.
INCLUDE zabapgit_gui_router.
INCLUDE zabapgit_gui.
INCLUDE zabapgit_app_impl.
INCLUDE zabapgit_unit_test.
INCLUDE zabapgit_migrations. " Data migration routines
INCLUDE zabapgit_forms.

View File

@ -1,25 +0,0 @@
*&---------------------------------------------------------------------*
*& Include ZABAPGIT_APP
*&---------------------------------------------------------------------*
CLASS lcl_gui DEFINITION DEFERRED.
CLASS lcl_repo_srv DEFINITION DEFERRED.
*----------------------------------------------------------------------*
* CLASS lcl_app DEFINITION
*----------------------------------------------------------------------*
CLASS lcl_app DEFINITION FINAL.
PUBLIC SECTION.
CLASS-METHODS gui
RETURNING VALUE(ro_gui) TYPE REF TO lcl_gui
RAISING zcx_abapgit_exception.
CLASS-METHODS repo_srv
RETURNING VALUE(ro_repo_srv) TYPE REF TO lcl_repo_srv.
PRIVATE SECTION.
CLASS-DATA: go_gui TYPE REF TO lcl_gui,
go_repo_srv TYPE REF TO lcl_repo_srv.
ENDCLASS. "lcl_app

View File

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<PROGDIR>
<NAME>ZABAPGIT_APP</NAME>
<STATE>A</STATE>
<VARCL>X</VARCL>
<SUBC>I</SUBC>
<RLOAD>E</RLOAD>
<UCCHECK>X</UCCHECK>
</PROGDIR>
<TPOOL>
<item>
<ID>R</ID>
<ENTRY>Include ZABAPGIT_APP</ENTRY>
<LENGTH>20</LENGTH>
</item>
</TPOOL>
</asx:values>
</asx:abap>
</abapGit>

View File

@ -1,28 +0,0 @@
*&---------------------------------------------------------------------*
*& Include ZABAPGIT_APP_IMPL
*&---------------------------------------------------------------------*
*----------------------------------------------------------------------*
* CLASS lcl_app IMPLEMENTATION
*----------------------------------------------------------------------*
CLASS lcl_app IMPLEMENTATION.
METHOD gui.
IF go_gui IS NOT BOUND.
CREATE OBJECT go_gui.
ENDIF.
ro_gui = go_gui.
ENDMETHOD. "gui
METHOD repo_srv.
IF go_repo_srv IS NOT BOUND.
CREATE OBJECT go_repo_srv.
ENDIF.
ro_repo_srv = go_repo_srv.
ENDMETHOD. "repo_srv
ENDCLASS. "lcl_app

View File

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<PROGDIR>
<NAME>ZABAPGIT_APP_IMPL</NAME>
<STATE>A</STATE>
<VARCL>X</VARCL>
<SUBC>I</SUBC>
<RLOAD>E</RLOAD>
<UCCHECK>X</UCCHECK>
</PROGDIR>
<TPOOL>
<item>
<ID>R</ID>
<ENTRY>Include ZABAPGIT_APP_IMPL</ENTRY>
<LENGTH>25</LENGTH>
</item>
</TPOOL>
</asx:values>
</asx:abap>
</abapGit>

View File

@ -233,7 +233,7 @@ CLASS lcl_background IMPLEMENTATION.
WRITE: / 'Background mode' ##NO_TEXT.
LOOP AT lt_list ASSIGNING <ls_list>.
lo_repo ?= lcl_app=>repo_srv( )->get( <ls_list>-key ).
lo_repo ?= lcl_repo_srv=>get_instance( )->get( <ls_list>-key ).
lv_repo_name = lo_repo->get_name( ).
WRITE: / <ls_list>-method, lv_repo_name.

View File

@ -34,7 +34,7 @@ FORM open_gui RAISING zcx_abapgit_exception.
IF sy-batch = abap_true.
lcl_background=>run( ).
ELSE.
lcl_app=>gui( )->go_home( ).
lcl_gui=>get_instance( )->go_home( ).
CALL SELECTION-SCREEN 1001. " trigger screen
ENDIF.
@ -118,7 +118,7 @@ ENDFORM.
FORM exit RAISING zcx_abapgit_exception.
CASE sy-ucomm.
WHEN 'CBAC'. "Back
IF lcl_app=>gui( )->back( ) IS INITIAL.
IF lcl_gui=>get_instance( )->back( ) IS INITIAL.
LEAVE TO SCREEN 1001.
ENDIF.
ENDCASE.

View File

@ -5,10 +5,14 @@
*----------------------------------------------------------------------*
* CLASS lcl_gui DEFINITION
*----------------------------------------------------------------------*
CLASS lcl_gui DEFINITION FINAL CREATE PRIVATE FRIENDS lcl_app.
CLASS lcl_gui DEFINITION FINAL CREATE PRIVATE.
PUBLIC SECTION.
CLASS-METHODS: get_instance
RETURNING VALUE(ro_gui) TYPE REF TO lcl_gui
RAISING zcx_abapgit_exception.
METHODS go_home
RAISING zcx_abapgit_exception.
@ -22,6 +26,8 @@ CLASS lcl_gui DEFINITION FINAL CREATE PRIVATE FRIENDS lcl_app.
PRIVATE SECTION.
CLASS-DATA: go_gui TYPE REF TO lcl_gui.
TYPES: BEGIN OF ty_page_stack,
page TYPE REF TO zif_abapgit_gui_page,
bookmark TYPE abap_bool,
@ -77,6 +83,13 @@ ENDCLASS. "lcl_gui DEFINITION
*----------------------------------------------------------------------*
CLASS lcl_gui IMPLEMENTATION.
METHOD get_instance.
IF go_gui IS INITIAL.
CREATE OBJECT go_gui.
ENDIF.
ro_gui = go_gui.
ENDMETHOD.
METHOD constructor.
startup( ).

View File

@ -166,7 +166,7 @@ CLASS lcl_gui_router IMPLEMENTATION.
WHEN zif_abapgit_definitions=>gc_action-repo_syntax_check.
CREATE OBJECT ei_page TYPE lcl_gui_page_syntax
EXPORTING
io_repo = lcl_app=>repo_srv( )->get( lv_key ).
io_repo = lcl_repo_srv=>get_instance( )->get( lv_key ).
ev_state = zif_abapgit_definitions=>gc_event_state-new_page.
WHEN zif_abapgit_definitions=>gc_action-repo_purge. " Repo remove & purge all objects
lcl_services_repo=>purge( lv_key ).
@ -189,7 +189,7 @@ CLASS lcl_gui_router IMPLEMENTATION.
WHEN zif_abapgit_definitions=>gc_action-repo_settings.
CREATE OBJECT ei_page TYPE lcl_gui_page_repo_sett
EXPORTING
io_repo = lcl_app=>repo_srv( )->get( lv_key ).
io_repo = lcl_repo_srv=>get_instance( )->get( lv_key ).
ev_state = zif_abapgit_definitions=>gc_event_state-new_page.
" ZIP services actions
@ -197,7 +197,7 @@ CLASS lcl_gui_router IMPLEMENTATION.
lcl_zip=>import( lv_key ).
ev_state = zif_abapgit_definitions=>gc_event_state-re_render.
WHEN zif_abapgit_definitions=>gc_action-zip_export. " Export repo as ZIP
lcl_zip=>export( lcl_app=>repo_srv( )->get( lv_key ) ).
lcl_zip=>export( lcl_repo_srv=>get_instance( )->get( lv_key ) ).
ev_state = zif_abapgit_definitions=>gc_event_state-no_more_act.
WHEN zif_abapgit_definitions=>gc_action-zip_package. " Export package as ZIP
lcl_zip=>export_package( ).
@ -305,7 +305,7 @@ CLASS lcl_gui_router IMPLEMENTATION.
lv_key = iv_getdata.
lo_repo ?= lcl_app=>repo_srv( )->get( lv_key ).
lo_repo ?= lcl_repo_srv=>get_instance( )->get( lv_key ).
CREATE OBJECT lo_page
EXPORTING
@ -359,7 +359,7 @@ CLASS lcl_gui_router IMPLEMENTATION.
ev_seed = lv_seed ).
ENDIF.
lo_repo ?= lcl_app=>repo_srv( )->get( lv_key ).
lo_repo ?= lcl_repo_srv=>get_instance( )->get( lv_key ).
" force refresh on stage, to make sure the latest local and remote files are used
lo_repo->refresh( ).

View File

@ -42,7 +42,7 @@ CLASS lcl_migrations IMPLEMENTATION.
FIELD-SYMBOLS: <lo_repo> LIKE LINE OF lt_repos.
lt_repos = lcl_app=>repo_srv( )->list( ).
lt_repos = lcl_repo_srv=>get_instance( )->list( ).
LOOP AT lt_repos ASSIGNING <lo_repo>.
lo_dot_abapgit = <lo_repo>->get_dot_abapgit( ).
@ -99,7 +99,7 @@ CLASS lcl_migrations IMPLEMENTATION.
FIELD-SYMBOLS: <repo> LIKE LINE OF lt_repos.
lt_repos = lcl_app=>repo_srv( )->list( ).
lt_repos = lcl_repo_srv=>get_instance( )->list( ).
LOOP AT lt_repos ASSIGNING <repo>.
lv_index = sy-tabix.

View File

@ -146,7 +146,7 @@ CLASS lcl_gui_page_bkg IMPLEMENTATION.
CREATE OBJECT lo_per.
lt_per = lo_per->list( ).
lo_repo ?= lcl_app=>repo_srv( )->get( mv_key ).
lo_repo ?= lcl_repo_srv=>get_instance( )->get( mv_key ).
READ TABLE lt_per INTO ls_per WITH KEY key = lo_repo->get_key( ).
IF sy-subrc <> 0.

View File

@ -262,7 +262,7 @@ CLASS lcl_gui_page_db IMPLEMENTATION.
RETURN.
ENDIF.
rv_text = |Method: { is_data-data_str+lv_match-offset(lv_match-length) }, |
&& |Repository: { lcl_app=>repo_srv( )->get( is_data-value )->get_name( ) }|.
&& |Repository: { lcl_repo_srv=>get_instance( )->get( is_data-value )->get_name( ) }|.
WHEN 'USER'.
rv_text = '-'. " No additional explanation for user

View File

@ -109,7 +109,7 @@ CLASS lcl_gui_page_diff IMPLEMENTATION.
ASSERT is_file IS INITIAL OR is_object IS INITIAL. " just one passed
lo_repo ?= lcl_app=>repo_srv( )->get( iv_key ).
lo_repo ?= lcl_repo_srv=>get_instance( )->get( iv_key ).
lt_remote = lo_repo->get_files_remote( ).
lt_local = lo_repo->get_files_local( ).
lt_status = lo_repo->status( ).

View File

@ -76,7 +76,7 @@ CLASS lcl_gui_page_main IMPLEMENTATION.
WHEN c_actions-show. " Change displayed repo
zcl_abapgit_persistence_user=>get_instance( )->set_repo_show( lv_key ).
TRY.
lcl_app=>repo_srv( )->get( lv_key )->refresh( ).
lcl_repo_srv=>get_instance( )->get( lv_key )->refresh( ).
CATCH zcx_abapgit_exception ##NO_HANDLER.
ENDTRY.
@ -121,7 +121,7 @@ CLASS lcl_gui_page_main IMPLEMENTATION.
CREATE OBJECT ro_html.
TRY.
lt_repos = lcl_app=>repo_srv( )->list( ).
lt_repos = lcl_repo_srv=>get_instance( )->list( ).
CATCH zcx_abapgit_exception INTO lx_error.
ro_html->add( lcl_gui_chunk_lib=>render_error( ix_error = lx_error ) ).
RETURN.
@ -133,7 +133,7 @@ CLASS lcl_gui_page_main IMPLEMENTATION.
CREATE OBJECT lo_tutorial.
ro_html->add( lo_tutorial->render( ) ).
ELSE.
lo_repo = lcl_app=>repo_srv( )->get( mv_show ).
lo_repo = lcl_repo_srv=>get_instance( )->get( mv_show ).
ro_html->add( render_repo( lo_repo ) ).
ENDIF.
@ -144,7 +144,7 @@ CLASS lcl_gui_page_main IMPLEMENTATION.
DATA: lv_show_old LIKE mv_show.
TRY.
lcl_app=>repo_srv( )->list( ).
lcl_repo_srv=>get_instance( )->list( ).
CATCH zcx_abapgit_exception.
RETURN.
ENDTRY.
@ -154,7 +154,7 @@ CLASS lcl_gui_page_main IMPLEMENTATION.
IF mv_show IS NOT INITIAL.
TRY. " verify the key exists
lcl_app=>repo_srv( )->get( mv_show ).
lcl_repo_srv=>get_instance( )->get( mv_show ).
CATCH zcx_abapgit_exception.
CLEAR mv_show.
zcl_abapgit_persistence_user=>get_instance( )->set_repo_show( mv_show ).

View File

@ -484,7 +484,7 @@ CLASS lcl_popups IMPLEMENTATION.
lv_finished = abap_true.
TRY.
lcl_app=>repo_srv( )->validate_package( rs_popup-package ).
lcl_repo_srv=>get_instance( )->validate_package( rs_popup-package ).
CATCH zcx_abapgit_exception INTO lx_error.
" in case of validation errors we display the popup again
@ -816,7 +816,7 @@ CLASS lcl_popups IMPLEMENTATION.
TRY.
zcl_abapgit_url=>name( |{ lv_url }| ).
IF iv_freeze_package = abap_false.
lcl_app=>repo_srv( )->validate_package( lv_package ).
lcl_repo_srv=>get_instance( )->validate_package( lv_package ).
ENDIF.
CATCH zcx_abapgit_exception INTO lx_error.
MESSAGE lx_error->text TYPE 'S' DISPLAY LIKE 'E'.

View File

@ -2,6 +2,8 @@
*& Include ZABAPGIT_REPO
*&---------------------------------------------------------------------*
CLASS lcl_repo_srv DEFINITION DEFERRED.
*----------------------------------------------------------------------*
* CLASS lcl_repo DEFINITION
*----------------------------------------------------------------------*
@ -175,10 +177,13 @@ ENDCLASS. "lcl_repo_offline DEFINITION
*----------------------------------------------------------------------*
* CLASS lcl_repo_srv DEFINITION
*----------------------------------------------------------------------*
CLASS lcl_repo_srv DEFINITION FINAL CREATE PRIVATE FRIENDS lcl_app.
CLASS lcl_repo_srv DEFINITION FINAL CREATE PRIVATE.
PUBLIC SECTION.
CLASS-METHODS: get_instance
RETURNING VALUE(rv_srv) TYPE REF TO lcl_repo_srv.
TYPES: ty_repo_tt TYPE STANDARD TABLE OF REF TO lcl_repo WITH DEFAULT KEY.
METHODS list
@ -227,6 +232,8 @@ CLASS lcl_repo_srv DEFINITION FINAL CREATE PRIVATE FRIENDS lcl_app.
PRIVATE SECTION.
CLASS-DATA: go_ref TYPE REF TO lcl_repo_srv.
METHODS constructor.
DATA: mv_init TYPE abap_bool VALUE abap_false,

View File

@ -321,7 +321,7 @@ CLASS lcl_repo_online IMPLEMENTATION.
IF me->is_offline( ) = abap_false AND me->get_sha1_local( ) IS INITIAL.
lcl_app=>repo_srv( )->delete( me ).
lcl_repo_srv=>get_instance( )->delete( me ).
IF iv_commit = abap_true.
COMMIT WORK.
@ -829,6 +829,13 @@ ENDCLASS. "lcl_repo IMPLEMENTATION
*----------------------------------------------------------------------*
CLASS lcl_repo_srv IMPLEMENTATION.
METHOD get_instance.
IF go_ref IS INITIAL.
CREATE OBJECT go_ref.
ENDIF.
rv_srv = go_ref.
ENDMETHOD.
METHOD constructor.
CREATE OBJECT mo_persistence.
ENDMETHOD. "class_constructor

View File

@ -133,13 +133,13 @@ CLASS lcl_services_abapgit IMPLEMENTATION.
RETURN.
ENDIF.
IF abap_false = lcl_app=>repo_srv( )->is_repo_installed(
IF abap_false = lcl_repo_srv=>get_instance( )->is_repo_installed(
iv_url = iv_url
iv_target_package = iv_package ).
zcl_abapgit_sap_package=>create_local( iv_package ).
lo_repo = lcl_app=>repo_srv( )->new_online(
lo_repo = lcl_repo_srv=>get_instance( )->new_online(
iv_url = iv_url
iv_branch_name = 'refs/heads/master'
iv_package = iv_package ) ##NO_TEXT.
@ -159,7 +159,7 @@ CLASS lcl_services_abapgit IMPLEMENTATION.
METHOD is_installed.
TRY.
rv_installed = lcl_app=>repo_srv( )->is_repo_installed( c_abapgit_url ).
rv_installed = lcl_repo_srv=>get_instance( )->is_repo_installed( c_abapgit_url ).
" TODO, alternative checks for presence in the system
CATCH zcx_abapgit_exception.
" cannot be installed anyway in this case, e.g. no connection
@ -171,7 +171,7 @@ CLASS lcl_services_abapgit IMPLEMENTATION.
METHOD is_installed_pi.
TRY.
rv_installed = lcl_app=>repo_srv( )->is_repo_installed( c_plugins_url ).
rv_installed = lcl_repo_srv=>get_instance( )->is_repo_installed( c_plugins_url ).
" TODO, alternative checks for presence in the system
CATCH zcx_abapgit_exception.
" cannot be installed anyway in this case, e.g. no connection

View File

@ -69,7 +69,7 @@ CLASS lcl_services_git IMPLEMENTATION.
lt_selected LIKE lt_unnecessary_local_objs,
lt_columns TYPE stringtab.
lo_repo ?= lcl_app=>repo_srv( )->get( iv_key ).
lo_repo ?= lcl_repo_srv=>get_instance( )->get( iv_key ).
IF lo_repo->is_write_protected( ) = abap_true.
zcx_abapgit_exception=>raise( 'Cannot reset. Local code is write-protected by repo config' ).
@ -124,7 +124,7 @@ CLASS lcl_services_git IMPLEMENTATION.
lo_repo TYPE REF TO lcl_repo_online.
lo_repo ?= lcl_app=>repo_srv( )->get( iv_key ).
lo_repo ?= lcl_repo_srv=>get_instance( )->get( iv_key ).
lcl_popups=>create_branch_popup(
IMPORTING
@ -152,7 +152,7 @@ CLASS lcl_services_git IMPLEMENTATION.
DATA: lo_repo TYPE REF TO lcl_repo_online.
lo_repo ?= lcl_app=>repo_srv( )->get( iv_key ).
lo_repo ?= lcl_repo_srv=>get_instance( )->get( iv_key ).
IF lo_repo->is_write_protected( ) = abap_true.
zcx_abapgit_exception=>raise( 'Cannot pull. Local code is write-protected by repo config' ).
@ -171,7 +171,7 @@ CLASS lcl_services_git IMPLEMENTATION.
ls_branch TYPE zcl_abapgit_git_branch_list=>ty_git_branch.
lo_repo ?= lcl_app=>repo_srv( )->get( iv_key ).
lo_repo ?= lcl_repo_srv=>get_instance( )->get( iv_key ).
ls_branch = lcl_popups=>branch_list_popup(
iv_url = lo_repo->get_url( )
@ -200,7 +200,7 @@ CLASS lcl_services_git IMPLEMENTATION.
ls_branch TYPE zcl_abapgit_git_branch_list=>ty_git_branch.
lo_repo ?= lcl_app=>repo_srv( )->get( iv_key ).
lo_repo ?= lcl_repo_srv=>get_instance( )->get( iv_key ).
ls_branch = lcl_popups=>branch_list_popup( lo_repo->get_url( ) ).
IF ls_branch IS INITIAL.
@ -238,7 +238,7 @@ CLASS lcl_services_git IMPLEMENTATION.
lo_repo TYPE REF TO lcl_repo_online,
lv_sha1 TYPE zif_abapgit_definitions=>ty_sha1.
lo_repo ?= lcl_app=>repo_srv( )->get( iv_key ).
lo_repo ?= lcl_repo_srv=>get_instance( )->get( iv_key ).
lcl_popups=>create_tag_popup(
EXPORTING
@ -275,7 +275,7 @@ CLASS lcl_services_git IMPLEMENTATION.
ls_tag TYPE zcl_abapgit_git_branch_list=>ty_git_branch,
lv_text TYPE string.
lo_repo ?= lcl_app=>repo_srv( )->get( iv_key ).
lo_repo ?= lcl_repo_srv=>get_instance( )->get( iv_key ).
ls_tag = lcl_popups=>tag_list_popup( lo_repo->get_url( ) ).
IF ls_tag IS INITIAL.
@ -298,7 +298,7 @@ CLASS lcl_services_git IMPLEMENTATION.
ls_tag TYPE zcl_abapgit_git_branch_list=>ty_git_branch,
lv_text TYPE string.
lo_repo ?= lcl_app=>repo_srv( )->get( iv_key ).
lo_repo ?= lcl_repo_srv=>get_instance( )->get( iv_key ).
ls_tag = lcl_popups=>tag_list_popup( lo_repo->get_url( ) ).
IF ls_tag IS INITIAL.
@ -317,7 +317,7 @@ CLASS lcl_services_git IMPLEMENTATION.
DATA: lo_repo TYPE REF TO lcl_repo_online.
lo_repo ?= lcl_app=>repo_srv( )->get( iv_key ).
lo_repo ?= lcl_repo_srv=>get_instance( )->get( iv_key ).
lcl_popups=>tag_list_popup( iv_url = lo_repo->get_url( )
iv_select_mode = abap_false ).

View File

@ -66,7 +66,7 @@ CLASS lcl_services_repo IMPLEMENTATION.
RAISE EXCEPTION TYPE zcx_abapgit_cancel.
ENDIF.
lo_repo = lcl_app=>repo_srv( )->new_online(
lo_repo = lcl_repo_srv=>get_instance( )->new_online(
iv_url = ls_popup-url
iv_branch_name = ls_popup-branch_name
iv_package = ls_popup-package ).
@ -86,7 +86,7 @@ CLASS lcl_services_repo IMPLEMENTATION.
METHOD refresh.
lcl_app=>repo_srv( )->get( iv_key )->refresh( ).
lcl_repo_srv=>get_instance( )->get( iv_key )->refresh( ).
ENDMETHOD. "refresh
@ -98,7 +98,7 @@ CLASS lcl_services_repo IMPLEMENTATION.
lv_question TYPE c LENGTH 200.
lo_repo = lcl_app=>repo_srv( )->get( iv_key ).
lo_repo = lcl_repo_srv=>get_instance( )->get( iv_key ).
lv_package = lo_repo->get_package( ).
lv_question = |This will remove the repository reference to the package { lv_package }|
&& '. All objects will safely remain in the system.'.
@ -117,7 +117,7 @@ CLASS lcl_services_repo IMPLEMENTATION.
RAISE EXCEPTION TYPE zcx_abapgit_cancel.
ENDIF.
lcl_app=>repo_srv( )->delete( lo_repo ).
lcl_repo_srv=>get_instance( )->delete( lo_repo ).
COMMIT WORK.
@ -132,7 +132,7 @@ CLASS lcl_services_repo IMPLEMENTATION.
lv_question TYPE c LENGTH 100.
lo_repo = lcl_app=>repo_srv( )->get( iv_key ).
lo_repo = lcl_repo_srv=>get_instance( )->get( iv_key ).
IF lo_repo->is_write_protected( ) = abap_true.
zcx_abapgit_exception=>raise( 'Cannot purge. Local code is write-protected by repo config' ).
@ -164,7 +164,7 @@ CLASS lcl_services_repo IMPLEMENTATION.
ENDIF.
lcl_app=>repo_srv( )->delete( lo_repo ).
lcl_repo_srv=>get_instance( )->delete( lo_repo ).
COMMIT WORK.
@ -180,7 +180,7 @@ CLASS lcl_services_repo IMPLEMENTATION.
RAISE EXCEPTION TYPE zcx_abapgit_cancel.
ENDIF.
lo_repo = lcl_app=>repo_srv( )->new_offline(
lo_repo = lcl_repo_srv=>get_instance( )->new_offline(
iv_url = ls_popup-url
iv_package = ls_popup-package ).
@ -209,7 +209,7 @@ CLASS lcl_services_repo IMPLEMENTATION.
RAISE EXCEPTION TYPE zcx_abapgit_cancel.
ENDIF.
lcl_app=>repo_srv( )->switch_repo_type( iv_key = iv_key iv_offline = abap_true ).
lcl_repo_srv=>get_instance( )->switch_repo_type( iv_key = iv_key iv_offline = abap_true ).
COMMIT WORK.
@ -224,15 +224,15 @@ CLASS lcl_services_repo IMPLEMENTATION.
ls_popup = lcl_popups=>repo_popup(
iv_title = 'Attach repo to remote ...'
iv_url = ''
iv_package = lcl_app=>repo_srv( )->get( iv_key )->get_package( )
iv_package = lcl_repo_srv=>get_instance( )->get( iv_key )->get_package( )
iv_freeze_package = abap_true ).
IF ls_popup-cancel = abap_true.
RAISE EXCEPTION TYPE zcx_abapgit_cancel.
ENDIF.
lcl_app=>repo_srv( )->switch_repo_type( iv_key = iv_key iv_offline = abap_false ).
lcl_repo_srv=>get_instance( )->switch_repo_type( iv_key = iv_key iv_offline = abap_false ).
lo_repo ?= lcl_app=>repo_srv( )->get( iv_key ).
lo_repo ?= lcl_repo_srv=>get_instance( )->get( iv_key ).
lo_repo->set_url( ls_popup-url ).
lo_repo->set_branch_name( ls_popup-branch_name ).
@ -245,7 +245,7 @@ CLASS lcl_services_repo IMPLEMENTATION.
DATA: ls_popup TYPE lcl_popups=>ty_popup,
lo_repo TYPE REF TO lcl_repo_online.
lo_repo ?= lcl_app=>repo_srv( )->get( iv_key ).
lo_repo ?= lcl_repo_srv=>get_instance( )->get( iv_key ).
ls_popup = lcl_popups=>repo_popup(
iv_title = 'Change repo remote ...'
@ -256,7 +256,7 @@ CLASS lcl_services_repo IMPLEMENTATION.
RAISE EXCEPTION TYPE zcx_abapgit_cancel.
ENDIF.
lo_repo ?= lcl_app=>repo_srv( )->get( iv_key ).
lo_repo ?= lcl_repo_srv=>get_instance( )->get( iv_key ).
lo_repo->set_new_remote( iv_url = ls_popup-url
iv_branch_name = ls_popup-branch_name ).
@ -271,7 +271,7 @@ CLASS lcl_services_repo IMPLEMENTATION.
lo_repo TYPE REF TO lcl_repo.
lo_repo = lcl_app=>repo_srv( )->get( iv_key ).
lo_repo = lcl_repo_srv=>get_instance( )->get( iv_key ).
lv_question = 'This will rebuild and overwrite local repo checksums.'.
@ -328,7 +328,7 @@ CLASS lcl_services_repo IMPLEMENTATION.
lt_transport_objects TYPE scts_tadir,
ls_transport_to_branch TYPE zif_abapgit_definitions=>ty_transport_to_branch.
lo_repository ?= lcl_app=>repo_srv( )->get( iv_repository_key ).
lo_repository ?= lcl_repo_srv=>get_instance( )->get( iv_repository_key ).
lt_transport_headers = lcl_popups=>popup_to_select_transports( ).
lt_transport_objects = lcl_transport=>to_tadir( lt_transport_headers ).

View File

@ -117,7 +117,7 @@ CLASS ltcl_dangerous IMPLEMENTATION.
lt_types = lcl_objects=>supported_list( ).
lo_repo = lcl_app=>repo_srv( )->new_online(
lo_repo = lcl_repo_srv=>get_instance( )->new_online(
iv_url = 'https://github.com/larshp/abapGit-Unit-Test.git'
iv_branch_name = 'refs/heads/master'
iv_package = c_package ).
@ -153,7 +153,7 @@ CLASS ltcl_dangerous IMPLEMENTATION.
quit = if_aunit_constants=>no ).
ENDLOOP.
lcl_app=>repo_srv( )->delete( lo_repo ).
lcl_repo_srv=>get_instance( )->delete( lo_repo ).
COMMIT WORK.

View File

@ -85,7 +85,7 @@ CLASS lcl_gui_view_repo IMPLEMENTATION.
super->constructor( ).
mo_repo = lcl_app=>repo_srv( )->get( iv_key ).
mo_repo = lcl_repo_srv=>get_instance( )->get( iv_key ).
mv_cur_dir = '/'. " Root
mv_hide_files = zcl_abapgit_persistence_user=>get_instance( )->get_hide_files( ).
mv_changes_only = zcl_abapgit_persistence_user=>get_instance( )->get_changes_only( ).
@ -138,7 +138,7 @@ CLASS lcl_gui_view_repo IMPLEMENTATION.
FIELD-SYMBOLS <ls_item> LIKE LINE OF lt_repo_items.
" Reinit, for the case of type change
mo_repo = lcl_app=>repo_srv( )->get( mo_repo->get_key( ) ).
mo_repo = lcl_repo_srv=>get_instance( )->get( mo_repo->get_key( ) ).
CREATE OBJECT ro_html.

View File

@ -376,7 +376,7 @@ CLASS lcl_zip IMPLEMENTATION.
DATA: lo_repo TYPE REF TO lcl_repo_offline.
lo_repo ?= lcl_app=>repo_srv( )->get( iv_key ).
lo_repo ?= lcl_repo_srv=>get_instance( )->get( iv_key ).
lo_repo->set_files_remote( unzip_file( file_upload( ) ) ).
lo_repo->deserialize( ).