mirror of
https://github.com/abapGit/abapGit.git
synced 2025-05-01 12:20:51 +08:00
Cleanup (#2753)
* refactor IF * fix some indentation * indentation fixes * indentation fixes * indentation * indentation
This commit is contained in:
parent
7f04d59bf9
commit
f6e8332754
|
@ -4,7 +4,7 @@ CLASS ltcl_abapgit_syntax_xml DEFINITION FINAL FOR TESTING
|
||||||
|
|
||||||
PRIVATE SECTION.
|
PRIVATE SECTION.
|
||||||
DATA:
|
DATA:
|
||||||
mo_cut TYPE REF TO zcl_abapgit_syntax_xml.
|
mo_cut TYPE REF TO zcl_abapgit_syntax_xml.
|
||||||
|
|
||||||
METHODS:
|
METHODS:
|
||||||
setup,
|
setup,
|
||||||
|
|
|
@ -300,7 +300,8 @@ CLASS zcl_abapgit_gui IMPLEMENTATION.
|
||||||
TRY.
|
TRY.
|
||||||
" Home must be processed by router if it presents
|
" Home must be processed by router if it presents
|
||||||
IF ( iv_action <> c_action-go_home OR mi_router IS NOT BOUND )
|
IF ( iv_action <> c_action-go_home OR mi_router IS NOT BOUND )
|
||||||
AND mi_cur_page IS BOUND AND zcl_abapgit_gui_utils=>is_event_handler( mi_cur_page ) = abap_true.
|
AND mi_cur_page IS BOUND
|
||||||
|
AND zcl_abapgit_gui_utils=>is_event_handler( mi_cur_page ) = abap_true.
|
||||||
li_page_eh ?= mi_cur_page.
|
li_page_eh ?= mi_cur_page.
|
||||||
li_page_eh->on_event(
|
li_page_eh->on_event(
|
||||||
EXPORTING
|
EXPORTING
|
||||||
|
|
|
@ -74,130 +74,6 @@ ENDCLASS.
|
||||||
CLASS ZCL_ABAPGIT_HTML IMPLEMENTATION.
|
CLASS ZCL_ABAPGIT_HTML IMPLEMENTATION.
|
||||||
|
|
||||||
|
|
||||||
METHOD add_icon.
|
|
||||||
|
|
||||||
add( icon( iv_name = iv_name
|
|
||||||
iv_class = iv_class
|
|
||||||
iv_hint = iv_hint ) ).
|
|
||||||
|
|
||||||
ENDMETHOD.
|
|
||||||
|
|
||||||
|
|
||||||
METHOD class_constructor.
|
|
||||||
CREATE OBJECT go_single_tags_re
|
|
||||||
EXPORTING
|
|
||||||
pattern = '<(AREA|BASE|BR|COL|COMMAND|EMBED|HR|IMG|INPUT|LINK|META|PARAM|SOURCE|!)'
|
|
||||||
ignore_case = abap_false.
|
|
||||||
ENDMETHOD.
|
|
||||||
|
|
||||||
|
|
||||||
METHOD indent_line.
|
|
||||||
|
|
||||||
DATA: ls_study TYPE ty_study_result,
|
|
||||||
lv_x_str TYPE string.
|
|
||||||
|
|
||||||
ls_study = study_line(
|
|
||||||
is_context = cs_context
|
|
||||||
iv_line = cv_line ).
|
|
||||||
|
|
||||||
" First closing tag - shift back exceptionally
|
|
||||||
IF ( ls_study-script_close = abap_true
|
|
||||||
OR ls_study-style_close = abap_true
|
|
||||||
OR ls_study-curly_close = abap_true
|
|
||||||
OR ls_study-tag_close = abap_true )
|
|
||||||
AND cs_context-indent > 0.
|
|
||||||
lv_x_str = repeat( val = ` ` occ = ( cs_context-indent - 1 ) * c_indent_size ).
|
|
||||||
cv_line = lv_x_str && cv_line.
|
|
||||||
ELSE.
|
|
||||||
cv_line = cs_context-indent_str && cv_line.
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
" Context status update
|
|
||||||
CASE abap_true.
|
|
||||||
WHEN ls_study-script_open.
|
|
||||||
cs_context-within_js = abap_true.
|
|
||||||
cs_context-within_style = abap_false.
|
|
||||||
WHEN ls_study-style_open.
|
|
||||||
cs_context-within_js = abap_false.
|
|
||||||
cs_context-within_style = abap_true.
|
|
||||||
WHEN ls_study-script_close OR ls_study-style_close.
|
|
||||||
cs_context-within_js = abap_false.
|
|
||||||
cs_context-within_style = abap_false.
|
|
||||||
ls_study-closings = ls_study-closings + 1.
|
|
||||||
ENDCASE.
|
|
||||||
|
|
||||||
" More-less logic chosen due to possible double tags in a line '<a><b>'
|
|
||||||
IF ls_study-openings <> ls_study-closings.
|
|
||||||
IF ls_study-openings > ls_study-closings.
|
|
||||||
cs_context-indent = cs_context-indent + 1.
|
|
||||||
ELSEIF cs_context-indent > 0. " AND ls_study-openings < ls_study-closings
|
|
||||||
cs_context-indent = cs_context-indent - 1.
|
|
||||||
ENDIF.
|
|
||||||
cs_context-indent_str = repeat( val = ` ` occ = cs_context-indent * c_indent_size ).
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
ENDMETHOD.
|
|
||||||
|
|
||||||
|
|
||||||
METHOD study_line.
|
|
||||||
|
|
||||||
DATA: lv_line TYPE string,
|
|
||||||
lv_len TYPE i.
|
|
||||||
|
|
||||||
lv_line = to_upper( shift_left( val = iv_line sub = ` ` ) ).
|
|
||||||
lv_len = strlen( lv_line ).
|
|
||||||
|
|
||||||
" Some assumptions for simplification and speed
|
|
||||||
" - style & scripts tag should be opened/closed in a separate line
|
|
||||||
" - style & scripts opening and closing in one line is possible but only once
|
|
||||||
|
|
||||||
" TODO & Issues
|
|
||||||
" - What if the string IS a well formed html already not just single line ?
|
|
||||||
|
|
||||||
IF is_context-within_js = abap_true OR is_context-within_style = abap_true.
|
|
||||||
|
|
||||||
IF is_context-within_js = abap_true AND lv_len >= 8 AND lv_line(8) = '</SCRIPT'.
|
|
||||||
rs_result-script_close = abap_true.
|
|
||||||
ELSEIF is_context-within_style = abap_true AND lv_len >= 7 AND lv_line(7) = '</STYLE'.
|
|
||||||
rs_result-style_close = abap_true.
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
IF is_context-no_indent_jscss = abap_false.
|
|
||||||
IF lv_len >= 1 AND lv_line(1) = '}'.
|
|
||||||
rs_result-curly_close = abap_true.
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
FIND ALL OCCURRENCES OF '{' IN lv_line MATCH COUNT rs_result-openings.
|
|
||||||
FIND ALL OCCURRENCES OF '}' IN lv_line MATCH COUNT rs_result-closings.
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
ELSE.
|
|
||||||
IF lv_len >= 7 AND lv_line(7) = '<SCRIPT'.
|
|
||||||
FIND FIRST OCCURRENCE OF '</SCRIPT' IN lv_line.
|
|
||||||
IF sy-subrc > 0. " Not found
|
|
||||||
rs_result-script_open = abap_true.
|
|
||||||
ENDIF.
|
|
||||||
ENDIF.
|
|
||||||
IF lv_len >= 6 AND lv_line(6) = '<STYLE'.
|
|
||||||
FIND FIRST OCCURRENCE OF '</STYLE' IN lv_line.
|
|
||||||
IF sy-subrc > 0. " Not found
|
|
||||||
rs_result-style_open = abap_true.
|
|
||||||
ENDIF.
|
|
||||||
ENDIF.
|
|
||||||
IF lv_len >= 2 AND lv_line(2) = '</'.
|
|
||||||
rs_result-tag_close = abap_true.
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
FIND ALL OCCURRENCES OF '<' IN lv_line MATCH COUNT rs_result-openings.
|
|
||||||
FIND ALL OCCURRENCES OF '</' IN lv_line MATCH COUNT rs_result-closings.
|
|
||||||
FIND ALL OCCURRENCES OF REGEX go_single_tags_re IN lv_line MATCH COUNT rs_result-singles.
|
|
||||||
rs_result-openings = rs_result-openings - rs_result-closings - rs_result-singles.
|
|
||||||
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
ENDMETHOD.
|
|
||||||
|
|
||||||
|
|
||||||
METHOD a.
|
METHOD a.
|
||||||
|
|
||||||
DATA: lv_class TYPE string,
|
DATA: lv_class TYPE string,
|
||||||
|
@ -293,6 +169,31 @@ CLASS ZCL_ABAPGIT_HTML IMPLEMENTATION.
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
|
METHOD add_icon.
|
||||||
|
|
||||||
|
add( icon( iv_name = iv_name
|
||||||
|
iv_class = iv_class
|
||||||
|
iv_hint = iv_hint ) ).
|
||||||
|
|
||||||
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
|
METHOD checkbox.
|
||||||
|
|
||||||
|
rv_html = |<input type="checkbox" id="{ iv_id }">|
|
||||||
|
&& |{ co_span_link_hint }|.
|
||||||
|
|
||||||
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
|
METHOD class_constructor.
|
||||||
|
CREATE OBJECT go_single_tags_re
|
||||||
|
EXPORTING
|
||||||
|
pattern = '<(AREA|BASE|BR|COL|COMMAND|EMBED|HR|IMG|INPUT|LINK|META|PARAM|SOURCE|!)'
|
||||||
|
ignore_case = abap_false.
|
||||||
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
METHOD icon.
|
METHOD icon.
|
||||||
|
|
||||||
DATA: lv_hint TYPE string,
|
DATA: lv_hint TYPE string,
|
||||||
|
@ -324,6 +225,54 @@ CLASS ZCL_ABAPGIT_HTML IMPLEMENTATION.
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
|
METHOD indent_line.
|
||||||
|
|
||||||
|
DATA: ls_study TYPE ty_study_result,
|
||||||
|
lv_x_str TYPE string.
|
||||||
|
|
||||||
|
ls_study = study_line(
|
||||||
|
is_context = cs_context
|
||||||
|
iv_line = cv_line ).
|
||||||
|
|
||||||
|
" First closing tag - shift back exceptionally
|
||||||
|
IF ( ls_study-script_close = abap_true
|
||||||
|
OR ls_study-style_close = abap_true
|
||||||
|
OR ls_study-curly_close = abap_true
|
||||||
|
OR ls_study-tag_close = abap_true )
|
||||||
|
AND cs_context-indent > 0.
|
||||||
|
lv_x_str = repeat( val = ` ` occ = ( cs_context-indent - 1 ) * c_indent_size ).
|
||||||
|
cv_line = lv_x_str && cv_line.
|
||||||
|
ELSE.
|
||||||
|
cv_line = cs_context-indent_str && cv_line.
|
||||||
|
ENDIF.
|
||||||
|
|
||||||
|
" Context status update
|
||||||
|
CASE abap_true.
|
||||||
|
WHEN ls_study-script_open.
|
||||||
|
cs_context-within_js = abap_true.
|
||||||
|
cs_context-within_style = abap_false.
|
||||||
|
WHEN ls_study-style_open.
|
||||||
|
cs_context-within_js = abap_false.
|
||||||
|
cs_context-within_style = abap_true.
|
||||||
|
WHEN ls_study-script_close OR ls_study-style_close.
|
||||||
|
cs_context-within_js = abap_false.
|
||||||
|
cs_context-within_style = abap_false.
|
||||||
|
ls_study-closings = ls_study-closings + 1.
|
||||||
|
ENDCASE.
|
||||||
|
|
||||||
|
" More-less logic chosen due to possible double tags in a line '<a><b>'
|
||||||
|
IF ls_study-openings <> ls_study-closings.
|
||||||
|
IF ls_study-openings > ls_study-closings.
|
||||||
|
cs_context-indent = cs_context-indent + 1.
|
||||||
|
ELSEIF cs_context-indent > 0. " AND ls_study-openings < ls_study-closings
|
||||||
|
cs_context-indent = cs_context-indent - 1.
|
||||||
|
ENDIF.
|
||||||
|
cs_context-indent_str = repeat( val = ` ` occ = cs_context-indent * c_indent_size ).
|
||||||
|
ENDIF.
|
||||||
|
|
||||||
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
METHOD is_empty.
|
METHOD is_empty.
|
||||||
rv_yes = boolc( lines( mt_buffer ) = 0 ).
|
rv_yes = boolc( lines( mt_buffer ) = 0 ).
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
@ -348,18 +297,69 @@ CLASS ZCL_ABAPGIT_HTML IMPLEMENTATION.
|
||||||
|
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
|
METHOD study_line.
|
||||||
|
|
||||||
|
DATA: lv_line TYPE string,
|
||||||
|
lv_len TYPE i.
|
||||||
|
|
||||||
|
lv_line = to_upper( shift_left( val = iv_line sub = ` ` ) ).
|
||||||
|
lv_len = strlen( lv_line ).
|
||||||
|
|
||||||
|
" Some assumptions for simplification and speed
|
||||||
|
" - style & scripts tag should be opened/closed in a separate line
|
||||||
|
" - style & scripts opening and closing in one line is possible but only once
|
||||||
|
|
||||||
|
" TODO & Issues
|
||||||
|
" - What if the string IS a well formed html already not just single line ?
|
||||||
|
|
||||||
|
IF is_context-within_js = abap_true OR is_context-within_style = abap_true.
|
||||||
|
|
||||||
|
IF is_context-within_js = abap_true AND lv_len >= 8 AND lv_line(8) = '</SCRIPT'.
|
||||||
|
rs_result-script_close = abap_true.
|
||||||
|
ELSEIF is_context-within_style = abap_true AND lv_len >= 7 AND lv_line(7) = '</STYLE'.
|
||||||
|
rs_result-style_close = abap_true.
|
||||||
|
ENDIF.
|
||||||
|
|
||||||
|
IF is_context-no_indent_jscss = abap_false.
|
||||||
|
IF lv_len >= 1 AND lv_line(1) = '}'.
|
||||||
|
rs_result-curly_close = abap_true.
|
||||||
|
ENDIF.
|
||||||
|
|
||||||
|
FIND ALL OCCURRENCES OF '{' IN lv_line MATCH COUNT rs_result-openings.
|
||||||
|
FIND ALL OCCURRENCES OF '}' IN lv_line MATCH COUNT rs_result-closings.
|
||||||
|
ENDIF.
|
||||||
|
|
||||||
|
ELSE.
|
||||||
|
IF lv_len >= 7 AND lv_line(7) = '<SCRIPT'.
|
||||||
|
FIND FIRST OCCURRENCE OF '</SCRIPT' IN lv_line.
|
||||||
|
IF sy-subrc > 0. " Not found
|
||||||
|
rs_result-script_open = abap_true.
|
||||||
|
ENDIF.
|
||||||
|
ENDIF.
|
||||||
|
IF lv_len >= 6 AND lv_line(6) = '<STYLE'.
|
||||||
|
FIND FIRST OCCURRENCE OF '</STYLE' IN lv_line.
|
||||||
|
IF sy-subrc > 0. " Not found
|
||||||
|
rs_result-style_open = abap_true.
|
||||||
|
ENDIF.
|
||||||
|
ENDIF.
|
||||||
|
IF lv_len >= 2 AND lv_line(2) = '</'.
|
||||||
|
rs_result-tag_close = abap_true.
|
||||||
|
ENDIF.
|
||||||
|
|
||||||
|
FIND ALL OCCURRENCES OF '<' IN lv_line MATCH COUNT rs_result-openings.
|
||||||
|
FIND ALL OCCURRENCES OF '</' IN lv_line MATCH COUNT rs_result-closings.
|
||||||
|
FIND ALL OCCURRENCES OF REGEX go_single_tags_re IN lv_line MATCH COUNT rs_result-singles.
|
||||||
|
rs_result-openings = rs_result-openings - rs_result-closings - rs_result-singles.
|
||||||
|
|
||||||
|
ENDIF.
|
||||||
|
|
||||||
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
METHOD zif_abapgit_html~add_checkbox.
|
METHOD zif_abapgit_html~add_checkbox.
|
||||||
|
|
||||||
add( checkbox( iv_id ) ).
|
add( checkbox( iv_id ) ).
|
||||||
|
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
METHOD checkbox.
|
|
||||||
|
|
||||||
rv_html = |<input type="checkbox" id="{ iv_id }">|
|
|
||||||
&& |{ co_span_link_hint }|.
|
|
||||||
|
|
||||||
ENDMETHOD.
|
|
||||||
|
|
||||||
ENDCLASS.
|
ENDCLASS.
|
||||||
|
|
|
@ -746,8 +746,9 @@ CLASS ZCL_ABAPGIT_GUI_VIEW_REPO IMPLEMENTATION.
|
||||||
ro_html->add( '<div class="repo_container">' ).
|
ro_html->add( '<div class="repo_container">' ).
|
||||||
|
|
||||||
" Offline match banner
|
" Offline match banner
|
||||||
IF mo_repo->is_offline( ) = abap_true AND mo_repo->has_remote_source( ) = abap_true
|
IF mo_repo->is_offline( ) = abap_true
|
||||||
AND lv_lstate IS INITIAL AND lv_rstate IS INITIAL.
|
AND mo_repo->has_remote_source( ) = abap_true
|
||||||
|
AND lv_lstate IS INITIAL AND lv_rstate IS INITIAL.
|
||||||
ro_html->add(
|
ro_html->add(
|
||||||
|<div class="repo_banner panel success">|
|
|<div class="repo_banner panel success">|
|
||||||
&& |ZIP source is attached and completely <b>matches</b> to the local state|
|
&& |ZIP source is attached and completely <b>matches</b> to the local state|
|
||||||
|
|
|
@ -149,10 +149,8 @@ CLASS ZCL_ABAPGIT_CONVERT IMPLEMENTATION.
|
||||||
IF lv_bitbyte+lv_offset(1) = '1'.
|
IF lv_bitbyte+lv_offset(1) = '1'.
|
||||||
rv_int = 1.
|
rv_int = 1.
|
||||||
ENDIF.
|
ENDIF.
|
||||||
ELSE.
|
ELSEIF lv_bitbyte+lv_offset(1) = '1'.
|
||||||
IF lv_bitbyte+lv_offset(1) = '1'.
|
rv_int = rv_int + ( 2 ** ( sy-index - 1 ) ).
|
||||||
rv_int = rv_int + ( 2 ** ( sy-index - 1 ) ).
|
|
||||||
ENDIF.
|
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
|
||||||
lv_offset = lv_offset - 1. "Move Cursor
|
lv_offset = lv_offset - 1. "Move Cursor
|
||||||
|
@ -236,12 +234,12 @@ CLASS ZCL_ABAPGIT_CONVERT IMPLEMENTATION.
|
||||||
METHOD xstring_to_bintab.
|
METHOD xstring_to_bintab.
|
||||||
|
|
||||||
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
|
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
|
||||||
EXPORTING
|
EXPORTING
|
||||||
buffer = iv_xstr
|
buffer = iv_xstr
|
||||||
IMPORTING
|
IMPORTING
|
||||||
output_length = ev_size
|
output_length = ev_size
|
||||||
TABLES
|
TABLES
|
||||||
binary_tab = et_bintab.
|
binary_tab = et_bintab.
|
||||||
|
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
|
@ -78,9 +78,9 @@ CLASS ZCL_ABAPGIT_LOG IMPLEMENTATION.
|
||||||
METHOD zif_abapgit_log~add_error.
|
METHOD zif_abapgit_log~add_error.
|
||||||
|
|
||||||
zif_abapgit_log~add(
|
zif_abapgit_log~add(
|
||||||
iv_msg = iv_msg
|
iv_msg = iv_msg
|
||||||
iv_type = 'E'
|
iv_type = 'E'
|
||||||
is_item = is_item ).
|
is_item = is_item ).
|
||||||
|
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
|
@ -97,8 +97,9 @@ CLASS ZCL_ABAPGIT_PROGRESS IMPLEMENTATION.
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
|
||||||
"We only do a progress indication if enough time has passed
|
"We only do a progress indication if enough time has passed
|
||||||
IF lv_time >= mv_cv_time_next AND sy-datum = mv_cv_datum_next OR
|
IF lv_time >= mv_cv_time_next
|
||||||
sy-datum > mv_cv_datum_next.
|
AND sy-datum = mv_cv_datum_next
|
||||||
|
OR sy-datum > mv_cv_datum_next.
|
||||||
|
|
||||||
lv_pct = calc_pct( iv_current ).
|
lv_pct = calc_pct( iv_current ).
|
||||||
|
|
||||||
|
|
|
@ -143,12 +143,12 @@ CLASS ZCL_ABAPGIT_REQUIREMENT_HELPER IMPLEMENTATION.
|
||||||
|
|
||||||
METHOD show_requirement_popup.
|
METHOD show_requirement_popup.
|
||||||
|
|
||||||
|
|
||||||
TYPES: BEGIN OF lty_color_line,
|
TYPES: BEGIN OF lty_color_line,
|
||||||
color TYPE lvc_t_scol.
|
color TYPE lvc_t_scol.
|
||||||
INCLUDE TYPE ty_requirement_status.
|
INCLUDE TYPE ty_requirement_status.
|
||||||
TYPES: END OF lty_color_line,
|
TYPES: END OF lty_color_line.
|
||||||
lty_color_tab TYPE STANDARD TABLE OF lty_color_line WITH DEFAULT KEY.
|
|
||||||
|
TYPES: lty_color_tab TYPE STANDARD TABLE OF lty_color_line WITH DEFAULT KEY.
|
||||||
|
|
||||||
DATA: lo_alv TYPE REF TO cl_salv_table,
|
DATA: lo_alv TYPE REF TO cl_salv_table,
|
||||||
lo_column TYPE REF TO cl_salv_column,
|
lo_column TYPE REF TO cl_salv_column,
|
||||||
|
|
|
@ -172,7 +172,7 @@ CLASS ZCL_ABAPGIT_MERGE IMPLEMENTATION.
|
||||||
* added in source and target
|
* added in source and target
|
||||||
<ls_result>-sha1 = <ls_source>-sha1.
|
<ls_result>-sha1 = <ls_source>-sha1.
|
||||||
ELSEIF lv_found_common = abap_false
|
ELSEIF lv_found_common = abap_false
|
||||||
AND <ls_target>-sha1 <> <ls_source>-sha1.
|
AND <ls_target>-sha1 <> <ls_source>-sha1.
|
||||||
|
|
||||||
INSERT INITIAL LINE INTO TABLE mt_conflicts ASSIGNING <ls_conflict>.
|
INSERT INITIAL LINE INTO TABLE mt_conflicts ASSIGNING <ls_conflict>.
|
||||||
<ls_conflict>-path = <ls_file>-path.
|
<ls_conflict>-path = <ls_file>-path.
|
||||||
|
@ -197,8 +197,8 @@ CLASS ZCL_ABAPGIT_MERGE IMPLEMENTATION.
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
|
||||||
IF lv_found_source = abap_false
|
IF lv_found_source = abap_false
|
||||||
OR lv_found_target = abap_false
|
OR lv_found_target = abap_false
|
||||||
OR lv_found_common = abap_false.
|
OR lv_found_common = abap_false.
|
||||||
ms_merge-conflict = |{ <ls_file>-name } merge conflict, not found anywhere|.
|
ms_merge-conflict = |{ <ls_file>-name } merge conflict, not found anywhere|.
|
||||||
CONTINUE.
|
CONTINUE.
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
|
|
@ -163,8 +163,8 @@ CLASS ZCL_ABAPGIT_REPO_CONTENT_LIST IMPLEMENTATION.
|
||||||
ls_file-lstate = <ls_status>-lstate.
|
ls_file-lstate = <ls_status>-lstate.
|
||||||
APPEND ls_file TO <ls_repo_item>-files.
|
APPEND ls_file TO <ls_repo_item>-files.
|
||||||
|
|
||||||
IF <ls_status>-inactive = abap_true AND
|
IF <ls_status>-inactive = abap_true
|
||||||
<ls_repo_item>-sortkey > c_sortkey-changed.
|
AND <ls_repo_item>-sortkey > c_sortkey-changed.
|
||||||
<ls_repo_item>-sortkey = c_sortkey-inactive.
|
<ls_repo_item>-sortkey = c_sortkey-inactive.
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
|
||||||
|
|
|
@ -388,8 +388,8 @@ CLASS ZCL_ABAPGIT_SETTINGS IMPLEMENTATION.
|
||||||
METHOD set_ui_theme.
|
METHOD set_ui_theme.
|
||||||
ms_user_settings-ui_theme = iv_ui_theme.
|
ms_user_settings-ui_theme = iv_ui_theme.
|
||||||
IF ms_user_settings-ui_theme <> c_ui_theme-default
|
IF ms_user_settings-ui_theme <> c_ui_theme-default
|
||||||
AND ms_user_settings-ui_theme <> c_ui_theme-dark
|
AND ms_user_settings-ui_theme <> c_ui_theme-dark
|
||||||
AND ms_user_settings-ui_theme <> c_ui_theme-belize.
|
AND ms_user_settings-ui_theme <> c_ui_theme-belize.
|
||||||
ms_user_settings-ui_theme = c_ui_theme-default. " Reset to default
|
ms_user_settings-ui_theme = c_ui_theme-default. " Reset to default
|
||||||
ENDIF.
|
ENDIF.
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
|
@ -49,8 +49,7 @@ CLASS ZCL_ABAPGIT_SKIP_OBJECTS IMPLEMENTATION.
|
||||||
rt_tadir = it_tadir.
|
rt_tadir = it_tadir.
|
||||||
LOOP AT it_tadir INTO ls_tadir WHERE object = 'DDLS'.
|
LOOP AT it_tadir INTO ls_tadir WHERE object = 'DDLS'.
|
||||||
LOOP AT rt_tadir INTO ls_tadir_class
|
LOOP AT rt_tadir INTO ls_tadir_class
|
||||||
WHERE object = 'CLAS' AND obj_name CS ls_tadir-obj_name.
|
WHERE object = 'CLAS' AND obj_name CS ls_tadir-obj_name.
|
||||||
|
|
||||||
IF has_sadl_superclass( ls_tadir_class ) = abap_true.
|
IF has_sadl_superclass( ls_tadir_class ) = abap_true.
|
||||||
APPEND ls_tadir_class TO lt_lines_to_delete.
|
APPEND ls_tadir_class TO lt_lines_to_delete.
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
|
|
@ -63,8 +63,8 @@ CLASS ZCL_ABAPGIT_STAGE_LOGIC IMPLEMENTATION.
|
||||||
iv_path = <ls_remote>-path
|
iv_path = <ls_remote>-path
|
||||||
iv_filename = <ls_remote>-filename ) = abap_true.
|
iv_filename = <ls_remote>-filename ) = abap_true.
|
||||||
DELETE cs_files-remote INDEX lv_index.
|
DELETE cs_files-remote INDEX lv_index.
|
||||||
ELSEIF <ls_remote>-path = zif_abapgit_definitions=>c_root_dir
|
ELSEIF <ls_remote>-path = zif_abapgit_definitions=>c_root_dir
|
||||||
AND <ls_remote>-filename = zif_abapgit_definitions=>c_dot_abapgit.
|
AND <ls_remote>-filename = zif_abapgit_definitions=>c_dot_abapgit.
|
||||||
" Remove .abapgit from remotes - it cannot be removed or ignored
|
" Remove .abapgit from remotes - it cannot be removed or ignored
|
||||||
DELETE cs_files-remote INDEX lv_index.
|
DELETE cs_files-remote INDEX lv_index.
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
|
|
@ -229,11 +229,11 @@ CLASS lcl_transport_zipper IMPLEMENTATION.
|
||||||
|
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
METHOD get_filename .
|
METHOD get_filename.
|
||||||
|
|
||||||
* Generate filename
|
* Generate filename
|
||||||
CONCATENATE is_trkorr-trkorr '_' is_trkorr-as4text '_' gv_timestamp gc_zip_ext
|
CONCATENATE is_trkorr-trkorr '_' is_trkorr-as4text '_' gv_timestamp gc_zip_ext
|
||||||
INTO rv_filename.
|
INTO rv_filename.
|
||||||
|
|
||||||
* Remove reserved characters (for Windows based systems)
|
* Remove reserved characters (for Windows based systems)
|
||||||
TRANSLATE rv_filename USING '/ \ : " * > < ? | '.
|
TRANSLATE rv_filename USING '/ \ : " * > < ? | '.
|
||||||
|
@ -256,7 +256,7 @@ CLASS lcl_transport_zipper IMPLEMENTATION.
|
||||||
zcl_abapgit_zip=>save_binstring_to_localfile( iv_binstring = lv_zipbinstring
|
zcl_abapgit_zip=>save_binstring_to_localfile( iv_binstring = lv_zipbinstring
|
||||||
iv_filename = get_filename( ls_trkorr ) ).
|
iv_filename = get_filename( ls_trkorr ) ).
|
||||||
|
|
||||||
ENDLOOP. "it_trkorr
|
ENDLOOP.
|
||||||
|
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ ENDCLASS.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CLASS zcl_abapgit_transport_objects IMPLEMENTATION.
|
CLASS ZCL_ABAPGIT_TRANSPORT_OBJECTS IMPLEMENTATION.
|
||||||
|
|
||||||
|
|
||||||
METHOD constructor.
|
METHOD constructor.
|
||||||
|
@ -46,7 +46,7 @@ CLASS zcl_abapgit_transport_objects IMPLEMENTATION.
|
||||||
WHEN zif_abapgit_definitions=>c_state-added OR zif_abapgit_definitions=>c_state-modified.
|
WHEN zif_abapgit_definitions=>c_state-added OR zif_abapgit_definitions=>c_state-modified.
|
||||||
IF ls_transport_object-delflag = abap_true.
|
IF ls_transport_object-delflag = abap_true.
|
||||||
zcx_abapgit_exception=>raise( |Object { ls_transport_object-obj_name
|
zcx_abapgit_exception=>raise( |Object { ls_transport_object-obj_name
|
||||||
} should be added/modified, but has deletion flag in transport| ).
|
} should be added/modified, but has deletion flag in transport| ).
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
|
||||||
READ TABLE is_stage_objects-local
|
READ TABLE is_stage_objects-local
|
||||||
|
@ -56,7 +56,7 @@ CLASS zcl_abapgit_transport_objects IMPLEMENTATION.
|
||||||
file-filename = ls_object_status-filename.
|
file-filename = ls_object_status-filename.
|
||||||
IF sy-subrc <> 0.
|
IF sy-subrc <> 0.
|
||||||
zcx_abapgit_exception=>raise( |Object { ls_transport_object-obj_name
|
zcx_abapgit_exception=>raise( |Object { ls_transport_object-obj_name
|
||||||
} not found in the local repository files| ).
|
} not found in the local repository files| ).
|
||||||
ELSE.
|
ELSE.
|
||||||
io_stage->add(
|
io_stage->add(
|
||||||
iv_path = ls_local_file-file-path
|
iv_path = ls_local_file-file-path
|
||||||
|
@ -66,7 +66,7 @@ CLASS zcl_abapgit_transport_objects IMPLEMENTATION.
|
||||||
WHEN zif_abapgit_definitions=>c_state-deleted.
|
WHEN zif_abapgit_definitions=>c_state-deleted.
|
||||||
IF ls_transport_object-delflag = abap_false.
|
IF ls_transport_object-delflag = abap_false.
|
||||||
zcx_abapgit_exception=>raise( |Object { ls_transport_object-obj_name
|
zcx_abapgit_exception=>raise( |Object { ls_transport_object-obj_name
|
||||||
} should be removed, but has NO deletion flag in transport| ).
|
} should be removed, but has NO deletion flag in transport| ).
|
||||||
ENDIF.
|
ENDIF.
|
||||||
io_stage->rm(
|
io_stage->rm(
|
||||||
iv_path = ls_object_status-path
|
iv_path = ls_object_status-path
|
||||||
|
|
|
@ -214,9 +214,9 @@ CLASS ltcl_transport_objects IMPLEMENTATION.
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
METHOD deleted_to_removed_files.
|
METHOD deleted_to_removed_files.
|
||||||
given_the_transport_object(
|
given_the_transport_object(
|
||||||
iv_obj_name = 'CL_FOO'
|
iv_obj_name = 'CL_FOO'
|
||||||
iv_obj_type = 'CLAS'
|
iv_obj_type = 'CLAS'
|
||||||
iv_delflag = abap_true ).
|
iv_delflag = abap_true ).
|
||||||
|
|
||||||
given_the_object_status(
|
given_the_object_status(
|
||||||
iv_obj_name = 'CL_FOO'
|
iv_obj_name = 'CL_FOO'
|
||||||
|
@ -235,9 +235,9 @@ CLASS ltcl_transport_objects IMPLEMENTATION.
|
||||||
METHOD should_delete_all_related.
|
METHOD should_delete_all_related.
|
||||||
"i.e. Should also delete the XMLs related to the transport objects
|
"i.e. Should also delete the XMLs related to the transport objects
|
||||||
given_the_transport_object(
|
given_the_transport_object(
|
||||||
iv_obj_name = 'CL_FOO'
|
iv_obj_name = 'CL_FOO'
|
||||||
iv_obj_type = 'CLAS'
|
iv_obj_type = 'CLAS'
|
||||||
iv_delflag = abap_true ).
|
iv_delflag = abap_true ).
|
||||||
|
|
||||||
given_the_object_status(
|
given_the_object_status(
|
||||||
iv_obj_name = 'CL_FOO'
|
iv_obj_name = 'CL_FOO'
|
||||||
|
@ -323,10 +323,11 @@ CLASS ltcl_transport_objects IMPLEMENTATION.
|
||||||
lt_staged_objects = mo_stage->get_all( ).
|
lt_staged_objects = mo_stage->get_all( ).
|
||||||
|
|
||||||
READ TABLE lt_staged_objects TRANSPORTING NO FIELDS
|
READ TABLE lt_staged_objects TRANSPORTING NO FIELDS
|
||||||
WITH KEY file-filename = is_local_file-file-filename
|
WITH KEY
|
||||||
file-path = is_local_file-file-path
|
file-filename = is_local_file-file-filename
|
||||||
file-data = is_local_file-file-data
|
file-path = is_local_file-file-path
|
||||||
method = zcl_abapgit_stage=>c_method-add.
|
file-data = is_local_file-file-data
|
||||||
|
method = zcl_abapgit_stage=>c_method-add.
|
||||||
IF sy-subrc <> 0.
|
IF sy-subrc <> 0.
|
||||||
cl_abap_unit_assert=>fail( |Object { is_local_file-file-filename } not added to stage| ).
|
cl_abap_unit_assert=>fail( |Object { is_local_file-file-filename } not added to stage| ).
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
@ -352,8 +353,9 @@ CLASS ltcl_transport_objects IMPLEMENTATION.
|
||||||
lt_staged_objects = mo_stage->get_all( ).
|
lt_staged_objects = mo_stage->get_all( ).
|
||||||
|
|
||||||
READ TABLE lt_staged_objects TRANSPORTING NO FIELDS
|
READ TABLE lt_staged_objects TRANSPORTING NO FIELDS
|
||||||
WITH KEY file-filename = iv_filename
|
WITH KEY
|
||||||
file-path = iv_path.
|
file-filename = iv_filename
|
||||||
|
file-path = iv_path.
|
||||||
IF sy-subrc <> 0.
|
IF sy-subrc <> 0.
|
||||||
cl_abap_unit_assert=>fail( |Object { iv_filename } not removed in stage| ).
|
cl_abap_unit_assert=>fail( |Object { iv_filename } not removed in stage| ).
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user