deserialize adjustments to the new logic

This commit is contained in:
sbcgua 2016-11-08 13:57:22 +02:00
parent ebaa76a6c2
commit c50b8f3b2e

View File

@ -13,38 +13,17 @@ CLASS lcl_objects IMPLEMENTATION.
DATA: lv_index TYPE i,
lv_answer TYPE c,
lv_question TYPE string,
lt_before TYPE lcl_persistence_repo=>ty_local_checksum_tt,
lt_current TYPE lcl_persistence_repo=>ty_local_checksum_tt.
lv_question TYPE string.
FIELD-SYMBOLS: <ls_before> LIKE LINE OF lt_before,
<ls_current> LIKE LINE OF lt_current,
<ls_result> LIKE LINE OF ct_results.
FIELD-SYMBOLS: <ls_result> LIKE LINE OF ct_results.
lt_before = io_repo->get_local_checksums( ).
lt_current = io_repo->build_local_checksums( ).
LOOP AT ct_results ASSIGNING <ls_result>.
lv_index = sy-tabix.
READ TABLE lt_before ASSIGNING <ls_before>
WITH KEY item-obj_type = <ls_result>-obj_type
item-obj_name = <ls_result>-obj_name.
IF sy-subrc <> 0.
CONTINUE.
ENDIF.
READ TABLE lt_current ASSIGNING <ls_current>
WITH KEY item-obj_type = <ls_result>-obj_type
item-obj_name = <ls_result>-obj_name.
IF sy-subrc <> 0.
CONTINUE.
ENDIF.
IF <ls_before>-sha1 <> <ls_current>-sha1.
lv_question = |It looks like object { <ls_result>-obj_type
} { <ls_result>-obj_name
IF <ls_result>-lstate IS NOT INITIAL. " Modified ?
lv_question = |It looks like object {
<ls_result>-obj_type } { <ls_result>-obj_name
} has been modified locally, overwrite object?|.
lv_answer = lcl_popups=>popup_to_confirm(
@ -628,7 +607,9 @@ CLASS lcl_objects IMPLEMENTATION.
lt_remote = io_repo->get_files_remote( ).
lt_results = lcl_file_status=>status( io_repo ).
DELETE lt_results WHERE match = abap_true.
DELETE lt_results WHERE
match = abap_true " Full match
OR rstate IS INITIAL. " no remote changes, only local
SORT lt_results BY obj_type ASCENDING obj_name ASCENDING.
DELETE ADJACENT DUPLICATES FROM lt_results COMPARING obj_type obj_name.