diff --git a/cloud/zcl_abapgit_abap_language_vers.clas.testclasses.abap b/cloud/zcl_abapgit_abap_language_vers.clas.testclasses.abap index 8f17011..af3bd89 100644 --- a/cloud/zcl_abapgit_abap_language_vers.clas.testclasses.abap +++ b/cloud/zcl_abapgit_abap_language_vers.clas.testclasses.abap @@ -38,6 +38,8 @@ CLASS lcl_environment IMPLEMENTATION. ENDMETHOD. METHOD zif_abapgit_environment~is_variant_maintenance. ENDMETHOD. + METHOD zif_abapgit_environment~init_parallel_processing. + ENDMETHOD. ENDCLASS. diff --git a/cloud/zcl_abapgit_environment.clas.abap b/cloud/zcl_abapgit_environment.clas.abap index 73fd33f..d8ac6bc 100644 --- a/cloud/zcl_abapgit_environment.clas.abap +++ b/cloud/zcl_abapgit_environment.clas.abap @@ -11,6 +11,10 @@ CLASS zcl_abapgit_environment IMPLEMENTATION. ASSERT 1 = 'decoupled'. ENDMETHOD. + METHOD zif_abapgit_environment~init_parallel_processing. + ASSERT 1 = 'decoupled'. + ENDMETHOD. + METHOD zif_abapgit_environment~get_basis_release. ASSERT 1 = 'decoupled'. ENDMETHOD. diff --git a/cloud/zcl_abapgit_exit.clas.abap b/cloud/zcl_abapgit_exit.clas.abap index f20eeb0..8e9bbb6 100644 --- a/cloud/zcl_abapgit_exit.clas.abap +++ b/cloud/zcl_abapgit_exit.clas.abap @@ -1,6 +1,7 @@ CLASS zcl_abapgit_exit DEFINITION PUBLIC - CREATE PUBLIC. + CREATE PUBLIC + GLOBAL FRIENDS zcl_abapgit_injector. PUBLIC SECTION. @@ -16,6 +17,10 @@ CLASS zcl_abapgit_exit DEFINITION CLASS-DATA gi_global_exit TYPE REF TO zif_abapgit_exit. CLASS-DATA gi_exit TYPE REF TO zif_abapgit_exit. + CLASS-METHODS is_running_in_test_context + RETURNING + VALUE(rv_running_in_test_context) TYPE abap_bool. + ENDCLASS. @@ -39,10 +44,13 @@ CLASS zcl_abapgit_exit IMPLEMENTATION. lv_class_name = |\\PROGRAM={ sy-repid }\\CLASS={ lv_class_name }|. ENDIF. - TRY. - CREATE OBJECT gi_exit TYPE (lv_class_name). - CATCH cx_sy_create_object_error ##NO_HANDLER. - ENDTRY. + " Prevent non-mocked exit calls in unit tests + IF is_running_in_test_context( ) = abap_false. + TRY. + CREATE OBJECT gi_exit TYPE (lv_class_name). + CATCH cx_sy_create_object_error ##NO_HANDLER. + ENDTRY. + ENDIF. CREATE OBJECT gi_global_exit TYPE zcl_abapgit_exit. " this class @@ -50,6 +58,27 @@ CLASS zcl_abapgit_exit IMPLEMENTATION. ENDMETHOD. + METHOD is_running_in_test_context. + + IF sy-sysid = 'ABC'. + " always run on open-abap + rv_running_in_test_context = abap_true. + RETURN. + ENDIF. + + " Check if the local test class can be accessed by RTTI. If so the current process is running in a unit test. + " Note this approach only works for the developer version. The standalone version will always report not running in + " test context which should be fine as there are no unit tests delivered in it. + cl_abap_typedescr=>describe_by_name( + EXPORTING + p_name = |\\PROGRAM={ sy-repid }\\CLASS=LTCL_TEST| + EXCEPTIONS + type_not_found = 1 + OTHERS = 2 ). + rv_running_in_test_context = boolc( sy-subrc = 0 ). + + ENDMETHOD. + METHOD zif_abapgit_exit~adjust_display_commit_url. diff --git a/cloud/zcl_abapgit_exit.clas.testclasses.abap b/cloud/zcl_abapgit_exit.clas.testclasses.abap new file mode 100644 index 0000000..85f4f8c --- /dev/null +++ b/cloud/zcl_abapgit_exit.clas.testclasses.abap @@ -0,0 +1,20 @@ +*"* use this source file for your ABAP unit test classes + +CLASS ltcl_test DEFINITION DEFERRED. +CLASS zcl_abapgit_exit DEFINITION LOCAL FRIENDS ltcl_test. + +" The class name ltcl_test is hardcoded in zcl_abapgit_exit=>is_running_in_test_context + +CLASS ltcl_test DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT. + PRIVATE SECTION. + METHODS: + is_running_in_test_context FOR TESTING. +ENDCLASS. + +CLASS ltcl_test IMPLEMENTATION. + METHOD is_running_in_test_context. + cl_abap_unit_assert=>assert_equals( + act = zcl_abapgit_exit=>is_running_in_test_context( ) + exp = abap_true ). + ENDMETHOD. +ENDCLASS. diff --git a/cloud/zcl_abapgit_exit.clas.xml b/cloud/zcl_abapgit_exit.clas.xml index cff9e52..661835b 100644 --- a/cloud/zcl_abapgit_exit.clas.xml +++ b/cloud/zcl_abapgit_exit.clas.xml @@ -10,6 +10,7 @@ X X X + X diff --git a/cloud/zcl_abapgit_folder_logic.clas.abap b/cloud/zcl_abapgit_folder_logic.clas.abap index f680c98..3778ece 100644 --- a/cloud/zcl_abapgit_folder_logic.clas.abap +++ b/cloud/zcl_abapgit_folder_logic.clas.abap @@ -174,18 +174,19 @@ CLASS zcl_abapgit_folder_logic IMPLEMENTATION. DATA: lv_length TYPE i, lv_parent TYPE I_CustABAPObjDirectoryEntry-ABAPPackage, - ls_package TYPE scompkdtln, + ls_package TYPE zif_abapgit_sap_package=>ty_create, lv_new TYPE string, lv_path TYPE string, lv_absolute_name TYPE string, lv_folder_logic TYPE string, lt_unique_package_names TYPE HASHED TABLE OF I_CustABAPObjDirectoryEntry-ABAPPackage WITH UNIQUE KEY table_line. - lv_length = strlen( io_dot->get_starting_folder( ) ). + lv_length = strlen( io_dot->get_starting_folder( ) ). IF lv_length > strlen( iv_path ). * treat as not existing locally RETURN. ENDIF. + lv_path = iv_path+lv_length. lv_parent = iv_top. rv_package = iv_top. diff --git a/cloud/zcl_abapgit_folder_logic.clas.testclasses.abap b/cloud/zcl_abapgit_folder_logic.clas.testclasses.abap index 8859c82..3c0d2b7 100644 --- a/cloud/zcl_abapgit_folder_logic.clas.testclasses.abap +++ b/cloud/zcl_abapgit_folder_logic.clas.testclasses.abap @@ -104,10 +104,6 @@ CLASS ltcl_folder_logic_package IMPLEMENTATION. RETURN. ENDMETHOD. - METHOD zif_abapgit_sap_package~get_transport_layer. - RETURN. - ENDMETHOD. - METHOD zif_abapgit_sap_package~create. RETURN. ENDMETHOD. @@ -199,10 +195,6 @@ CLASS ltcl_folder_logic IMPLEMENTATION. RETURN. ENDMETHOD. - METHOD zif_abapgit_sap_package~get_transport_layer. - RETURN. - ENDMETHOD. - METHOD zif_abapgit_sap_package~create. RETURN. ENDMETHOD. @@ -417,10 +409,6 @@ CLASS ltcl_folder_logic_namespaces IMPLEMENTATION. RETURN. ENDMETHOD. - METHOD zif_abapgit_sap_package~get_transport_layer. - RETURN. - ENDMETHOD. - METHOD zif_abapgit_sap_package~create. RETURN. ENDMETHOD. @@ -560,10 +548,6 @@ CLASS ltcl_folder_logic_no_parent IMPLEMENTATION. RETURN. ENDMETHOD. - METHOD zif_abapgit_sap_package~get_transport_layer. - RETURN. - ENDMETHOD. - METHOD zif_abapgit_sap_package~create. RETURN. ENDMETHOD. diff --git a/cloud/zcl_abapgit_gui_page_db.clas.abap b/cloud/zcl_abapgit_gui_page_db.clas.abap index b84729e..2136dff 100644 --- a/cloud/zcl_abapgit_gui_page_db.clas.abap +++ b/cloud/zcl_abapgit_gui_page_db.clas.abap @@ -172,7 +172,7 @@ CLASS zcl_abapgit_gui_page_db IMPLEMENTATION. lv_zip = lo_zip->save( ). - CONCATENATE 'abapGit_Backup_' sy-datlo '_' sy-timlo INTO lv_filename. + CONCATENATE 'abapGit_Backup_' sy-datlo '_' sy-timlo '.zip' INTO lv_filename. li_fe_serv = zcl_abapgit_ui_factory=>get_frontend_services( ). diff --git a/cloud/zcl_abapgit_gui_page_flow.clas.abap b/cloud/zcl_abapgit_gui_page_flow.clas.abap index 621052f..306f336 100644 --- a/cloud/zcl_abapgit_gui_page_flow.clas.abap +++ b/cloud/zcl_abapgit_gui_page_flow.clas.abap @@ -92,6 +92,7 @@ CLASS ZCL_ABAPGIT_GUI_PAGE_FLOW IMPLEMENTATION. METHOD render_table. DATA ls_path_name LIKE LINE OF is_feature-changed_files. + DATA lo_toolbar TYPE REF TO zcl_abapgit_html_toolbar. DATA lv_status TYPE string. DATA lv_branch TYPE string. DATA lv_param TYPE string. @@ -100,8 +101,7 @@ CLASS ZCL_ABAPGIT_GUI_PAGE_FLOW IMPLEMENTATION. CREATE OBJECT ri_html TYPE zcl_abapgit_html. ri_html->add( || ). - ri_html->add( || && - || ). + ri_html->add( || ). lv_branch = is_feature-branch-display_name. IF lv_branch IS INITIAL. @@ -129,13 +129,15 @@ CLASS ZCL_ABAPGIT_GUI_PAGE_FLOW IMPLEMENTATION. ri_html->add( |
FilenameRemote SHA1Local SHA1
FilenameRemoteLocal
| ). * todo: crossout if write protected - ri_html->add( ri_html->a( - iv_txt = 'Pull' - iv_act = |{ c_action-pull }?index={ iv_index }&key={ is_feature-repo-key }| ) ). - ri_html->add( ri_html->a( - iv_txt = 'Stage' - iv_act = |{ c_action-stage }?index={ iv_index }&key={ is_feature-repo-key }&branch={ lv_branch }| ) ). - ri_html->add( |
| ). + + CREATE OBJECT lo_toolbar EXPORTING iv_id = 'toolbar-flow'. + lo_toolbar->add( iv_txt = 'Pull' + iv_act = |{ c_action-pull }?index={ iv_index }&key={ is_feature-repo-key }&branch={ lv_branch }| + iv_opt = zif_abapgit_html=>c_html_opt-strong ). + lo_toolbar->add( iv_txt = 'Stage' + iv_act = |{ c_action-stage }?index={ iv_index }&key={ is_feature-repo-key }&branch={ lv_branch }| + iv_opt = zif_abapgit_html=>c_html_opt-strong ). + ri_html->add( lo_toolbar->render( ) ). ENDMETHOD. @@ -205,17 +207,37 @@ CLASS ZCL_ABAPGIT_GUI_PAGE_FLOW IMPLEMENTATION. io_repo = lo_online ii_obj_filter = lo_filter ). - rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page. + rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page_w_bookmark. + + refresh( ). WHEN c_action-pull. lv_key = ii_event->query( )->get( 'KEY' ). lv_index = ii_event->query( )->get( 'INDEX' ). + lv_branch = ii_event->query( )->get( 'BRANCH' ). lo_online ?= zcl_abapgit_repo_srv=>get_instance( )->get( lv_key ). READ TABLE mt_features INTO ls_feature INDEX lv_index. ASSERT sy-subrc = 0. -* todo: set filter, - zcl_abapgit_services_repo=>gui_deserialize( lo_online ). + LOOP AT ls_feature-changed_objects ASSIGNING . + APPEND INITIAL LINE TO lt_filter ASSIGNING . + -object = -obj_type. + -obj_name = -obj_name. + ENDLOOP. + CREATE OBJECT lo_filter EXPORTING it_filter = lt_filter. + + set_branch( + iv_branch = lv_branch + iv_key = lv_key ). + + rs_handled-page = zcl_abapgit_gui_page_pull=>create( + io_repo = lo_online + iv_trkorr = ls_feature-transport-trkorr + ii_obj_filter = lo_filter ). + + rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page. + + refresh( ). ENDCASE. ENDMETHOD. diff --git a/cloud/zcl_abapgit_gui_page_pull.clas.abap b/cloud/zcl_abapgit_gui_page_pull.clas.abap new file mode 100644 index 0000000..fe68532 --- /dev/null +++ b/cloud/zcl_abapgit_gui_page_pull.clas.abap @@ -0,0 +1,241 @@ +CLASS zcl_abapgit_gui_page_pull DEFINITION + PUBLIC + INHERITING FROM zcl_abapgit_gui_component + FINAL + CREATE PRIVATE. + + PUBLIC SECTION. + + INTERFACES zif_abapgit_gui_event_handler. + INTERFACES zif_abapgit_gui_menu_provider. + INTERFACES zif_abapgit_gui_renderable. + + CONSTANTS: + BEGIN OF c_id, + transport_request TYPE string VALUE 'transport_request', + END OF c_id . + + CONSTANTS: BEGIN OF c_action, + pull TYPE string VALUE 'pull', + refresh TYPE string VALUE 'refresh', + choose_tr TYPE string VALUE 'choose_tr', + END OF c_action. + + CLASS-METHODS create + IMPORTING + io_repo TYPE REF TO zcl_abapgit_repo + iv_trkorr TYPE sxco_transport OPTIONAL + ii_obj_filter TYPE REF TO zif_abapgit_object_filter OPTIONAL + RETURNING + VALUE(ri_page) TYPE REF TO zif_abapgit_gui_renderable + RAISING + zcx_abapgit_exception. + + METHODS constructor + IMPORTING + io_repo TYPE REF TO zcl_abapgit_repo + iv_trkorr TYPE sxco_transport + ii_obj_filter TYPE REF TO zif_abapgit_object_filter OPTIONAL + RAISING + zcx_abapgit_exception. + + PROTECTED SECTION. + + PRIVATE SECTION. + + DATA mo_repo TYPE REF TO zcl_abapgit_repo. + DATA mi_obj_filter TYPE REF TO zif_abapgit_object_filter. + DATA mo_form_data TYPE REF TO zcl_abapgit_string_map. + DATA ms_checks TYPE zif_abapgit_definitions=>ty_deserialize_checks. + + + METHODS form + RETURNING + VALUE(ro_form) TYPE REF TO zcl_abapgit_html_form + RAISING + zcx_abapgit_exception. + + METHODS choose_transport_request + RAISING + zcx_abapgit_exception . + +ENDCLASS. + + + +CLASS ZCL_ABAPGIT_GUI_PAGE_PULL IMPLEMENTATION. + + + METHOD choose_transport_request. + + DATA lv_transport_request TYPE sxco_transport. + + lv_transport_request = zcl_abapgit_ui_factory=>get_popups( )->popup_transport_request( ). + + IF lv_transport_request IS NOT INITIAL. + mo_form_data->set( + iv_key = c_id-transport_request + iv_val = lv_transport_request ). + ENDIF. + + ENDMETHOD. + + + METHOD constructor. + + super->constructor( ). + + mo_repo = io_repo. + mi_obj_filter = ii_obj_filter. + + CREATE OBJECT mo_form_data. + mo_form_data->set( + iv_key = c_id-transport_request + iv_val = iv_trkorr ). + + ENDMETHOD. + + + METHOD create. + + DATA lo_component TYPE REF TO zcl_abapgit_gui_page_pull. + + CREATE OBJECT lo_component + EXPORTING + io_repo = io_repo + iv_trkorr = iv_trkorr + ii_obj_filter = ii_obj_filter. + + ri_page = zcl_abapgit_gui_page_hoc=>create( + iv_page_title = 'Pull' + ii_page_menu_provider = lo_component + ii_child_component = lo_component ). + + ENDMETHOD. + + + METHOD form. + + DATA lt_filter TYPE zif_abapgit_definitions=>ty_tadir_tt. + + FIELD-SYMBOLS LIKE LINE OF ms_checks-overwrite. + + + IF mi_obj_filter IS NOT INITIAL. + lt_filter = mi_obj_filter->get_filter( ). + ENDIF. + + ro_form = zcl_abapgit_html_form=>create( iv_form_id = 'pull-form' ). + + ro_form->start_group( + iv_name = 'id-objects' + iv_label = 'Objects' ). + + LOOP AT ms_checks-overwrite ASSIGNING . + IF lines( lt_filter ) > 0. + READ TABLE lt_filter WITH KEY object = -obj_type + obj_name = -obj_name TRANSPORTING NO FIELDS. + IF sy-subrc <> 0. + CONTINUE. + ENDIF. + ENDIF. + ro_form->checkbox( + iv_label = |{ -obj_type } { -obj_name }| + iv_name = |{ -obj_type }-{ -obj_name }| ). + ENDLOOP. + + ro_form->text( + iv_name = c_id-transport_request + iv_required = abap_true + iv_upper_case = abap_true + iv_side_action = c_action-choose_tr + iv_max = 10 + iv_label = |Transport Request| ). + + ro_form->command( + iv_label = 'Pull' + iv_cmd_type = zif_abapgit_html_form=>c_cmd_type-input_main + iv_action = c_action-pull + )->command( + iv_label = 'Back' + iv_action = zif_abapgit_definitions=>c_action-go_back ). + + ENDMETHOD. + + + METHOD zif_abapgit_gui_event_handler~on_event. + + DATA lo_log TYPE REF TO zcl_abapgit_log. + DATA lv_value TYPE string. + + FIELD-SYMBOLS LIKE LINE OF ms_checks-overwrite. + + + mo_form_data = ii_event->form_data( ). + + CASE ii_event->mv_action. + WHEN c_action-refresh. + mo_repo->refresh( ). + rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render. + WHEN c_action-choose_tr. + choose_transport_request( ). + rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render. + WHEN c_action-pull. + ms_checks-transport-transport = mo_form_data->get( c_id-transport_request ). + + LOOP AT ms_checks-overwrite ASSIGNING . + lv_value = mo_form_data->get( |{ -obj_type }-{ -obj_name }| ). + IF lv_value = 'on'. + -decision = zif_abapgit_definitions=>c_yes. + ELSE. + -decision = zif_abapgit_definitions=>c_no. + ENDIF. + ENDLOOP. + +* todo, show log? + CREATE OBJECT lo_log. + mo_repo->deserialize( + is_checks = ms_checks + ii_log = lo_log ). + + rs_handled-state = zcl_abapgit_gui=>c_event_state-go_back. + ENDCASE. + + ENDMETHOD. + + + METHOD zif_abapgit_gui_menu_provider~get_menu. + + CREATE OBJECT ro_toolbar EXPORTING iv_id = 'toolbar-main'. + + ro_toolbar->add( + iv_txt = 'Refresh' + iv_act = c_action-refresh ). + + ro_toolbar->add( + iv_txt = 'Back' + iv_act = zif_abapgit_definitions=>c_action-go_back ). + + ENDMETHOD. + + + METHOD zif_abapgit_gui_renderable~render. + + register_handlers( ). + + CREATE OBJECT ri_html TYPE zcl_abapgit_html. + ri_html->add( '
' ). + + ms_checks = mo_repo->deserialize_checks( ). + + IF lines( ms_checks-overwrite ) = 0. + zcx_abapgit_exception=>raise( + 'There is nothing to pull. The local state completely matches the remote repository.' ). + ENDIF. + + ri_html->add( form( )->render( mo_form_data ) ). + + ri_html->add( '
' ). + + ENDMETHOD. +ENDCLASS. diff --git a/cloud/zcl_abapgit_gui_page_pull.clas.xml b/cloud/zcl_abapgit_gui_page_pull.clas.xml new file mode 100644 index 0000000..8524558 --- /dev/null +++ b/cloud/zcl_abapgit_gui_page_pull.clas.xml @@ -0,0 +1,16 @@ + + + + + + ZCL_ABAPGIT_GUI_PAGE_PULL + E + abapGit - GUI Pull + 1 + X + X + X + + + + diff --git a/cloud/zcl_abapgit_gui_page_repo_over.clas.abap b/cloud/zcl_abapgit_gui_page_repo_over.clas.abap index 7218b79..3b4c996 100644 --- a/cloud/zcl_abapgit_gui_page_repo_over.clas.abap +++ b/cloud/zcl_abapgit_gui_page_repo_over.clas.abap @@ -761,8 +761,9 @@ CLASS zcl_abapgit_gui_page_repo_over IMPLEMENTATION. IF mt_all_labels IS NOT INITIAL. ii_html->td( iv_content = zcl_abapgit_gui_chunk_lib=>render_label_list( - it_labels = is_repo-labels - io_label_colors = mo_label_colors ) + it_labels = is_repo-labels + io_label_colors = mo_label_colors + iv_clickable_action = c_action-label_filter ) iv_class = 'labels' ). ENDIF. diff --git a/cloud/zcl_abapgit_gui_page_sett_locl.clas.abap b/cloud/zcl_abapgit_gui_page_sett_locl.clas.abap index 18c3823..d4585d8 100644 --- a/cloud/zcl_abapgit_gui_page_sett_locl.clas.abap +++ b/cloud/zcl_abapgit_gui_page_sett_locl.clas.abap @@ -274,7 +274,8 @@ CLASS zcl_abapgit_gui_page_sett_locl IMPLEMENTATION. iv_label = 'Only Serialize Main Language' iv_hint = 'Ignore translations; serialize only main language of repository' ). - IF zcl_abapgit_feature=>is_enabled( 'FLOW' ) = abap_true. + IF zcl_abapgit_feature=>is_enabled( 'FLOW' ) = abap_true + AND li_package->are_changes_recorded_in_tr_req( ) = abap_true. ro_form->checkbox( iv_name = c_id-flow iv_label = 'Enable Flow Page' ). diff --git a/cloud/zcl_abapgit_gui_page_sett_remo.clas.abap b/cloud/zcl_abapgit_gui_page_sett_remo.clas.abap index 58672cb..2dac5e8 100644 --- a/cloud/zcl_abapgit_gui_page_sett_remo.clas.abap +++ b/cloud/zcl_abapgit_gui_page_sett_remo.clas.abap @@ -846,12 +846,6 @@ CLASS zcl_abapgit_gui_page_sett_remo IMPLEMENTATION. lv_offline = io_form_data->get( c_id-offline ). lv_url = io_form_data->get( c_id-url ). - IF lv_offline = abap_true AND lv_url IS INITIAL. - ro_validation_log->set( - iv_key = c_id-url - iv_val = 'Enter a name for the repository and save' ). - ENDIF. - IF lv_offline = abap_false AND lv_url NP 'http*'. ro_validation_log->set( iv_key = c_id-url diff --git a/cloud/zcl_abapgit_gui_router.clas.abap b/cloud/zcl_abapgit_gui_router.clas.abap index af30fbd..5cc2b10 100644 --- a/cloud/zcl_abapgit_gui_router.clas.abap +++ b/cloud/zcl_abapgit_gui_router.clas.abap @@ -189,7 +189,7 @@ CLASS zcl_abapgit_gui_router IMPLEMENTATION. lv_package = iv_package. TRANSLATE lv_package USING '/#'. - CONCATENATE lv_package '_' sy-datlo '_' sy-timlo INTO lv_default. + CONCATENATE lv_package '_' sy-datlo '_' sy-timlo '.zip' INTO lv_default. li_fe_serv = zcl_abapgit_ui_factory=>get_frontend_services( ). diff --git a/cloud/zcl_abapgit_injector.clas.abap b/cloud/zcl_abapgit_injector.clas.abap index a423e55..acaef43 100644 --- a/cloud/zcl_abapgit_injector.clas.abap +++ b/cloud/zcl_abapgit_injector.clas.abap @@ -42,6 +42,9 @@ CLASS zcl_abapgit_injector DEFINITION CLASS-METHODS set_function_module IMPORTING ii_function_module TYPE REF TO zif_abapgit_function_module. + CLASS-METHODS set_exit + IMPORTING + ii_exit TYPE REF TO zif_abapgit_exit. PROTECTED SECTION. PRIVATE SECTION. @@ -146,9 +149,12 @@ CLASS zcl_abapgit_injector IMPLEMENTATION. METHOD set_function_module. - zcl_abapgit_factory=>gi_function_module = ii_function_module. + ENDMETHOD. + + METHOD set_exit. + zcl_abapgit_exit=>gi_global_exit = ii_exit. ENDMETHOD. ENDCLASS. diff --git a/cloud/zcl_abapgit_sap_package.clas.abap b/cloud/zcl_abapgit_sap_package.clas.abap index 96acc14..70eecbe 100644 --- a/cloud/zcl_abapgit_sap_package.clas.abap +++ b/cloud/zcl_abapgit_sap_package.clas.abap @@ -44,10 +44,6 @@ CLASS zcl_abapgit_sap_package IMPLEMENTATION. rv_bool = abap_false. ENDMETHOD. - METHOD zif_abapgit_sap_package~get_transport_layer. - ASSERT 1 = 'decoupled'. - ENDMETHOD. - METHOD zif_abapgit_sap_package~get_transport_type. ASSERT 1 = 'decoupled'. ENDMETHOD. diff --git a/cloud/zcl_abapgit_services_repo.clas.abap b/cloud/zcl_abapgit_services_repo.clas.abap index d472040..16dcb60 100644 --- a/cloud/zcl_abapgit_services_repo.clas.abap +++ b/cloud/zcl_abapgit_services_repo.clas.abap @@ -262,7 +262,7 @@ CLASS zcl_abapgit_services_repo IMPLEMENTATION. METHOD create_package. - DATA ls_package_data TYPE scompkdtln. + DATA ls_package_data TYPE zif_abapgit_sap_package=>ty_create. DATA lv_create TYPE abap_bool. DATA li_popup TYPE REF TO zif_abapgit_popups. diff --git a/cloud/zcl_abapgit_services_repo.clas.testclasses.abap b/cloud/zcl_abapgit_services_repo.clas.testclasses.abap index 75d023c..4312caf 100644 --- a/cloud/zcl_abapgit_services_repo.clas.testclasses.abap +++ b/cloud/zcl_abapgit_services_repo.clas.testclasses.abap @@ -320,10 +320,6 @@ CLASS ltcl_sap_package_mock IMPLEMENTATION. ENDMETHOD. - METHOD zif_abapgit_sap_package~get_transport_layer. - - ENDMETHOD. - METHOD zif_abapgit_sap_package~list_subpackages. ENDMETHOD. diff --git a/cloud/zcl_abapgit_zip.clas.abap b/cloud/zcl_abapgit_zip.clas.abap index 5d901e8..e249832 100644 --- a/cloud/zcl_abapgit_zip.clas.abap +++ b/cloud/zcl_abapgit_zip.clas.abap @@ -78,7 +78,7 @@ ENDCLASS. -CLASS ZCL_ABAPGIT_ZIP IMPLEMENTATION. +CLASS zcl_abapgit_zip IMPLEMENTATION. METHOD encode_files. @@ -210,7 +210,7 @@ CLASS ZCL_ABAPGIT_ZIP IMPLEMENTATION. lv_package_escaped = iv_package. REPLACE ALL OCCURRENCES OF '/' IN lv_package_escaped WITH '#'. - lv_default = |{ lv_package_escaped }_{ sy-datlo }_{ sy-timlo }|. + lv_default = |{ lv_package_escaped }_{ sy-datlo }_{ sy-timlo }.zip|. lv_zip_xstring = export( is_local_settings = ls_local_settings diff --git a/cloud/zif_abapgit_apack_definitions.intf.abap b/cloud/zif_abapgit_apack_definitions.intf.abap index b47f1ad..5f4e816 100644 --- a/cloud/zif_abapgit_apack_definitions.intf.abap +++ b/cloud/zif_abapgit_apack_definitions.intf.abap @@ -36,5 +36,5 @@ INTERFACE zif_abapgit_apack_definitions PUBLIC . CONSTANTS c_repository_type_abapgit TYPE ty_repository_type VALUE 'abapGit' ##NO_TEXT. CONSTANTS c_apack_interface_sap TYPE char30 VALUE 'IF_APACK_MANIFEST' ##NO_TEXT. CONSTANTS c_apack_interface_cust TYPE char30 VALUE 'ZIF_APACK_MANIFEST' ##NO_TEXT. - CONSTANTS c_apack_interface_nspc TYPE char30 VALUE '/%/IF_APACK_MANIFEST' ##NO_TEXT. + CONSTANTS c_apack_interface_nspc TYPE char30 VALUE '/*/IF_APACK_MANIFEST' ##NO_TEXT. ENDINTERFACE. diff --git a/cloud/zif_abapgit_environment.intf.abap b/cloud/zif_abapgit_environment.intf.abap index 840a630..6fcaa06 100644 --- a/cloud/zif_abapgit_environment.intf.abap +++ b/cloud/zif_abapgit_environment.intf.abap @@ -34,4 +34,10 @@ INTERFACE zif_abapgit_environment METHODS is_variant_maintenance RETURNING VALUE(rv_is_variant_maintenance) TYPE abap_bool. + METHODS init_parallel_processing + IMPORTING + iv_group TYPE clike + RETURNING + VALUE(rv_free_work_processes) TYPE i. + ENDINTERFACE. diff --git a/cloud/zif_abapgit_popups.intf.abap b/cloud/zif_abapgit_popups.intf.abap index 72926a2..3d26f77 100644 --- a/cloud/zif_abapgit_popups.intf.abap +++ b/cloud/zif_abapgit_popups.intf.abap @@ -105,7 +105,7 @@ TYPES sci_chkv TYPE c LENGTH 1. zcx_abapgit_exception . METHODS popup_to_create_package EXPORTING - !es_package_data TYPE scompkdtln + !es_package_data TYPE zif_abapgit_sap_package=>ty_create !ev_create TYPE abap_bool RAISING zcx_abapgit_exception . diff --git a/cloud/zif_abapgit_sap_package.intf.abap b/cloud/zif_abapgit_sap_package.intf.abap index dfa06c0..4d948ee 100644 --- a/cloud/zif_abapgit_sap_package.intf.abap +++ b/cloud/zif_abapgit_sap_package.intf.abap @@ -9,12 +9,22 @@ TYPES: BEGIN OF scompkdtln, TYPES: ty_devclass_tt TYPE STANDARD TABLE OF I_CustABAPObjDirectoryEntry-ABAPPackage WITH DEFAULT KEY . + TYPES: BEGIN OF ty_create, + devclass TYPE I_CustABAPObjDirectoryEntry-ABAPPackage, + dlvunit TYPE c LENGTH 30, + component TYPE c LENGTH 20, + ctext TYPE c LENGTH 60, + parentcl TYPE I_CustABAPObjDirectoryEntry-ABAPPackage, + pdevclass TYPE c LENGTH 4, + as4user TYPE usnam, + END OF ty_create. + METHODS validate_name RAISING zcx_abapgit_exception . METHODS create IMPORTING - !is_package TYPE scompkdtln + !is_package TYPE ty_create RAISING zcx_abapgit_exception . METHODS create_local @@ -61,9 +71,4 @@ TYPES: BEGIN OF scompkdtln, VALUE(rs_transport_type) TYPE zif_abapgit_definitions=>ty_transport_type RAISING zcx_abapgit_exception . - METHODS get_transport_layer - RETURNING - VALUE(rv_transport_layer) TYPE char4 - RAISING - zcx_abapgit_exception . ENDINTERFACE. diff --git a/cloud/zif_abapgit_version.intf.abap b/cloud/zif_abapgit_version.intf.abap index e51ddc7..78cb661 100644 --- a/cloud/zif_abapgit_version.intf.abap +++ b/cloud/zif_abapgit_version.intf.abap @@ -2,6 +2,6 @@ INTERFACE zif_abapgit_version PUBLIC . CONSTANTS c_xml_version TYPE string VALUE 'v1.0.0' ##NO_TEXT. - CONSTANTS c_abap_version TYPE string VALUE '1.125.0' ##NO_TEXT. + CONSTANTS c_abap_version TYPE string VALUE '1.126.0' ##NO_TEXT. ENDINTERFACE. diff --git a/open/zcl_abapgit_environment.clas.abap b/open/zcl_abapgit_environment.clas.abap index 73fd33f..d8ac6bc 100644 --- a/open/zcl_abapgit_environment.clas.abap +++ b/open/zcl_abapgit_environment.clas.abap @@ -11,6 +11,10 @@ CLASS zcl_abapgit_environment IMPLEMENTATION. ASSERT 1 = 'decoupled'. ENDMETHOD. + METHOD zif_abapgit_environment~init_parallel_processing. + ASSERT 1 = 'decoupled'. + ENDMETHOD. + METHOD zif_abapgit_environment~get_basis_release. ASSERT 1 = 'decoupled'. ENDMETHOD. diff --git a/open/zcl_abapgit_exit.clas.abap b/open/zcl_abapgit_exit.clas.abap index f20eeb0..8e9bbb6 100644 --- a/open/zcl_abapgit_exit.clas.abap +++ b/open/zcl_abapgit_exit.clas.abap @@ -1,6 +1,7 @@ CLASS zcl_abapgit_exit DEFINITION PUBLIC - CREATE PUBLIC. + CREATE PUBLIC + GLOBAL FRIENDS zcl_abapgit_injector. PUBLIC SECTION. @@ -16,6 +17,10 @@ CLASS zcl_abapgit_exit DEFINITION CLASS-DATA gi_global_exit TYPE REF TO zif_abapgit_exit. CLASS-DATA gi_exit TYPE REF TO zif_abapgit_exit. + CLASS-METHODS is_running_in_test_context + RETURNING + VALUE(rv_running_in_test_context) TYPE abap_bool. + ENDCLASS. @@ -39,10 +44,13 @@ CLASS zcl_abapgit_exit IMPLEMENTATION. lv_class_name = |\\PROGRAM={ sy-repid }\\CLASS={ lv_class_name }|. ENDIF. - TRY. - CREATE OBJECT gi_exit TYPE (lv_class_name). - CATCH cx_sy_create_object_error ##NO_HANDLER. - ENDTRY. + " Prevent non-mocked exit calls in unit tests + IF is_running_in_test_context( ) = abap_false. + TRY. + CREATE OBJECT gi_exit TYPE (lv_class_name). + CATCH cx_sy_create_object_error ##NO_HANDLER. + ENDTRY. + ENDIF. CREATE OBJECT gi_global_exit TYPE zcl_abapgit_exit. " this class @@ -50,6 +58,27 @@ CLASS zcl_abapgit_exit IMPLEMENTATION. ENDMETHOD. + METHOD is_running_in_test_context. + + IF sy-sysid = 'ABC'. + " always run on open-abap + rv_running_in_test_context = abap_true. + RETURN. + ENDIF. + + " Check if the local test class can be accessed by RTTI. If so the current process is running in a unit test. + " Note this approach only works for the developer version. The standalone version will always report not running in + " test context which should be fine as there are no unit tests delivered in it. + cl_abap_typedescr=>describe_by_name( + EXPORTING + p_name = |\\PROGRAM={ sy-repid }\\CLASS=LTCL_TEST| + EXCEPTIONS + type_not_found = 1 + OTHERS = 2 ). + rv_running_in_test_context = boolc( sy-subrc = 0 ). + + ENDMETHOD. + METHOD zif_abapgit_exit~adjust_display_commit_url. diff --git a/open/zcl_abapgit_exit.clas.testclasses.abap b/open/zcl_abapgit_exit.clas.testclasses.abap new file mode 100644 index 0000000..85f4f8c --- /dev/null +++ b/open/zcl_abapgit_exit.clas.testclasses.abap @@ -0,0 +1,20 @@ +*"* use this source file for your ABAP unit test classes + +CLASS ltcl_test DEFINITION DEFERRED. +CLASS zcl_abapgit_exit DEFINITION LOCAL FRIENDS ltcl_test. + +" The class name ltcl_test is hardcoded in zcl_abapgit_exit=>is_running_in_test_context + +CLASS ltcl_test DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT. + PRIVATE SECTION. + METHODS: + is_running_in_test_context FOR TESTING. +ENDCLASS. + +CLASS ltcl_test IMPLEMENTATION. + METHOD is_running_in_test_context. + cl_abap_unit_assert=>assert_equals( + act = zcl_abapgit_exit=>is_running_in_test_context( ) + exp = abap_true ). + ENDMETHOD. +ENDCLASS. diff --git a/open/zcl_abapgit_exit.clas.xml b/open/zcl_abapgit_exit.clas.xml index cff9e52..661835b 100644 --- a/open/zcl_abapgit_exit.clas.xml +++ b/open/zcl_abapgit_exit.clas.xml @@ -10,6 +10,7 @@ X X X + X diff --git a/open/zcl_abapgit_folder_logic.clas.abap b/open/zcl_abapgit_folder_logic.clas.abap index d73b39a..db1e164 100644 --- a/open/zcl_abapgit_folder_logic.clas.abap +++ b/open/zcl_abapgit_folder_logic.clas.abap @@ -174,18 +174,19 @@ CLASS zcl_abapgit_folder_logic IMPLEMENTATION. DATA: lv_length TYPE i, lv_parent TYPE devclass, - ls_package TYPE scompkdtln, + ls_package TYPE zif_abapgit_sap_package=>ty_create, lv_new TYPE string, lv_path TYPE string, lv_absolute_name TYPE string, lv_folder_logic TYPE string, lt_unique_package_names TYPE HASHED TABLE OF devclass WITH UNIQUE KEY table_line. - lv_length = strlen( io_dot->get_starting_folder( ) ). + lv_length = strlen( io_dot->get_starting_folder( ) ). IF lv_length > strlen( iv_path ). * treat as not existing locally RETURN. ENDIF. + lv_path = iv_path+lv_length. lv_parent = iv_top. rv_package = iv_top. diff --git a/open/zcl_abapgit_folder_logic.clas.testclasses.abap b/open/zcl_abapgit_folder_logic.clas.testclasses.abap index d4d6d41..d9bb1bc 100644 --- a/open/zcl_abapgit_folder_logic.clas.testclasses.abap +++ b/open/zcl_abapgit_folder_logic.clas.testclasses.abap @@ -104,10 +104,6 @@ CLASS ltcl_folder_logic_package IMPLEMENTATION. RETURN. ENDMETHOD. - METHOD zif_abapgit_sap_package~get_transport_layer. - RETURN. - ENDMETHOD. - METHOD zif_abapgit_sap_package~create. RETURN. ENDMETHOD. @@ -199,10 +195,6 @@ CLASS ltcl_folder_logic IMPLEMENTATION. RETURN. ENDMETHOD. - METHOD zif_abapgit_sap_package~get_transport_layer. - RETURN. - ENDMETHOD. - METHOD zif_abapgit_sap_package~create. RETURN. ENDMETHOD. @@ -417,10 +409,6 @@ CLASS ltcl_folder_logic_namespaces IMPLEMENTATION. RETURN. ENDMETHOD. - METHOD zif_abapgit_sap_package~get_transport_layer. - RETURN. - ENDMETHOD. - METHOD zif_abapgit_sap_package~create. RETURN. ENDMETHOD. @@ -560,10 +548,6 @@ CLASS ltcl_folder_logic_no_parent IMPLEMENTATION. RETURN. ENDMETHOD. - METHOD zif_abapgit_sap_package~get_transport_layer. - RETURN. - ENDMETHOD. - METHOD zif_abapgit_sap_package~create. RETURN. ENDMETHOD. diff --git a/open/zcl_abapgit_gui_page_db.clas.abap b/open/zcl_abapgit_gui_page_db.clas.abap index 3b5f7b7..509842c 100644 --- a/open/zcl_abapgit_gui_page_db.clas.abap +++ b/open/zcl_abapgit_gui_page_db.clas.abap @@ -172,7 +172,7 @@ CLASS zcl_abapgit_gui_page_db IMPLEMENTATION. lv_zip = lo_zip->save( ). - CONCATENATE 'abapGit_Backup_' sy-datlo '_' sy-timlo INTO lv_filename. + CONCATENATE 'abapGit_Backup_' sy-datlo '_' sy-timlo '.zip' INTO lv_filename. li_fe_serv = zcl_abapgit_ui_factory=>get_frontend_services( ). diff --git a/open/zcl_abapgit_gui_page_flow.clas.abap b/open/zcl_abapgit_gui_page_flow.clas.abap index 621052f..306f336 100644 --- a/open/zcl_abapgit_gui_page_flow.clas.abap +++ b/open/zcl_abapgit_gui_page_flow.clas.abap @@ -92,6 +92,7 @@ CLASS ZCL_ABAPGIT_GUI_PAGE_FLOW IMPLEMENTATION. METHOD render_table. DATA ls_path_name LIKE LINE OF is_feature-changed_files. + DATA lo_toolbar TYPE REF TO zcl_abapgit_html_toolbar. DATA lv_status TYPE string. DATA lv_branch TYPE string. DATA lv_param TYPE string. @@ -100,8 +101,7 @@ CLASS ZCL_ABAPGIT_GUI_PAGE_FLOW IMPLEMENTATION. CREATE OBJECT ri_html TYPE zcl_abapgit_html. ri_html->add( || ). - ri_html->add( || && - || ). + ri_html->add( || ). lv_branch = is_feature-branch-display_name. IF lv_branch IS INITIAL. @@ -129,13 +129,15 @@ CLASS ZCL_ABAPGIT_GUI_PAGE_FLOW IMPLEMENTATION. ri_html->add( |
FilenameRemote SHA1Local SHA1
FilenameRemoteLocal
| ). * todo: crossout if write protected - ri_html->add( ri_html->a( - iv_txt = 'Pull' - iv_act = |{ c_action-pull }?index={ iv_index }&key={ is_feature-repo-key }| ) ). - ri_html->add( ri_html->a( - iv_txt = 'Stage' - iv_act = |{ c_action-stage }?index={ iv_index }&key={ is_feature-repo-key }&branch={ lv_branch }| ) ). - ri_html->add( |
| ). + + CREATE OBJECT lo_toolbar EXPORTING iv_id = 'toolbar-flow'. + lo_toolbar->add( iv_txt = 'Pull' + iv_act = |{ c_action-pull }?index={ iv_index }&key={ is_feature-repo-key }&branch={ lv_branch }| + iv_opt = zif_abapgit_html=>c_html_opt-strong ). + lo_toolbar->add( iv_txt = 'Stage' + iv_act = |{ c_action-stage }?index={ iv_index }&key={ is_feature-repo-key }&branch={ lv_branch }| + iv_opt = zif_abapgit_html=>c_html_opt-strong ). + ri_html->add( lo_toolbar->render( ) ). ENDMETHOD. @@ -205,17 +207,37 @@ CLASS ZCL_ABAPGIT_GUI_PAGE_FLOW IMPLEMENTATION. io_repo = lo_online ii_obj_filter = lo_filter ). - rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page. + rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page_w_bookmark. + + refresh( ). WHEN c_action-pull. lv_key = ii_event->query( )->get( 'KEY' ). lv_index = ii_event->query( )->get( 'INDEX' ). + lv_branch = ii_event->query( )->get( 'BRANCH' ). lo_online ?= zcl_abapgit_repo_srv=>get_instance( )->get( lv_key ). READ TABLE mt_features INTO ls_feature INDEX lv_index. ASSERT sy-subrc = 0. -* todo: set filter, - zcl_abapgit_services_repo=>gui_deserialize( lo_online ). + LOOP AT ls_feature-changed_objects ASSIGNING . + APPEND INITIAL LINE TO lt_filter ASSIGNING . + -object = -obj_type. + -obj_name = -obj_name. + ENDLOOP. + CREATE OBJECT lo_filter EXPORTING it_filter = lt_filter. + + set_branch( + iv_branch = lv_branch + iv_key = lv_key ). + + rs_handled-page = zcl_abapgit_gui_page_pull=>create( + io_repo = lo_online + iv_trkorr = ls_feature-transport-trkorr + ii_obj_filter = lo_filter ). + + rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page. + + refresh( ). ENDCASE. ENDMETHOD. diff --git a/open/zcl_abapgit_gui_page_pull.clas.abap b/open/zcl_abapgit_gui_page_pull.clas.abap new file mode 100644 index 0000000..119e308 --- /dev/null +++ b/open/zcl_abapgit_gui_page_pull.clas.abap @@ -0,0 +1,241 @@ +CLASS zcl_abapgit_gui_page_pull DEFINITION + PUBLIC + INHERITING FROM zcl_abapgit_gui_component + FINAL + CREATE PRIVATE. + + PUBLIC SECTION. + + INTERFACES zif_abapgit_gui_event_handler. + INTERFACES zif_abapgit_gui_menu_provider. + INTERFACES zif_abapgit_gui_renderable. + + CONSTANTS: + BEGIN OF c_id, + transport_request TYPE string VALUE 'transport_request', + END OF c_id . + + CONSTANTS: BEGIN OF c_action, + pull TYPE string VALUE 'pull', + refresh TYPE string VALUE 'refresh', + choose_tr TYPE string VALUE 'choose_tr', + END OF c_action. + + CLASS-METHODS create + IMPORTING + io_repo TYPE REF TO zcl_abapgit_repo + iv_trkorr TYPE trkorr OPTIONAL + ii_obj_filter TYPE REF TO zif_abapgit_object_filter OPTIONAL + RETURNING + VALUE(ri_page) TYPE REF TO zif_abapgit_gui_renderable + RAISING + zcx_abapgit_exception. + + METHODS constructor + IMPORTING + io_repo TYPE REF TO zcl_abapgit_repo + iv_trkorr TYPE trkorr + ii_obj_filter TYPE REF TO zif_abapgit_object_filter OPTIONAL + RAISING + zcx_abapgit_exception. + + PROTECTED SECTION. + + PRIVATE SECTION. + + DATA mo_repo TYPE REF TO zcl_abapgit_repo. + DATA mi_obj_filter TYPE REF TO zif_abapgit_object_filter. + DATA mo_form_data TYPE REF TO zcl_abapgit_string_map. + DATA ms_checks TYPE zif_abapgit_definitions=>ty_deserialize_checks. + + + METHODS form + RETURNING + VALUE(ro_form) TYPE REF TO zcl_abapgit_html_form + RAISING + zcx_abapgit_exception. + + METHODS choose_transport_request + RAISING + zcx_abapgit_exception . + +ENDCLASS. + + + +CLASS ZCL_ABAPGIT_GUI_PAGE_PULL IMPLEMENTATION. + + + METHOD choose_transport_request. + + DATA lv_transport_request TYPE trkorr. + + lv_transport_request = zcl_abapgit_ui_factory=>get_popups( )->popup_transport_request( ). + + IF lv_transport_request IS NOT INITIAL. + mo_form_data->set( + iv_key = c_id-transport_request + iv_val = lv_transport_request ). + ENDIF. + + ENDMETHOD. + + + METHOD constructor. + + super->constructor( ). + + mo_repo = io_repo. + mi_obj_filter = ii_obj_filter. + + CREATE OBJECT mo_form_data. + mo_form_data->set( + iv_key = c_id-transport_request + iv_val = iv_trkorr ). + + ENDMETHOD. + + + METHOD create. + + DATA lo_component TYPE REF TO zcl_abapgit_gui_page_pull. + + CREATE OBJECT lo_component + EXPORTING + io_repo = io_repo + iv_trkorr = iv_trkorr + ii_obj_filter = ii_obj_filter. + + ri_page = zcl_abapgit_gui_page_hoc=>create( + iv_page_title = 'Pull' + ii_page_menu_provider = lo_component + ii_child_component = lo_component ). + + ENDMETHOD. + + + METHOD form. + + DATA lt_filter TYPE zif_abapgit_definitions=>ty_tadir_tt. + + FIELD-SYMBOLS LIKE LINE OF ms_checks-overwrite. + + + IF mi_obj_filter IS NOT INITIAL. + lt_filter = mi_obj_filter->get_filter( ). + ENDIF. + + ro_form = zcl_abapgit_html_form=>create( iv_form_id = 'pull-form' ). + + ro_form->start_group( + iv_name = 'id-objects' + iv_label = 'Objects' ). + + LOOP AT ms_checks-overwrite ASSIGNING . + IF lines( lt_filter ) > 0. + READ TABLE lt_filter WITH KEY object = -obj_type + obj_name = -obj_name TRANSPORTING NO FIELDS. + IF sy-subrc <> 0. + CONTINUE. + ENDIF. + ENDIF. + ro_form->checkbox( + iv_label = |{ -obj_type } { -obj_name }| + iv_name = |{ -obj_type }-{ -obj_name }| ). + ENDLOOP. + + ro_form->text( + iv_name = c_id-transport_request + iv_required = abap_true + iv_upper_case = abap_true + iv_side_action = c_action-choose_tr + iv_max = 10 + iv_label = |Transport Request| ). + + ro_form->command( + iv_label = 'Pull' + iv_cmd_type = zif_abapgit_html_form=>c_cmd_type-input_main + iv_action = c_action-pull + )->command( + iv_label = 'Back' + iv_action = zif_abapgit_definitions=>c_action-go_back ). + + ENDMETHOD. + + + METHOD zif_abapgit_gui_event_handler~on_event. + + DATA lo_log TYPE REF TO zcl_abapgit_log. + DATA lv_value TYPE string. + + FIELD-SYMBOLS LIKE LINE OF ms_checks-overwrite. + + + mo_form_data = ii_event->form_data( ). + + CASE ii_event->mv_action. + WHEN c_action-refresh. + mo_repo->refresh( ). + rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render. + WHEN c_action-choose_tr. + choose_transport_request( ). + rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render. + WHEN c_action-pull. + ms_checks-transport-transport = mo_form_data->get( c_id-transport_request ). + + LOOP AT ms_checks-overwrite ASSIGNING . + lv_value = mo_form_data->get( |{ -obj_type }-{ -obj_name }| ). + IF lv_value = 'on'. + -decision = zif_abapgit_definitions=>c_yes. + ELSE. + -decision = zif_abapgit_definitions=>c_no. + ENDIF. + ENDLOOP. + +* todo, show log? + CREATE OBJECT lo_log. + mo_repo->deserialize( + is_checks = ms_checks + ii_log = lo_log ). + + rs_handled-state = zcl_abapgit_gui=>c_event_state-go_back. + ENDCASE. + + ENDMETHOD. + + + METHOD zif_abapgit_gui_menu_provider~get_menu. + + CREATE OBJECT ro_toolbar EXPORTING iv_id = 'toolbar-main'. + + ro_toolbar->add( + iv_txt = 'Refresh' + iv_act = c_action-refresh ). + + ro_toolbar->add( + iv_txt = 'Back' + iv_act = zif_abapgit_definitions=>c_action-go_back ). + + ENDMETHOD. + + + METHOD zif_abapgit_gui_renderable~render. + + register_handlers( ). + + CREATE OBJECT ri_html TYPE zcl_abapgit_html. + ri_html->add( '
' ). + + ms_checks = mo_repo->deserialize_checks( ). + + IF lines( ms_checks-overwrite ) = 0. + zcx_abapgit_exception=>raise( + 'There is nothing to pull. The local state completely matches the remote repository.' ). + ENDIF. + + ri_html->add( form( )->render( mo_form_data ) ). + + ri_html->add( '
' ). + + ENDMETHOD. +ENDCLASS. diff --git a/open/zcl_abapgit_gui_page_pull.clas.xml b/open/zcl_abapgit_gui_page_pull.clas.xml new file mode 100644 index 0000000..8524558 --- /dev/null +++ b/open/zcl_abapgit_gui_page_pull.clas.xml @@ -0,0 +1,16 @@ + + + + + + ZCL_ABAPGIT_GUI_PAGE_PULL + E + abapGit - GUI Pull + 1 + X + X + X + + + + diff --git a/open/zcl_abapgit_gui_page_repo_over.clas.abap b/open/zcl_abapgit_gui_page_repo_over.clas.abap index c4ee2ba..79764ae 100644 --- a/open/zcl_abapgit_gui_page_repo_over.clas.abap +++ b/open/zcl_abapgit_gui_page_repo_over.clas.abap @@ -761,8 +761,9 @@ CLASS zcl_abapgit_gui_page_repo_over IMPLEMENTATION. IF mt_all_labels IS NOT INITIAL. ii_html->td( iv_content = zcl_abapgit_gui_chunk_lib=>render_label_list( - it_labels = is_repo-labels - io_label_colors = mo_label_colors ) + it_labels = is_repo-labels + io_label_colors = mo_label_colors + iv_clickable_action = c_action-label_filter ) iv_class = 'labels' ). ENDIF. diff --git a/open/zcl_abapgit_gui_page_sett_locl.clas.abap b/open/zcl_abapgit_gui_page_sett_locl.clas.abap index a5dce06..fc25649 100644 --- a/open/zcl_abapgit_gui_page_sett_locl.clas.abap +++ b/open/zcl_abapgit_gui_page_sett_locl.clas.abap @@ -274,7 +274,8 @@ CLASS zcl_abapgit_gui_page_sett_locl IMPLEMENTATION. iv_label = 'Only Serialize Main Language' iv_hint = 'Ignore translations; serialize only main language of repository' ). - IF zcl_abapgit_feature=>is_enabled( 'FLOW' ) = abap_true. + IF zcl_abapgit_feature=>is_enabled( 'FLOW' ) = abap_true + AND li_package->are_changes_recorded_in_tr_req( ) = abap_true. ro_form->checkbox( iv_name = c_id-flow iv_label = 'Enable Flow Page' ). diff --git a/open/zcl_abapgit_gui_page_sett_remo.clas.abap b/open/zcl_abapgit_gui_page_sett_remo.clas.abap index 72d677c..aa47b3c 100644 --- a/open/zcl_abapgit_gui_page_sett_remo.clas.abap +++ b/open/zcl_abapgit_gui_page_sett_remo.clas.abap @@ -846,12 +846,6 @@ CLASS zcl_abapgit_gui_page_sett_remo IMPLEMENTATION. lv_offline = io_form_data->get( c_id-offline ). lv_url = io_form_data->get( c_id-url ). - IF lv_offline = abap_true AND lv_url IS INITIAL. - ro_validation_log->set( - iv_key = c_id-url - iv_val = 'Enter a name for the repository and save' ). - ENDIF. - IF lv_offline = abap_false AND lv_url NP 'http*'. ro_validation_log->set( iv_key = c_id-url diff --git a/open/zcl_abapgit_gui_router.clas.abap b/open/zcl_abapgit_gui_router.clas.abap index 3625eae..5f05c33 100644 --- a/open/zcl_abapgit_gui_router.clas.abap +++ b/open/zcl_abapgit_gui_router.clas.abap @@ -189,7 +189,7 @@ CLASS zcl_abapgit_gui_router IMPLEMENTATION. lv_package = iv_package. TRANSLATE lv_package USING '/#'. - CONCATENATE lv_package '_' sy-datlo '_' sy-timlo INTO lv_default. + CONCATENATE lv_package '_' sy-datlo '_' sy-timlo '.zip' INTO lv_default. li_fe_serv = zcl_abapgit_ui_factory=>get_frontend_services( ). diff --git a/open/zcl_abapgit_injector.clas.abap b/open/zcl_abapgit_injector.clas.abap index bf20227..c1848cb 100644 --- a/open/zcl_abapgit_injector.clas.abap +++ b/open/zcl_abapgit_injector.clas.abap @@ -42,6 +42,9 @@ CLASS zcl_abapgit_injector DEFINITION CLASS-METHODS set_function_module IMPORTING ii_function_module TYPE REF TO zif_abapgit_function_module. + CLASS-METHODS set_exit + IMPORTING + ii_exit TYPE REF TO zif_abapgit_exit. PROTECTED SECTION. PRIVATE SECTION. @@ -146,9 +149,12 @@ CLASS zcl_abapgit_injector IMPLEMENTATION. METHOD set_function_module. - zcl_abapgit_factory=>gi_function_module = ii_function_module. + ENDMETHOD. + + METHOD set_exit. + zcl_abapgit_exit=>gi_global_exit = ii_exit. ENDMETHOD. ENDCLASS. diff --git a/open/zcl_abapgit_sap_package.clas.abap b/open/zcl_abapgit_sap_package.clas.abap index 0625e3c..48841c8 100644 --- a/open/zcl_abapgit_sap_package.clas.abap +++ b/open/zcl_abapgit_sap_package.clas.abap @@ -44,10 +44,6 @@ CLASS zcl_abapgit_sap_package IMPLEMENTATION. rv_bool = abap_false. ENDMETHOD. - METHOD zif_abapgit_sap_package~get_transport_layer. - ASSERT 1 = 'decoupled'. - ENDMETHOD. - METHOD zif_abapgit_sap_package~get_transport_type. ASSERT 1 = 'decoupled'. ENDMETHOD. diff --git a/open/zcl_abapgit_services_repo.clas.abap b/open/zcl_abapgit_services_repo.clas.abap index f2bed1f..40d63b4 100644 --- a/open/zcl_abapgit_services_repo.clas.abap +++ b/open/zcl_abapgit_services_repo.clas.abap @@ -118,7 +118,7 @@ TYPES: BEGIN OF scompkdtln, zcx_abapgit_exception . CLASS-METHODS raise_error_if_package_exists IMPORTING - iv_devclass TYPE scompkdtln-devclass + iv_devclass TYPE devclass RAISING zcx_abapgit_exception. CLASS-METHODS check_for_restart @@ -262,7 +262,7 @@ CLASS zcl_abapgit_services_repo IMPLEMENTATION. METHOD create_package. - DATA ls_package_data TYPE scompkdtln. + DATA ls_package_data TYPE zif_abapgit_sap_package=>ty_create. DATA lv_create TYPE abap_bool. DATA li_popup TYPE REF TO zif_abapgit_popups. diff --git a/open/zcl_abapgit_services_repo.clas.testclasses.abap b/open/zcl_abapgit_services_repo.clas.testclasses.abap index fbadde1..2518e63 100644 --- a/open/zcl_abapgit_services_repo.clas.testclasses.abap +++ b/open/zcl_abapgit_services_repo.clas.testclasses.abap @@ -320,10 +320,6 @@ CLASS ltcl_sap_package_mock IMPLEMENTATION. ENDMETHOD. - METHOD zif_abapgit_sap_package~get_transport_layer. - - ENDMETHOD. - METHOD zif_abapgit_sap_package~list_subpackages. ENDMETHOD. diff --git a/open/zcl_abapgit_zip.clas.abap b/open/zcl_abapgit_zip.clas.abap index 00ff67e..71d0409 100644 --- a/open/zcl_abapgit_zip.clas.abap +++ b/open/zcl_abapgit_zip.clas.abap @@ -78,7 +78,7 @@ ENDCLASS. -CLASS ZCL_ABAPGIT_ZIP IMPLEMENTATION. +CLASS zcl_abapgit_zip IMPLEMENTATION. METHOD encode_files. @@ -210,7 +210,7 @@ CLASS ZCL_ABAPGIT_ZIP IMPLEMENTATION. lv_package_escaped = iv_package. REPLACE ALL OCCURRENCES OF '/' IN lv_package_escaped WITH '#'. - lv_default = |{ lv_package_escaped }_{ sy-datlo }_{ sy-timlo }|. + lv_default = |{ lv_package_escaped }_{ sy-datlo }_{ sy-timlo }.zip|. lv_zip_xstring = export( is_local_settings = ls_local_settings diff --git a/open/zif_abapgit_apack_definitions.intf.abap b/open/zif_abapgit_apack_definitions.intf.abap index 1903f60..5c4f717 100644 --- a/open/zif_abapgit_apack_definitions.intf.abap +++ b/open/zif_abapgit_apack_definitions.intf.abap @@ -36,5 +36,5 @@ INTERFACE zif_abapgit_apack_definitions PUBLIC . CONSTANTS c_repository_type_abapgit TYPE ty_repository_type VALUE 'abapGit' ##NO_TEXT. CONSTANTS c_apack_interface_sap TYPE seoclsname VALUE 'IF_APACK_MANIFEST' ##NO_TEXT. CONSTANTS c_apack_interface_cust TYPE seoclsname VALUE 'ZIF_APACK_MANIFEST' ##NO_TEXT. - CONSTANTS c_apack_interface_nspc TYPE seoclsname VALUE '/%/IF_APACK_MANIFEST' ##NO_TEXT. + CONSTANTS c_apack_interface_nspc TYPE seoclsname VALUE '/*/IF_APACK_MANIFEST' ##NO_TEXT. ENDINTERFACE. diff --git a/open/zif_abapgit_environment.intf.abap b/open/zif_abapgit_environment.intf.abap index 840a630..6fcaa06 100644 --- a/open/zif_abapgit_environment.intf.abap +++ b/open/zif_abapgit_environment.intf.abap @@ -34,4 +34,10 @@ INTERFACE zif_abapgit_environment METHODS is_variant_maintenance RETURNING VALUE(rv_is_variant_maintenance) TYPE abap_bool. + METHODS init_parallel_processing + IMPORTING + iv_group TYPE clike + RETURNING + VALUE(rv_free_work_processes) TYPE i. + ENDINTERFACE. diff --git a/open/zif_abapgit_popups.intf.abap b/open/zif_abapgit_popups.intf.abap index 68036b2..e7d4dfd 100644 --- a/open/zif_abapgit_popups.intf.abap +++ b/open/zif_abapgit_popups.intf.abap @@ -105,7 +105,7 @@ TYPES sci_chkv TYPE c LENGTH 1. zcx_abapgit_exception . METHODS popup_to_create_package EXPORTING - !es_package_data TYPE scompkdtln + !es_package_data TYPE zif_abapgit_sap_package=>ty_create !ev_create TYPE abap_bool RAISING zcx_abapgit_exception . diff --git a/open/zif_abapgit_sap_package.intf.abap b/open/zif_abapgit_sap_package.intf.abap index 802acae..91b2ed2 100644 --- a/open/zif_abapgit_sap_package.intf.abap +++ b/open/zif_abapgit_sap_package.intf.abap @@ -9,12 +9,22 @@ TYPES: BEGIN OF scompkdtln, TYPES: ty_devclass_tt TYPE STANDARD TABLE OF devclass WITH DEFAULT KEY . + TYPES: BEGIN OF ty_create, + devclass TYPE devclass, + dlvunit TYPE tdevc-dlvunit, + component TYPE c LENGTH 20, + ctext TYPE c LENGTH 60, + parentcl TYPE devclass, + pdevclass TYPE c LENGTH 4, + as4user TYPE usnam, + END OF ty_create. + METHODS validate_name RAISING zcx_abapgit_exception . METHODS create IMPORTING - !is_package TYPE scompkdtln + !is_package TYPE ty_create RAISING zcx_abapgit_exception . METHODS create_local @@ -30,7 +40,7 @@ TYPES: BEGIN OF scompkdtln, zcx_abapgit_exception . METHODS read_parent RETURNING - VALUE(rv_parentcl) TYPE tdevc-parentcl + VALUE(rv_parentcl) TYPE devclass RAISING zcx_abapgit_exception . METHODS read_description @@ -61,9 +71,4 @@ TYPES: BEGIN OF scompkdtln, VALUE(rs_transport_type) TYPE zif_abapgit_definitions=>ty_transport_type RAISING zcx_abapgit_exception . - METHODS get_transport_layer - RETURNING - VALUE(rv_transport_layer) TYPE char4 - RAISING - zcx_abapgit_exception . ENDINTERFACE. diff --git a/open/zif_abapgit_version.intf.abap b/open/zif_abapgit_version.intf.abap index e51ddc7..78cb661 100644 --- a/open/zif_abapgit_version.intf.abap +++ b/open/zif_abapgit_version.intf.abap @@ -2,6 +2,6 @@ INTERFACE zif_abapgit_version PUBLIC . CONSTANTS c_xml_version TYPE string VALUE 'v1.0.0' ##NO_TEXT. - CONSTANTS c_abap_version TYPE string VALUE '1.125.0' ##NO_TEXT. + CONSTANTS c_abap_version TYPE string VALUE '1.126.0' ##NO_TEXT. ENDINTERFACE. diff --git a/package-lock.json b/package-lock.json index 83af369..215b4aa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,18 +9,18 @@ "version": "1.0.0", "license": "ISC", "dependencies": { - "@abaplint/cli": "^2.103.6", + "@abaplint/cli": "^2.103.9", "@abaplint/database-sqlite": "^2.7.119", - "@abaplint/runtime": "^2.7.135", - "@abaplint/transpiler-cli": "^2.7.135", - "electron": "^27.0.4", + "@abaplint/runtime": "^2.7.136", + "@abaplint/transpiler-cli": "^2.7.136", + "electron": "^27.1.2", "express": "^4.18.2" } }, "node_modules/@abaplint/cli": { - "version": "2.103.6", - "resolved": "https://registry.npmjs.org/@abaplint/cli/-/cli-2.103.6.tgz", - "integrity": "sha512-htiMy5bLmN4f1+3jgmVeUFYZcjD3/qC381xl+8TuRapcFwKHCRY/uxF+6f1d+0NpWjW23uZSYs1aFz54n0Taig==", + "version": "2.103.9", + "resolved": "https://registry.npmjs.org/@abaplint/cli/-/cli-2.103.9.tgz", + "integrity": "sha512-23jVyi/Pf/D7aXyIJ/5Q10JGvemk/WmvyP3iVDaIFHk2/yJ7szjzW6c4H+Ht9gni8Yae3xkYVenOcHXjNTl3uQ==", "bin": { "abaplint": "abaplint" }, @@ -40,9 +40,9 @@ } }, "node_modules/@abaplint/runtime": { - "version": "2.7.135", - "resolved": "https://registry.npmjs.org/@abaplint/runtime/-/runtime-2.7.135.tgz", - "integrity": "sha512-8zqoSSIpAJk/wZ1PhtVIy6rYbWZe6hv9A+WjCXS1sI4TVrW/lsZgHRshpNDBxpwITGu85yK1EPYNTmJCO7JhnQ==", + "version": "2.7.136", + "resolved": "https://registry.npmjs.org/@abaplint/runtime/-/runtime-2.7.136.tgz", + "integrity": "sha512-w8//A4ee3/zrqGft3Mckr7KyqtwMOdIPobfoCEzqTpL2wziGlgtp9GHoMZX1e/x3EtbiLWwxfJCGHvERag59ig==", "dependencies": { "temporal-polyfill": "^0.1.1" }, @@ -51,9 +51,9 @@ } }, "node_modules/@abaplint/transpiler-cli": { - "version": "2.7.135", - "resolved": "https://registry.npmjs.org/@abaplint/transpiler-cli/-/transpiler-cli-2.7.135.tgz", - "integrity": "sha512-cG6j4P/CQaphkHGQjtXW1v3xVskV+Kk37efgLNnz3Sf8bhgMGTRYc5OdEGBTqT4Awe6WQg66P78tHw04lJuObg==", + "version": "2.7.136", + "resolved": "https://registry.npmjs.org/@abaplint/transpiler-cli/-/transpiler-cli-2.7.136.tgz", + "integrity": "sha512-baVz9h7zij90+T5fxCN3aHVxQh0Up2+ICybTakleZLDSMgRzkpq8LQ+lmNRK44suAadrc74WDvWJ7OODlcJnyA==", "bin": { "abap_transpile": "abap_transpile" }, @@ -398,9 +398,9 @@ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" }, "node_modules/electron": { - "version": "27.0.4", - "resolved": "https://registry.npmjs.org/electron/-/electron-27.0.4.tgz", - "integrity": "sha512-ob29rN1mtiyAXzF8HsHd5jh8bYKd9OQDakfdOExi0F7epU97gXPHaj6JPjbBJ/vpki5d32SyKVePW4vxeNZk1A==", + "version": "27.1.2", + "resolved": "https://registry.npmjs.org/electron/-/electron-27.1.2.tgz", + "integrity": "sha512-Dy6BUuGLiIJv+zfsXwr78TV2TNppi24rXF4PIIS+OjDblEKdkI9r1iM8JUd3/x3sbGUy5mdLMSPhvmu//IhkgA==", "hasInstallScript": true, "dependencies": { "@electron/get": "^2.0.0", diff --git a/package.json b/package.json index 91e2351..35c6386 100644 --- a/package.json +++ b/package.json @@ -20,11 +20,11 @@ }, "homepage": "https://github.com/larshp/testyTest#readme", "dependencies": { - "@abaplint/cli": "^2.103.6", + "@abaplint/cli": "^2.103.9", "@abaplint/database-sqlite": "^2.7.119", - "@abaplint/runtime": "^2.7.135", - "@abaplint/transpiler-cli": "^2.7.135", - "electron": "^27.0.4", + "@abaplint/runtime": "^2.7.136", + "@abaplint/transpiler-cli": "^2.7.136", + "electron": "^27.1.2", "express": "^4.18.2" } } diff --git a/replace/zcl_abapgit_environment.clas.abap b/replace/zcl_abapgit_environment.clas.abap index 73fd33f..d8ac6bc 100644 --- a/replace/zcl_abapgit_environment.clas.abap +++ b/replace/zcl_abapgit_environment.clas.abap @@ -11,6 +11,10 @@ CLASS zcl_abapgit_environment IMPLEMENTATION. ASSERT 1 = 'decoupled'. ENDMETHOD. + METHOD zif_abapgit_environment~init_parallel_processing. + ASSERT 1 = 'decoupled'. + ENDMETHOD. + METHOD zif_abapgit_environment~get_basis_release. ASSERT 1 = 'decoupled'. ENDMETHOD. diff --git a/replace/zcl_abapgit_sap_package.clas.abap b/replace/zcl_abapgit_sap_package.clas.abap index 0625e3c..48841c8 100644 --- a/replace/zcl_abapgit_sap_package.clas.abap +++ b/replace/zcl_abapgit_sap_package.clas.abap @@ -44,10 +44,6 @@ CLASS zcl_abapgit_sap_package IMPLEMENTATION. rv_bool = abap_false. ENDMETHOD. - METHOD zif_abapgit_sap_package~get_transport_layer. - ASSERT 1 = 'decoupled'. - ENDMETHOD. - METHOD zif_abapgit_sap_package~get_transport_type. ASSERT 1 = 'decoupled'. ENDMETHOD. diff --git a/run.sh b/run.sh index 09ef7e4..50a221c 100644 --- a/run.sh +++ b/run.sh @@ -71,6 +71,7 @@ cp abapGit/src/ui/pages/zcl_abapgit_gui_page_code_insp* open cp abapGit/src/ui/pages/zcl_abapgit_gui_page_commit* open cp abapGit/src/ui/pages/zcl_abapgit_gui_page_flow* open cp abapGit/src/ui/pages/zcl_abapgit_gui_page_db* open +cp abapGit/src/ui/pages/zcl_abapgit_gui_page_pull* open cp abapGit/src/ui/pages/zcl_abapgit_gui_page_diff* open cp abapGit/src/ui/pages/zcl_abapgit_gui_page_ex_object* open cp abapGit/src/ui/pages/zcl_abapgit_gui_page_ex_pckage* open