mirror of
https://github.com/abapGit/abapGit.git
synced 2025-04-30 20:03:20 +08:00
Rename zcl_abapgit_file_status
(#6413)
Co-authored-by: Lars Hvam <larshp@hotmail.com>
This commit is contained in:
parent
89f715ed5f
commit
274f802e8b
|
@ -139,7 +139,7 @@ CLASS zcl_abapgit_file_deserialize IMPLEMENTATION.
|
|||
DATA lt_results TYPE zif_abapgit_definitions=>ty_results_tt.
|
||||
|
||||
lt_results = filter_files_to_deserialize(
|
||||
it_results = zcl_abapgit_file_status=>status( io_repo )
|
||||
it_results = zcl_abapgit_repo_status=>calculate( io_repo )
|
||||
ii_log = ii_log ).
|
||||
|
||||
rt_results = prioritize_deser(
|
||||
|
|
|
@ -134,7 +134,7 @@ CLASS zcl_abapgit_objects_check IMPLEMENTATION.
|
|||
li_package TYPE REF TO zif_abapgit_sap_package.
|
||||
|
||||
" get unfiltered status to evaluate properly which warnings are required
|
||||
lt_results = zcl_abapgit_file_status=>status( io_repo ).
|
||||
lt_results = zcl_abapgit_repo_status=>calculate( io_repo ).
|
||||
|
||||
check_multiple_files( lt_results ).
|
||||
|
||||
|
|
|
@ -665,9 +665,8 @@ CLASS zcl_abapgit_repo IMPLEMENTATION.
|
|||
METHOD status.
|
||||
|
||||
IF lines( mt_status ) = 0.
|
||||
mt_status = zcl_abapgit_file_status=>status( io_repo = me
|
||||
mt_status = zcl_abapgit_repo_status=>calculate( io_repo = me
|
||||
ii_log = ii_log ).
|
||||
|
||||
ENDIF.
|
||||
|
||||
rt_results = mt_status.
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
CLASS zcl_abapgit_file_status DEFINITION
|
||||
CLASS zcl_abapgit_repo_status DEFINITION
|
||||
PUBLIC
|
||||
FINAL
|
||||
CREATE PRIVATE.
|
||||
|
||||
PUBLIC SECTION.
|
||||
|
||||
CLASS-METHODS status
|
||||
CLASS-METHODS calculate
|
||||
IMPORTING
|
||||
!io_repo TYPE REF TO zcl_abapgit_repo
|
||||
!ii_log TYPE REF TO zif_abapgit_log OPTIONAL
|
||||
|
@ -21,6 +21,7 @@ CLASS zcl_abapgit_file_status DEFINITION
|
|||
|
||||
PROTECTED SECTION.
|
||||
PRIVATE SECTION.
|
||||
|
||||
DATA mv_root_package TYPE devclass.
|
||||
DATA mo_dot TYPE REF TO zcl_abapgit_dot_abapgit.
|
||||
|
||||
|
@ -33,6 +34,7 @@ CLASS zcl_abapgit_file_status DEFINITION
|
|||
VALUE(rt_results) TYPE zif_abapgit_definitions=>ty_results_tt
|
||||
RAISING
|
||||
zcx_abapgit_exception.
|
||||
|
||||
METHODS process_local
|
||||
IMPORTING
|
||||
!it_local TYPE zif_abapgit_definitions=>ty_files_item_tt
|
||||
|
@ -43,6 +45,7 @@ CLASS zcl_abapgit_file_status DEFINITION
|
|||
!ct_results TYPE zif_abapgit_definitions=>ty_results_tt
|
||||
RAISING
|
||||
zcx_abapgit_exception.
|
||||
|
||||
METHODS process_items
|
||||
IMPORTING
|
||||
!it_unprocessed_remote TYPE zif_abapgit_git_definitions=>ty_files_tt
|
||||
|
@ -50,6 +53,7 @@ CLASS zcl_abapgit_file_status DEFINITION
|
|||
!ct_items TYPE zif_abapgit_definitions=>ty_items_tt
|
||||
RAISING
|
||||
zcx_abapgit_exception.
|
||||
|
||||
METHODS process_remote
|
||||
IMPORTING
|
||||
!it_local TYPE zif_abapgit_definitions=>ty_files_item_tt
|
||||
|
@ -60,6 +64,7 @@ CLASS zcl_abapgit_file_status DEFINITION
|
|||
!ct_results TYPE zif_abapgit_definitions=>ty_results_tt
|
||||
RAISING
|
||||
zcx_abapgit_exception.
|
||||
|
||||
CLASS-METHODS build_existing
|
||||
IMPORTING
|
||||
!is_local TYPE zif_abapgit_definitions=>ty_file_item
|
||||
|
@ -67,11 +72,13 @@ CLASS zcl_abapgit_file_status DEFINITION
|
|||
!it_state TYPE zif_abapgit_git_definitions=>ty_file_signatures_ts
|
||||
RETURNING
|
||||
VALUE(rs_result) TYPE zif_abapgit_definitions=>ty_result.
|
||||
|
||||
CLASS-METHODS build_new_local
|
||||
IMPORTING
|
||||
!is_local TYPE zif_abapgit_definitions=>ty_file_item
|
||||
RETURNING
|
||||
VALUE(rs_result) TYPE zif_abapgit_definitions=>ty_result.
|
||||
|
||||
METHODS build_new_remote
|
||||
IMPORTING
|
||||
!is_remote TYPE zif_abapgit_git_definitions=>ty_file
|
||||
|
@ -81,6 +88,7 @@ CLASS zcl_abapgit_file_status DEFINITION
|
|||
VALUE(rs_result) TYPE zif_abapgit_definitions=>ty_result
|
||||
RAISING
|
||||
zcx_abapgit_exception.
|
||||
|
||||
CLASS-METHODS get_object_package
|
||||
IMPORTING
|
||||
!iv_object TYPE tadir-object
|
||||
|
@ -89,12 +97,14 @@ CLASS zcl_abapgit_file_status DEFINITION
|
|||
VALUE(rv_devclass) TYPE devclass
|
||||
RAISING
|
||||
zcx_abapgit_exception.
|
||||
|
||||
CLASS-METHODS check_local_remote_consistency
|
||||
IMPORTING
|
||||
!is_local TYPE zif_abapgit_definitions=>ty_file_item
|
||||
!is_remote TYPE zif_abapgit_git_definitions=>ty_file
|
||||
RAISING
|
||||
zcx_abapgit_exception.
|
||||
|
||||
CLASS-METHODS ensure_state
|
||||
IMPORTING
|
||||
!it_local TYPE zif_abapgit_definitions=>ty_files_item_tt
|
||||
|
@ -106,7 +116,7 @@ ENDCLASS.
|
|||
|
||||
|
||||
|
||||
CLASS zcl_abapgit_file_status IMPLEMENTATION.
|
||||
CLASS zcl_abapgit_repo_status IMPLEMENTATION.
|
||||
|
||||
|
||||
METHOD build_existing.
|
||||
|
@ -242,6 +252,56 @@ CLASS zcl_abapgit_file_status IMPLEMENTATION.
|
|||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD calculate.
|
||||
|
||||
DATA lt_local TYPE zif_abapgit_definitions=>ty_files_item_tt.
|
||||
DATA lt_remote TYPE zif_abapgit_git_definitions=>ty_files_tt.
|
||||
DATA li_exit TYPE REF TO zif_abapgit_exit.
|
||||
DATA lo_instance TYPE REF TO zcl_abapgit_repo_status.
|
||||
DATA lo_consistency_checks TYPE REF TO lcl_status_consistency_checks.
|
||||
|
||||
lt_local = io_repo->get_files_local( ii_log = ii_log ).
|
||||
|
||||
IF lines( lt_local ) <= 2.
|
||||
" Less equal two means that we have only the .abapgit.xml and the package in
|
||||
" our local repository. In this case we have to update our local .abapgit.xml
|
||||
" from the remote one. Otherwise we get errors when e.g. the folder starting
|
||||
" folder is different.
|
||||
io_repo->find_remote_dot_abapgit( ).
|
||||
ENDIF.
|
||||
|
||||
lt_remote = io_repo->get_files_remote( iv_ignore_files = abap_true ).
|
||||
|
||||
li_exit = zcl_abapgit_exit=>get_instance( ).
|
||||
li_exit->pre_calculate_repo_status(
|
||||
EXPORTING
|
||||
is_repo_meta = io_repo->ms_data
|
||||
CHANGING
|
||||
ct_local = lt_local
|
||||
ct_remote = lt_remote ).
|
||||
|
||||
CREATE OBJECT lo_instance
|
||||
EXPORTING
|
||||
iv_root_package = io_repo->get_package( )
|
||||
io_dot = io_repo->get_dot_abapgit( ).
|
||||
|
||||
rt_results = lo_instance->calculate_status(
|
||||
it_local = lt_local
|
||||
it_remote = lt_remote
|
||||
it_cur_state = io_repo->zif_abapgit_repo~checksums( )->get_checksums_per_file( ) ).
|
||||
|
||||
IF ii_log IS BOUND.
|
||||
" This method just adds messages to the log. No log, nothing to do here
|
||||
CREATE OBJECT lo_consistency_checks
|
||||
EXPORTING
|
||||
iv_root_package = io_repo->get_package( )
|
||||
io_dot = io_repo->get_dot_abapgit( ).
|
||||
ii_log->merge_with( lo_consistency_checks->run_checks( rt_results ) ).
|
||||
ENDIF.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD calculate_status.
|
||||
|
||||
DATA:
|
||||
|
@ -514,54 +574,4 @@ CLASS zcl_abapgit_file_status IMPLEMENTATION.
|
|||
ENDLOOP.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD status.
|
||||
|
||||
DATA lt_local TYPE zif_abapgit_definitions=>ty_files_item_tt.
|
||||
DATA lt_remote TYPE zif_abapgit_git_definitions=>ty_files_tt.
|
||||
DATA li_exit TYPE REF TO zif_abapgit_exit.
|
||||
DATA lo_instance TYPE REF TO zcl_abapgit_file_status.
|
||||
DATA lo_consistency_checks TYPE REF TO lcl_status_consistency_checks.
|
||||
|
||||
lt_local = io_repo->get_files_local( ii_log = ii_log ).
|
||||
|
||||
IF lines( lt_local ) <= 2.
|
||||
" Less equal two means that we have only the .abapgit.xml and the package in
|
||||
" our local repository. In this case we have to update our local .abapgit.xml
|
||||
" from the remote one. Otherwise we get errors when e.g. the folder starting
|
||||
" folder is different.
|
||||
io_repo->find_remote_dot_abapgit( ).
|
||||
ENDIF.
|
||||
|
||||
lt_remote = io_repo->get_files_remote( iv_ignore_files = abap_true ).
|
||||
|
||||
li_exit = zcl_abapgit_exit=>get_instance( ).
|
||||
li_exit->pre_calculate_repo_status(
|
||||
EXPORTING
|
||||
is_repo_meta = io_repo->ms_data
|
||||
CHANGING
|
||||
ct_local = lt_local
|
||||
ct_remote = lt_remote ).
|
||||
|
||||
CREATE OBJECT lo_instance
|
||||
EXPORTING
|
||||
iv_root_package = io_repo->get_package( )
|
||||
io_dot = io_repo->get_dot_abapgit( ).
|
||||
|
||||
rt_results = lo_instance->calculate_status(
|
||||
it_local = lt_local
|
||||
it_remote = lt_remote
|
||||
it_cur_state = io_repo->zif_abapgit_repo~checksums( )->get_checksums_per_file( ) ).
|
||||
|
||||
IF ii_log IS BOUND.
|
||||
" This method just adds messages to the log. No log, nothing to do here
|
||||
CREATE OBJECT lo_consistency_checks
|
||||
EXPORTING
|
||||
iv_root_package = io_repo->get_package( )
|
||||
io_dot = io_repo->get_dot_abapgit( ).
|
||||
ii_log->merge_with( lo_consistency_checks->run_checks( rt_results ) ).
|
||||
ENDIF.
|
||||
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
|
@ -1,5 +1,5 @@
|
|||
CLASS ltcl_run_checks DEFINITION DEFERRED.
|
||||
CLASS zcl_abapgit_file_status DEFINITION LOCAL FRIENDS ltcl_run_checks.
|
||||
CLASS zcl_abapgit_repo_status DEFINITION LOCAL FRIENDS ltcl_run_checks.
|
||||
|
||||
CLASS ltcl_util DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT FINAL.
|
||||
PUBLIC SECTION.
|
||||
|
@ -635,7 +635,7 @@ CLASS lcl_status_result IMPLEMENTATION.
|
|||
ENDCLASS.
|
||||
|
||||
CLASS ltcl_status_helper DEFINITION DEFERRED.
|
||||
CLASS zcl_abapgit_file_status DEFINITION LOCAL FRIENDS ltcl_status_helper.
|
||||
CLASS zcl_abapgit_repo_status DEFINITION LOCAL FRIENDS ltcl_status_helper.
|
||||
|
||||
CLASS ltcl_status_helper DEFINITION FOR TESTING.
|
||||
|
||||
|
@ -775,7 +775,7 @@ CLASS ltcl_status_helper IMPLEMENTATION.
|
|||
METHOD run.
|
||||
|
||||
DATA: lt_results TYPE zif_abapgit_definitions=>ty_results_tt,
|
||||
lo_instance TYPE REF TO zcl_abapgit_file_status,
|
||||
lo_instance TYPE REF TO zcl_abapgit_repo_status,
|
||||
lo_dot TYPE REF TO zcl_abapgit_dot_abapgit.
|
||||
|
||||
lo_dot = zcl_abapgit_dot_abapgit=>build_default( ).
|
||||
|
@ -800,7 +800,7 @@ CLASS ltcl_status_helper IMPLEMENTATION.
|
|||
ENDCLASS.
|
||||
|
||||
CLASS ltcl_calculate_status DEFINITION DEFERRED.
|
||||
CLASS zcl_abapgit_file_status DEFINITION LOCAL FRIENDS ltcl_calculate_status.
|
||||
CLASS zcl_abapgit_repo_status DEFINITION LOCAL FRIENDS ltcl_calculate_status.
|
||||
|
||||
CLASS ltcl_calculate_status DEFINITION FOR TESTING RISK LEVEL HARMLESS
|
||||
DURATION SHORT FINAL.
|
|
@ -3,9 +3,9 @@
|
|||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
||||
<asx:values>
|
||||
<VSEOCLASS>
|
||||
<CLSNAME>ZCL_ABAPGIT_FILE_STATUS</CLSNAME>
|
||||
<CLSNAME>ZCL_ABAPGIT_REPO_STATUS</CLSNAME>
|
||||
<LANGU>E</LANGU>
|
||||
<DESCRIPT>abapGit - File Status</DESCRIPT>
|
||||
<DESCRIPT>abapGit - Repository Status</DESCRIPT>
|
||||
<STATE>1</STATE>
|
||||
<CLSCCINCL>X</CLSCCINCL>
|
||||
<FIXPT>X</FIXPT>
|
|
@ -535,7 +535,7 @@ CLASS zcl_abapgit_gui_page_sett_info IMPLEMENTATION.
|
|||
FIELD-SYMBOLS:
|
||||
<ls_result> LIKE LINE OF lt_results.
|
||||
|
||||
lt_results = zcl_abapgit_file_status=>status( mo_repo ).
|
||||
lt_results = zcl_abapgit_repo_status=>calculate( mo_repo ).
|
||||
|
||||
DO 3 TIMES.
|
||||
CLEAR ls_stats.
|
||||
|
|
|
@ -92,8 +92,8 @@
|
|||
{"object": "ZCL_ABAPGIT_SERIALIZE", "class": "ltcl_serialize", "method": "ignored", "note": "Void type: KO100"},
|
||||
{"object": "ZCL_ABAPGIT_SERIALIZE", "class": "ltcl_i18n", "method": "test", "note": "Void type: DD02V"},
|
||||
|
||||
{"object": "ZCL_ABAPGIT_FILE_STATUS", "class": "ltcl_calculate_status", "method": "deleted_remote", "note": "READ TABLE subrc 4 vs subrc 8"},
|
||||
{"object": "ZCL_ABAPGIT_FILE_STATUS", "class": "ltcl_calculate_status", "method": "complete", "note": "READ TABLE subrc 4 vs subrc 8"},
|
||||
{"object": "ZCL_ABAPGIT_REPO_STATUS", "class": "ltcl_calculate_status", "method": "deleted_remote", "note": "READ TABLE subrc 4 vs subrc 8"},
|
||||
{"object": "ZCL_ABAPGIT_REPO_STATUS", "class": "ltcl_calculate_status", "method": "complete", "note": "READ TABLE subrc 4 vs subrc 8"},
|
||||
|
||||
{"object": "ZCL_ABAPGIT_PERSIST_PACKAGES", "class": "ltcl_packages", "method": "test_package", "note": "ZABAPGIT table not existing, error cx_sy_dynamic_osql_semantics"},
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user