Merge branch 'main' into SAJC

This commit is contained in:
Lars Hvam 2024-10-15 23:23:43 +02:00 committed by GitHub
commit 19e5cf9583
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
65 changed files with 570 additions and 433 deletions

View File

@ -11,11 +11,43 @@
"folder": "/deps" "folder": "/deps"
}, },
{ {
"url": "https://github.com/abaplint/deps",
"files": "/src/**/*.*", "files": "/src/**/*.*",
"folder": "/lint_deps", "folder": "/lint_deps"
"url": "https://github.com/abaplint/deps"
} }
], ],
"syntax": {
"errorNamespace": "^(Z|Y|LT?CL_|TY_|LIF_|C_|.*ABAPGIT)",
"globalConstants": [
"abap_func_exporting",
"abap_func_tables",
"cssf_formtype_text",
"seok_access_free",
"seok_access_modify",
"sews_c_vif_version",
"skwfc_obtype_folder",
"skwfc_obtype_loio",
"so2_controller",
"srext_ext_class_pool",
"srext_ext_interface_pool",
"ststc_c_type_dialog",
"ststc_c_type_object",
"ststc_c_type_parameters",
"ststc_c_type_report",
"swbm_c_op_delete_no_dialog",
"swbm_c_type_ddic_db_tabxinx",
"swbm_c_type_wdy_application",
"swbm_version_active",
"swbm_version_inactive",
"swfco_org_standard_task",
"swfco_org_workflow_template",
"wbmr_c_skwf_folder_class",
"wdyn_limu_component_controller",
"wdyn_limu_component_definition",
"wdyn_limu_component_view"
],
"version": "v702"
},
"rules": { "rules": {
"7bit_ascii": { "7bit_ascii": {
"exclude": [ "exclude": [
@ -25,6 +57,7 @@
] ]
}, },
"abapdoc": false, "abapdoc": false,
"align_type_expressions": true,
"align_pseudo_comments": false, "align_pseudo_comments": false,
"invalid_table_index": true, "invalid_table_index": true,
"tables_declared_locally": true, "tables_declared_locally": true,
@ -259,7 +292,7 @@
"/json/", "/json/",
"zcl_abapgit_object_pdts.clas.testclasses.abap" "zcl_abapgit_object_pdts.clas.testclasses.abap"
], ],
"length": 120 "length": 125
}, },
"line_only_punc": { "line_only_punc": {
"ignoreExceptions": true "ignoreExceptions": true
@ -468,37 +501,5 @@
"when_others_last": true, "when_others_last": true,
"whitespace_end": true, "whitespace_end": true,
"xml_consistency": true "xml_consistency": true
},
"syntax": {
"errorNamespace": "^(Z|Y|LT?CL_|TY_|LIF_|C_|.*ABAPGIT)",
"globalConstants": [
"abap_func_exporting",
"abap_func_tables",
"cssf_formtype_text",
"seok_access_free",
"seok_access_modify",
"sews_c_vif_version",
"skwfc_obtype_folder",
"skwfc_obtype_loio",
"so2_controller",
"srext_ext_class_pool",
"srext_ext_interface_pool",
"ststc_c_type_dialog",
"ststc_c_type_object",
"ststc_c_type_parameters",
"ststc_c_type_report",
"swbm_c_op_delete_no_dialog",
"swbm_c_type_ddic_db_tabxinx",
"swbm_c_type_wdy_application",
"swbm_version_active",
"swbm_version_inactive",
"swfco_org_standard_task",
"swfco_org_workflow_template",
"wbmr_c_skwf_folder_class",
"wdyn_limu_component_controller",
"wdyn_limu_component_definition",
"wdyn_limu_component_view"
],
"version": "v702"
} }
} }

View File

@ -481,9 +481,10 @@ CLASS zcl_abapgit_git_pack IMPLEMENTATION.
ls_node-chmod = lv_chmod. ls_node-chmod = lv_chmod.
IF ls_node-chmod <> zif_abapgit_git_definitions=>c_chmod-dir IF ls_node-chmod <> zif_abapgit_git_definitions=>c_chmod-dir
AND ls_node-chmod <> zif_abapgit_git_definitions=>c_chmod-file AND ls_node-chmod <> zif_abapgit_git_definitions=>c_chmod-file
AND ls_node-chmod <> zif_abapgit_git_definitions=>c_chmod-symbolic_link
AND ls_node-chmod <> zif_abapgit_git_definitions=>c_chmod-executable AND ls_node-chmod <> zif_abapgit_git_definitions=>c_chmod-executable
AND ls_node-chmod <> zif_abapgit_git_definitions=>c_chmod-submodule. AND ls_node-chmod <> zif_abapgit_git_definitions=>c_chmod-submodule.
zcx_abapgit_exception=>raise( |Unknown chmod| ). zcx_abapgit_exception=>raise( |Unknown chmod { ls_node-chmod }| ).
ENDIF. ENDIF.
lv_offset = lv_match + 1. lv_offset = lv_match + 1.

View File

@ -809,6 +809,7 @@ CLASS zcl_abapgit_git_porcelain IMPLEMENTATION.
CASE <ls_node>-chmod. CASE <ls_node>-chmod.
WHEN zif_abapgit_git_definitions=>c_chmod-file WHEN zif_abapgit_git_definitions=>c_chmod-file
OR zif_abapgit_git_definitions=>c_chmod-executable OR zif_abapgit_git_definitions=>c_chmod-executable
OR zif_abapgit_git_definitions=>c_chmod-symbolic_link
OR zif_abapgit_git_definitions=>c_chmod-submodule. OR zif_abapgit_git_definitions=>c_chmod-submodule.
APPEND INITIAL LINE TO rt_expanded ASSIGNING <ls_exp>. APPEND INITIAL LINE TO rt_expanded ASSIGNING <ls_exp>.
<ls_exp>-path = iv_base. <ls_exp>-path = iv_base.
@ -822,7 +823,7 @@ CLASS zcl_abapgit_git_porcelain IMPLEMENTATION.
iv_base = iv_base && <ls_node>-name && '/' ). iv_base = iv_base && <ls_node>-name && '/' ).
APPEND LINES OF lt_expanded TO rt_expanded. APPEND LINES OF lt_expanded TO rt_expanded.
WHEN OTHERS. WHEN OTHERS.
zcx_abapgit_exception=>raise( 'walk_tree: unknown chmod' ). zcx_abapgit_exception=>raise( |walk_tree: unknown chmod { <ls_node>-chmod }| ).
ENDCASE. ENDCASE.
ENDLOOP. ENDLOOP.

View File

@ -82,6 +82,7 @@ INTERFACE zif_abapgit_git_definitions
executable TYPE ty_chmod VALUE '100755', executable TYPE ty_chmod VALUE '100755',
dir TYPE ty_chmod VALUE '40000 ', dir TYPE ty_chmod VALUE '40000 ',
submodule TYPE ty_chmod VALUE '160000', submodule TYPE ty_chmod VALUE '160000',
symbolic_link TYPE ty_chmod VALUE '120000',
END OF c_chmod . END OF c_chmod .
TYPES: TYPES:

View File

@ -46,7 +46,7 @@ CLASS zcl_abapgit_objects_activation DEFINITION
CONSTANTS: CONSTANTS:
c_domain TYPE c LENGTH 9 VALUE 'DOMA DOMD', c_domain TYPE c LENGTH 9 VALUE 'DOMA DOMD',
c_types TYPE c LENGTH 50 VALUE 'DTEL DTED TABL TABD SQLT SQLD TTYP TTYD VIEW VIED', c_types TYPE c LENGTH 55 VALUE 'DTEL DTED TABL TABD SQLT SQLD TTYP TTYD VIEW VIED DRTY',
c_technset TYPE c LENGTH 24 VALUE 'TABT VIET SQTT INDX XINX', c_technset TYPE c LENGTH 24 VALUE 'TABT VIET SQTT INDX XINX',
c_f4_objects TYPE c LENGTH 35 VALUE 'SHLP SHLD MCOB MCOD MACO MACD MCID', c_f4_objects TYPE c LENGTH 35 VALUE 'SHLP SHLD MCOB MCOD MACO MACD MCID',
c_enqueue TYPE c LENGTH 9 VALUE 'ENQU ENQD', c_enqueue TYPE c LENGTH 9 VALUE 'ENQU ENQD',

View File

@ -37,7 +37,10 @@ CLASS ltcl_field_rules DEFINITION FOR TESTING RISK LEVEL HARMLESS
RETURNING RETURNING
VALUE(ri_rules) TYPE REF TO zif_abapgit_field_rules, VALUE(ri_rules) TYPE REF TO zif_abapgit_field_rules,
apply_clear_logic FOR TESTING, apply_clear_logic FOR TESTING,
apply_fill_logic FOR TESTING. apply_fill_logic FOR TESTING,
get_utc_timestamp
RETURNING
VALUE(rv_timestamp) TYPE timestamp.
ENDCLASS. ENDCLASS.
@ -84,10 +87,12 @@ CLASS ltcl_field_rules IMPLEMENTATION.
ENDMETHOD. ENDMETHOD.
METHOD fill3. METHOD fill3.
DATA lv_timestamp TYPE timestamp.
lv_timestamp = get_utc_timestamp( ).
fill_value( fill_value(
iv_rule = zif_abapgit_field_rules=>c_fill_rule-timestamp iv_rule = zif_abapgit_field_rules=>c_fill_rule-timestamp
iv_len = 10 iv_len = 10
iv_exp = |{ sy-datum }{ sy-uzeit(2) }| ). " avoid comparing minutes iv_exp = |{ lv_timestamp DIV 10000 }| ). " avoid comparing minutes
ENDMETHOD. ENDMETHOD.
METHOD fill4. METHOD fill4.
@ -197,7 +202,8 @@ CLASS ltcl_field_rules IMPLEMENTATION.
li_rules TYPE REF TO zif_abapgit_field_rules, li_rules TYPE REF TO zif_abapgit_field_rules,
ls_act TYPE ty_test, ls_act TYPE ty_test,
lt_act TYPE STANDARD TABLE OF ty_test, lt_act TYPE STANDARD TABLE OF ty_test,
lv_ts TYPE string. lv_ts TYPE string,
lv_timestamp TYPE timestamp.
ls_act-key = 1. ls_act-key = 1.
INSERT ls_act INTO TABLE lt_act. INSERT ls_act INTO TABLE lt_act.
@ -235,16 +241,17 @@ CLASS ltcl_field_rules IMPLEMENTATION.
act = ls_act-time(4) act = ls_act-time(4)
exp = sy-uzeit(4) ). " avoid comparing seconds exp = sy-uzeit(4) ). " avoid comparing seconds
lv_timestamp = get_utc_timestamp( ).
lv_ts = ls_act-ts. lv_ts = ls_act-ts.
lv_ts = lv_ts(12). lv_ts = lv_ts(12).
cl_abap_unit_assert=>assert_equals( cl_abap_unit_assert=>assert_equals(
act = lv_ts act = lv_ts
exp = |{ sy-datum }{ sy-uzeit(4) }| ). " avoid comparing seconds exp = |{ lv_timestamp DIV 100 }| ). " avoid comparing second
lv_ts = ls_act-tl. lv_ts = ls_act-tl.
lv_ts = lv_ts(12). lv_ts = lv_ts(12).
cl_abap_unit_assert=>assert_equals( cl_abap_unit_assert=>assert_equals(
act = lv_ts act = lv_ts
exp = |{ sy-datum }{ sy-uzeit(4) }| ). " avoid comparing seconds exp = |{ lv_timestamp DIV 100 }| ). " avoid comparing seconds
READ TABLE lt_act INTO ls_act INDEX 2. READ TABLE lt_act INTO ls_act INDEX 2.
@ -263,4 +270,20 @@ CLASS ltcl_field_rules IMPLEMENTATION.
ENDMETHOD. ENDMETHOD.
METHOD get_utc_timestamp.
DATA lv_syst_timezone TYPE timezone.
CALL FUNCTION 'GET_SYSTEM_TIMEZONE'
IMPORTING
timezone = lv_syst_timezone
EXCEPTIONS
customizing_missing = 1
OTHERS = 2.
IF sy-subrc <> 0.
cl_abap_unit_assert=>fail( 'Could not get system timezone' ).
ENDIF.
CONVERT DATE sy-datum TIME sy-uzeit
INTO TIME STAMP rv_timestamp
TIME ZONE lv_syst_timezone.
ENDMETHOD.
ENDCLASS. ENDCLASS.

View File

@ -1,7 +1,11 @@
CLASS zcl_abapgit_object_fugr DEFINITION PUBLIC INHERITING FROM zcl_abapgit_objects_program FINAL. CLASS zcl_abapgit_object_fugr DEFINITION
PUBLIC
INHERITING FROM zcl_abapgit_objects_program
CREATE PUBLIC .
PUBLIC SECTION. PUBLIC SECTION.
INTERFACES zif_abapgit_object.
INTERFACES zif_abapgit_object .
PROTECTED SECTION. PROTECTED SECTION.
PRIVATE SECTION. PRIVATE SECTION.
@ -768,6 +772,7 @@ CLASS zcl_abapgit_object_fugr IMPLEMENTATION.
DATA lv_namespace TYPE rs38l-namespace. DATA lv_namespace TYPE rs38l-namespace.
DATA lv_function_group TYPE rs38l-area. DATA lv_function_group TYPE rs38l-area.
DATA lv_include TYPE rs38l-include. DATA lv_include TYPE rs38l-include.
DATA ls_item_key TYPE zif_abapgit_definitions=>ty_item.
rv_belongs_to_other_fugr = abap_false. rv_belongs_to_other_fugr = abap_false.
IF iv_include(1) = 'L' OR iv_include+1 CS '/L'. IF iv_include(1) = 'L' OR iv_include+1 CS '/L'.
@ -785,14 +790,22 @@ CLASS zcl_abapgit_object_fugr IMPLEMENTATION.
IF lv_function_group(1) = 'X'. " "EXIT"-function-module IF lv_function_group(1) = 'X'. " "EXIT"-function-module
ls_tadir-object = 'FUGS'. ls_tadir-object = 'FUGS'.
ENDIF. ENDIF.
IF sy-subrc = 0. IF sy-subrc = 0.
CONCATENATE lv_namespace lv_function_group INTO ls_tadir-obj_name. CONCATENATE lv_namespace lv_function_group INTO ls_tadir-obj_name.
ls_item_key-obj_type = ls_tadir-object.
ls_item_key-obj_name = ls_tadir-obj_name.
" compare complete tadir key to distinguish between regular and exit function groups " compare complete tadir key to distinguish between regular and exit function groups
IF ls_tadir-obj_name <> ms_item-obj_name OR ls_tadir-object <> ms_item-obj_type. IF ( ls_tadir-obj_name <> ms_item-obj_name OR ls_tadir-object <> ms_item-obj_type ) AND
zcl_abapgit_objects=>exists( ls_item_key ) = abap_true.
rv_belongs_to_other_fugr = abap_true. rv_belongs_to_other_fugr = abap_true.
ENDIF. ENDIF.
ENDIF. ENDIF.
ENDIF. ENDIF.
ENDMETHOD. ENDMETHOD.
@ -945,7 +958,6 @@ CLASS zcl_abapgit_object_fugr IMPLEMENTATION.
FIELD-SYMBOLS: <lv_include> LIKE LINE OF lt_includes. FIELD-SYMBOLS: <lv_include> LIKE LINE OF lt_includes.
lt_includes = includes( ). lt_includes = includes( ).
LOOP AT lt_includes ASSIGNING <lv_include>. LOOP AT lt_includes ASSIGNING <lv_include>.

View File

@ -0,0 +1,17 @@
CLASS zcl_abapgit_object_fugs DEFINITION
PUBLIC
INHERITING FROM zcl_abapgit_object_fugr
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS zcl_abapgit_object_fugs IMPLEMENTATION.
ENDCLASS.

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<abapGit version="v1.0.0" serializer="LCL_OBJECT_CLAS" serializer_version="v1.0.0">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<VSEOCLASS>
<CLSNAME>ZCL_ABAPGIT_OBJECT_FUGS</CLSNAME>
<LANGU>E</LANGU>
<DESCRIPT>abapGit - FUGS</DESCRIPT>
<STATE>1</STATE>
<CLSCCINCL>X</CLSCCINCL>
<FIXPT>X</FIXPT>
<UNICODE>X</UNICODE>
</VSEOCLASS>
</asx:values>
</asx:abap>
</abapGit>

View File

@ -154,6 +154,7 @@ CLASS zcl_abapgit_objects_program DEFINITION
!it_source TYPE abaptxt255_tab !it_source TYPE abaptxt255_tab
!iv_title TYPE repti !iv_title TYPE repti
!iv_package TYPE devclass !iv_package TYPE devclass
!iv_state TYPE progdir-state DEFAULT c_state-inactive
RAISING RAISING
zcx_abapgit_exception . zcx_abapgit_exception .
METHODS update_program METHODS update_program
@ -161,8 +162,22 @@ CLASS zcl_abapgit_objects_program DEFINITION
!is_progdir TYPE zif_abapgit_sap_report=>ty_progdir !is_progdir TYPE zif_abapgit_sap_report=>ty_progdir
!it_source TYPE abaptxt255_tab !it_source TYPE abaptxt255_tab
!iv_title TYPE repti !iv_title TYPE repti
!iv_state TYPE progdir-state DEFAULT c_state-inactive
RAISING RAISING
zcx_abapgit_exception . zcx_abapgit_exception .
METHODS is_exit_include
IMPORTING
!iv_program TYPE syrepid
RETURNING
VALUE(rv_is_exit_include) TYPE abap_bool.
METHODS deserialize_exit_include
IMPORTING
!is_progdir TYPE zif_abapgit_sap_report=>ty_progdir
!it_source TYPE abaptxt255_tab
!it_tpool TYPE textpool_table
!iv_package TYPE devclass
RAISING
zcx_abapgit_exception.
ENDCLASS. ENDCLASS.
@ -456,12 +471,53 @@ CLASS zcl_abapgit_objects_program IMPLEMENTATION.
ENDMETHOD. ENDMETHOD.
METHOD deserialize_exit_include.
DATA:
lv_progname TYPE reposrc-progname,
lv_title TYPE rglif-title.
" Includes in SAP exit function groups must be processed in active state only
" (check in RS_INSERT_INTO_WORKING_AREA)
lv_title = get_program_title( it_tpool ).
SELECT SINGLE progname FROM reposrc INTO lv_progname
WHERE progname = is_progdir-name
AND r3state = c_state-active.
IF sy-subrc = 0.
update_program(
is_progdir = is_progdir
it_source = it_source
iv_title = lv_title
iv_state = '' ).
ELSE.
insert_program(
is_progdir = is_progdir
it_source = it_source
iv_title = lv_title
iv_package = iv_package
iv_state = '' ).
ENDIF.
ENDMETHOD.
METHOD deserialize_program. METHOD deserialize_program.
DATA: DATA:
lv_progname TYPE reposrc-progname, lv_progname TYPE reposrc-progname,
lv_title TYPE rglif-title. lv_title TYPE rglif-title.
IF is_exit_include( is_progdir-name ) = abap_true.
deserialize_exit_include(
is_progdir = is_progdir
it_source = it_source
it_tpool = it_tpool
iv_package = iv_package ).
RETURN.
ENDIF.
zcl_abapgit_factory=>get_cts_api( )->insert_transport_object( zcl_abapgit_factory=>get_cts_api( )->insert_transport_object(
iv_object = 'ABAP' iv_object = 'ABAP'
iv_obj_name = is_progdir-name iv_obj_name = is_progdir-name
@ -579,7 +635,7 @@ CLASS zcl_abapgit_objects_program IMPLEMENTATION.
program_name = is_progdir-name program_name = is_progdir-name
program_type = is_progdir-subc program_type = is_progdir-subc
title_string = iv_title title_string = iv_title
save_inactive = c_state-inactive save_inactive = iv_state
suppress_dialog = abap_true suppress_dialog = abap_true
uccheck = is_progdir-uccheck " does not exist on lower releases uccheck = is_progdir-uccheck " does not exist on lower releases
TABLES TABLES
@ -597,7 +653,7 @@ CLASS zcl_abapgit_objects_program IMPLEMENTATION.
program_name = is_progdir-name program_name = is_progdir-name
program_type = is_progdir-subc program_type = is_progdir-subc
title_string = iv_title title_string = iv_title
save_inactive = c_state-inactive save_inactive = iv_state
suppress_dialog = abap_true suppress_dialog = abap_true
TABLES TABLES
source_extended = it_source source_extended = it_source
@ -674,6 +730,13 @@ CLASS zcl_abapgit_objects_program IMPLEMENTATION.
ENDMETHOD. ENDMETHOD.
METHOD is_exit_include.
rv_is_exit_include = boolc(
iv_program CP 'LX*' OR iv_program CP 'SAPLX*' OR
iv_program+1 CP '/LX*' OR iv_program+1 CP '/SAPLX*' ).
ENDMETHOD.
METHOD is_text_locked. METHOD is_text_locked.
DATA: lv_object TYPE eqegraarg. DATA: lv_object TYPE eqegraarg.
@ -1062,7 +1125,7 @@ CLASS zcl_abapgit_objects_program IMPLEMENTATION.
EXPORTING EXPORTING
program_name = is_progdir-name program_name = is_progdir-name
title_string = iv_title title_string = iv_title
save_inactive = c_state-inactive save_inactive = iv_state
TABLES TABLES
source_extended = it_source source_extended = it_source
EXCEPTIONS EXCEPTIONS
@ -1080,7 +1143,9 @@ CLASS zcl_abapgit_objects_program IMPLEMENTATION.
" for generated table maintenance function groups, the author is set to SAP* instead of the user which " for generated table maintenance function groups, the author is set to SAP* instead of the user which
" generates the function group. This hits some standard checks, pulling new code again sets the author " generates the function group. This hits some standard checks, pulling new code again sets the author
" to the current user which avoids the check " to the current user which avoids the check
IF is_exit_include( is_progdir-name ) = abap_false.
zcx_abapgit_exception=>raise( |Delete function group and pull again, { is_progdir-name } (EU522)| ). zcx_abapgit_exception=>raise( |Delete function group and pull again, { is_progdir-name } (EU522)| ).
ENDIF.
ELSE. ELSE.
zcx_abapgit_exception=>raise_t100( ). zcx_abapgit_exception=>raise_t100( ).
ENDIF. ENDIF.