mirror of
https://github.com/abapGit/abapGit.git
synced 2025-04-30 20:03:20 +08:00
move more git definitions (#6365)
This commit is contained in:
parent
a8bce57373
commit
1d8af69ae3
|
@ -5,7 +5,7 @@ CLASS zcl_abapgit_git_commit DEFINITION
|
|||
PUBLIC SECTION.
|
||||
TYPES:
|
||||
BEGIN OF ty_pull_result,
|
||||
commits TYPE zif_abapgit_definitions=>ty_commit_tt,
|
||||
commits TYPE zif_abapgit_git_definitions=>ty_commit_tt,
|
||||
commit TYPE zif_abapgit_git_definitions=>ty_sha1,
|
||||
END OF ty_pull_result .
|
||||
|
||||
|
@ -25,25 +25,25 @@ CLASS zcl_abapgit_git_commit DEFINITION
|
|||
!iv_repo_url TYPE string
|
||||
!iv_deepen_level TYPE i
|
||||
RETURNING
|
||||
VALUE(rt_commits) TYPE zif_abapgit_definitions=>ty_commit_tt
|
||||
VALUE(rt_commits) TYPE zif_abapgit_git_definitions=>ty_commit_tt
|
||||
RAISING
|
||||
zcx_abapgit_exception .
|
||||
CLASS-METHODS parse_commits
|
||||
IMPORTING
|
||||
!it_objects TYPE zif_abapgit_definitions=>ty_objects_tt
|
||||
RETURNING
|
||||
VALUE(rt_commits) TYPE zif_abapgit_definitions=>ty_commit_tt
|
||||
VALUE(rt_commits) TYPE zif_abapgit_git_definitions=>ty_commit_tt
|
||||
RAISING
|
||||
zcx_abapgit_exception .
|
||||
CLASS-METHODS sort_commits
|
||||
CHANGING
|
||||
!ct_commits TYPE zif_abapgit_definitions=>ty_commit_tt
|
||||
!ct_commits TYPE zif_abapgit_git_definitions=>ty_commit_tt
|
||||
RAISING
|
||||
zcx_abapgit_exception .
|
||||
CLASS-METHODS reverse_sort_order
|
||||
CHANGING
|
||||
!ct_commits TYPE zif_abapgit_definitions=>ty_commit_tt .
|
||||
CLASS-METHODS clear_missing_parents CHANGING ct_commits TYPE zif_abapgit_definitions=>ty_commit_tt .
|
||||
!ct_commits TYPE zif_abapgit_git_definitions=>ty_commit_tt .
|
||||
CLASS-METHODS clear_missing_parents CHANGING ct_commits TYPE zif_abapgit_git_definitions=>ty_commit_tt .
|
||||
PROTECTED SECTION.
|
||||
PRIVATE SECTION.
|
||||
TYPES: ty_sha1_range TYPE RANGE OF zif_abapgit_git_definitions=>ty_sha1 .
|
||||
|
@ -53,13 +53,13 @@ CLASS zcl_abapgit_git_commit DEFINITION
|
|||
it_commit_sha1s TYPE ty_sha1_range
|
||||
EXPORTING
|
||||
et_commit_sha1s TYPE ty_sha1_range
|
||||
es_1st_commit TYPE zif_abapgit_definitions=>ty_commit
|
||||
es_1st_commit TYPE zif_abapgit_git_definitions=>ty_commit
|
||||
CHANGING
|
||||
ct_commits TYPE zif_abapgit_definitions=>ty_commit_tt .
|
||||
ct_commits TYPE zif_abapgit_git_definitions=>ty_commit_tt .
|
||||
|
||||
CLASS-METHODS is_missing
|
||||
IMPORTING
|
||||
it_commits TYPE zif_abapgit_definitions=>ty_commit_tt
|
||||
it_commits TYPE zif_abapgit_git_definitions=>ty_commit_tt
|
||||
iv_sha1 TYPE zif_abapgit_git_definitions=>ty_sha1
|
||||
RETURNING
|
||||
VALUE(rv_result) TYPE abap_bool.
|
||||
|
@ -68,9 +68,9 @@ CLASS zcl_abapgit_git_commit DEFINITION
|
|||
IMPORTING
|
||||
!iv_author TYPE string
|
||||
EXPORTING
|
||||
!ev_author TYPE zif_abapgit_definitions=>ty_commit-author
|
||||
!ev_email TYPE zif_abapgit_definitions=>ty_commit-email
|
||||
!ev_time TYPE zif_abapgit_definitions=>ty_commit-time
|
||||
!ev_author TYPE zif_abapgit_git_definitions=>ty_commit-author
|
||||
!ev_email TYPE zif_abapgit_git_definitions=>ty_commit-email
|
||||
!ev_time TYPE zif_abapgit_git_definitions=>ty_commit-time
|
||||
RAISING
|
||||
zcx_abapgit_exception .
|
||||
ENDCLASS.
|
||||
|
@ -98,7 +98,7 @@ CLASS zcl_abapgit_git_commit IMPLEMENTATION.
|
|||
|
||||
"Part of #4719 to handle cut commit sequences, todo
|
||||
|
||||
FIELD-SYMBOLS: <ls_commit> TYPE zif_abapgit_definitions=>ty_commit.
|
||||
FIELD-SYMBOLS: <ls_commit> TYPE zif_abapgit_git_definitions=>ty_commit.
|
||||
|
||||
LOOP AT ct_commits ASSIGNING <ls_commit>.
|
||||
|
||||
|
@ -119,11 +119,11 @@ CLASS zcl_abapgit_git_commit IMPLEMENTATION.
|
|||
|
||||
METHOD get_1st_child_commit.
|
||||
|
||||
DATA: lt_1stchild_commits TYPE zif_abapgit_definitions=>ty_commit_tt,
|
||||
DATA: lt_1stchild_commits TYPE zif_abapgit_git_definitions=>ty_commit_tt,
|
||||
ls_parent LIKE LINE OF it_commit_sha1s,
|
||||
lt_commit_sha1s LIKE it_commit_sha1s.
|
||||
|
||||
FIELD-SYMBOLS: <ls_child_commit> TYPE zif_abapgit_definitions=>ty_commit.
|
||||
FIELD-SYMBOLS: <ls_child_commit> TYPE zif_abapgit_git_definitions=>ty_commit.
|
||||
|
||||
CLEAR: es_1st_commit.
|
||||
|
||||
|
@ -176,7 +176,7 @@ CLASS zcl_abapgit_git_commit IMPLEMENTATION.
|
|||
ev_branch = rs_pull_result-commit
|
||||
et_objects = lt_objects ).
|
||||
|
||||
DELETE lt_objects WHERE type <> zif_abapgit_definitions=>c_type-commit.
|
||||
DELETE lt_objects WHERE type <> zif_abapgit_git_definitions=>c_type-commit.
|
||||
|
||||
rs_pull_result-commits = parse_commits( lt_objects ).
|
||||
|
||||
|
@ -206,7 +206,7 @@ CLASS zcl_abapgit_git_commit IMPLEMENTATION.
|
|||
IMPORTING
|
||||
et_objects = lt_objects ).
|
||||
|
||||
DELETE lt_objects WHERE type <> zif_abapgit_definitions=>c_type-commit.
|
||||
DELETE lt_objects WHERE type <> zif_abapgit_git_definitions=>c_type-commit.
|
||||
|
||||
rt_commits = parse_commits( lt_objects ).
|
||||
sort_commits( CHANGING ct_commits = rt_commits ).
|
||||
|
@ -230,7 +230,7 @@ CLASS zcl_abapgit_git_commit IMPLEMENTATION.
|
|||
|
||||
METHOD parse_commits.
|
||||
|
||||
DATA: ls_commit TYPE zif_abapgit_definitions=>ty_commit,
|
||||
DATA: ls_commit TYPE zif_abapgit_git_definitions=>ty_commit,
|
||||
lt_body TYPE STANDARD TABLE OF string WITH DEFAULT KEY,
|
||||
ls_raw TYPE zcl_abapgit_git_pack=>ty_commit.
|
||||
|
||||
|
@ -239,7 +239,7 @@ CLASS zcl_abapgit_git_commit IMPLEMENTATION.
|
|||
|
||||
|
||||
LOOP AT it_objects ASSIGNING <ls_object> USING KEY type
|
||||
WHERE type = zif_abapgit_definitions=>c_type-commit.
|
||||
WHERE type = zif_abapgit_git_definitions=>c_type-commit.
|
||||
ls_raw = zcl_abapgit_git_pack=>decode_commit( <ls_object>-data ).
|
||||
|
||||
CLEAR ls_commit.
|
||||
|
@ -279,8 +279,8 @@ CLASS zcl_abapgit_git_commit IMPLEMENTATION.
|
|||
|
||||
METHOD reverse_sort_order.
|
||||
|
||||
DATA: lt_commits TYPE zif_abapgit_definitions=>ty_commit_tt.
|
||||
FIELD-SYMBOLS: <ls_commit> TYPE zif_abapgit_definitions=>ty_commit.
|
||||
DATA: lt_commits TYPE zif_abapgit_git_definitions=>ty_commit_tt.
|
||||
FIELD-SYMBOLS: <ls_commit> TYPE zif_abapgit_git_definitions=>ty_commit.
|
||||
|
||||
LOOP AT ct_commits ASSIGNING <ls_commit>.
|
||||
INSERT <ls_commit> INTO lt_commits INDEX 1.
|
||||
|
@ -293,12 +293,12 @@ CLASS zcl_abapgit_git_commit IMPLEMENTATION.
|
|||
|
||||
METHOD sort_commits.
|
||||
|
||||
DATA: lt_sorted_commits TYPE zif_abapgit_definitions=>ty_commit_tt,
|
||||
ls_next_commit TYPE zif_abapgit_definitions=>ty_commit,
|
||||
DATA: lt_sorted_commits TYPE zif_abapgit_git_definitions=>ty_commit_tt,
|
||||
ls_next_commit TYPE zif_abapgit_git_definitions=>ty_commit,
|
||||
lt_parents TYPE ty_sha1_range,
|
||||
ls_parent LIKE LINE OF lt_parents.
|
||||
|
||||
FIELD-SYMBOLS: <ls_initial_commit> TYPE zif_abapgit_definitions=>ty_commit.
|
||||
FIELD-SYMBOLS: <ls_initial_commit> TYPE zif_abapgit_git_definitions=>ty_commit.
|
||||
|
||||
" find initial commit
|
||||
READ TABLE ct_commits ASSIGNING <ls_initial_commit> WITH KEY parent1 = space.
|
||||
|
|
|
@ -20,12 +20,12 @@ CLASS ltcl_test IMPLEMENTATION.
|
|||
METHOD parse_commits.
|
||||
|
||||
DATA: lt_objects TYPE zif_abapgit_definitions=>ty_objects_tt,
|
||||
lt_commits TYPE zif_abapgit_definitions=>ty_commit_tt,
|
||||
lt_commits TYPE zif_abapgit_git_definitions=>ty_commit_tt,
|
||||
ls_commit LIKE LINE OF lt_commits,
|
||||
ls_object LIKE LINE OF lt_objects.
|
||||
|
||||
|
||||
ls_object-type = zif_abapgit_definitions=>c_type-commit.
|
||||
ls_object-type = zif_abapgit_git_definitions=>c_type-commit.
|
||||
ls_object-data = '7472656520396335376238613931336465306539' &&
|
||||
'3735333630633261306330643638363037306162' &&
|
||||
'61343965650A706172656E742036393532346462' &&
|
||||
|
@ -57,12 +57,12 @@ CLASS ltcl_test IMPLEMENTATION.
|
|||
METHOD check_author_regex.
|
||||
|
||||
DATA: lt_objects TYPE zif_abapgit_definitions=>ty_objects_tt,
|
||||
lt_commits TYPE zif_abapgit_definitions=>ty_commit_tt,
|
||||
lt_commits TYPE zif_abapgit_git_definitions=>ty_commit_tt,
|
||||
ls_object LIKE LINE OF lt_objects,
|
||||
ls_git_pack_commit TYPE zcl_abapgit_git_pack=>ty_commit.
|
||||
|
||||
|
||||
ls_object-type = zif_abapgit_definitions=>c_type-commit.
|
||||
ls_object-type = zif_abapgit_git_definitions=>c_type-commit.
|
||||
ls_git_pack_commit-tree = 'dummy'.
|
||||
ls_git_pack_commit-committer = 'dummy'.
|
||||
|
||||
|
@ -107,7 +107,7 @@ CLASS ltc_parent_handling DEFINITION FINAL FOR TESTING
|
|||
RISK LEVEL HARMLESS.
|
||||
|
||||
PRIVATE SECTION.
|
||||
DATA mt_commits TYPE zif_abapgit_definitions=>ty_commit_tt.
|
||||
DATA mt_commits TYPE zif_abapgit_git_definitions=>ty_commit_tt.
|
||||
METHODS blank_not_missing FOR TESTING RAISING cx_static_check.
|
||||
METHODS parent_is_missing FOR TESTING RAISING cx_static_check.
|
||||
METHODS parent_is_found FOR TESTING RAISING cx_static_check.
|
||||
|
@ -142,7 +142,7 @@ CLASS ltc_parent_handling IMPLEMENTATION.
|
|||
|
||||
METHOD missing_parent1_cleared.
|
||||
|
||||
DATA ls_commit TYPE zif_abapgit_definitions=>ty_commit.
|
||||
DATA ls_commit TYPE zif_abapgit_git_definitions=>ty_commit.
|
||||
|
||||
given_commit( iv_sha1 = 'F00'
|
||||
iv_parent1 = 'BA5' ).
|
||||
|
@ -155,7 +155,7 @@ CLASS ltc_parent_handling IMPLEMENTATION.
|
|||
|
||||
METHOD missing_parent2_cleared.
|
||||
|
||||
DATA ls_commit TYPE zif_abapgit_definitions=>ty_commit.
|
||||
DATA ls_commit TYPE zif_abapgit_git_definitions=>ty_commit.
|
||||
|
||||
given_commit( iv_sha1 = 'F00'
|
||||
iv_parent2 = 'BA5' ).
|
||||
|
@ -169,7 +169,7 @@ CLASS ltc_parent_handling IMPLEMENTATION.
|
|||
|
||||
METHOD matched_parent1_remains.
|
||||
|
||||
DATA ls_commit TYPE zif_abapgit_definitions=>ty_commit.
|
||||
DATA ls_commit TYPE zif_abapgit_git_definitions=>ty_commit.
|
||||
|
||||
given_commit( iv_sha1 = 'F00' ).
|
||||
given_commit( iv_sha1 = 'BA5'
|
||||
|
@ -184,7 +184,7 @@ CLASS ltc_parent_handling IMPLEMENTATION.
|
|||
ENDMETHOD.
|
||||
|
||||
METHOD given_commit_sha1.
|
||||
DATA ls_commit TYPE zif_abapgit_definitions=>ty_commit.
|
||||
DATA ls_commit TYPE zif_abapgit_git_definitions=>ty_commit.
|
||||
|
||||
ls_commit-sha1 = iv_sha1.
|
||||
APPEND ls_commit TO mt_commits.
|
||||
|
@ -205,7 +205,7 @@ CLASS ltc_parent_handling IMPLEMENTATION.
|
|||
ENDMETHOD.
|
||||
|
||||
METHOD given_commit.
|
||||
FIELD-SYMBOLS: <ls_commit> TYPE zif_abapgit_definitions=>ty_commit.
|
||||
FIELD-SYMBOLS: <ls_commit> TYPE zif_abapgit_git_definitions=>ty_commit.
|
||||
APPEND INITIAL LINE TO mt_commits ASSIGNING <ls_commit>.
|
||||
<ls_commit>-sha1 = iv_sha1.
|
||||
<ls_commit>-parent1 = iv_parent1.
|
||||
|
|
|
@ -5,7 +5,7 @@ CLASS zcl_abapgit_git_pack DEFINITION
|
|||
PUBLIC SECTION.
|
||||
TYPES:
|
||||
BEGIN OF ty_node,
|
||||
chmod TYPE zif_abapgit_definitions=>ty_chmod,
|
||||
chmod TYPE zif_abapgit_git_definitions=>ty_chmod,
|
||||
name TYPE string,
|
||||
sha1 TYPE zif_abapgit_git_definitions=>ty_sha1,
|
||||
END OF ty_node .
|
||||
|
@ -152,7 +152,7 @@ ENDCLASS.
|
|||
|
||||
|
||||
|
||||
CLASS ZCL_ABAPGIT_GIT_PACK IMPLEMENTATION.
|
||||
CLASS zcl_abapgit_git_pack IMPLEMENTATION.
|
||||
|
||||
|
||||
METHOD decode.
|
||||
|
@ -205,7 +205,7 @@ CLASS ZCL_ABAPGIT_GIT_PACK IMPLEMENTATION.
|
|||
get_length( IMPORTING ev_length = lv_expected
|
||||
CHANGING cv_data = lv_data ).
|
||||
|
||||
IF lv_type = zif_abapgit_definitions=>c_type-ref_d.
|
||||
IF lv_type = zif_abapgit_git_definitions=>c_type-ref_d.
|
||||
lv_ref_delta = lv_data(20).
|
||||
lv_data = lv_data+20.
|
||||
ENDIF.
|
||||
|
@ -260,7 +260,7 @@ CLASS ZCL_ABAPGIT_GIT_PACK IMPLEMENTATION.
|
|||
ls_object-adler32 = lv_data(4).
|
||||
lv_data = lv_data+4. " skip adler checksum
|
||||
|
||||
IF lv_type = zif_abapgit_definitions=>c_type-ref_d.
|
||||
IF lv_type = zif_abapgit_git_definitions=>c_type-ref_d.
|
||||
ls_object-sha1 = lv_ref_delta.
|
||||
TRANSLATE ls_object-sha1 TO LOWER CASE.
|
||||
ELSE.
|
||||
|
@ -362,13 +362,13 @@ CLASS ZCL_ABAPGIT_GIT_PACK IMPLEMENTATION.
|
|||
|
||||
LOOP AT ct_objects INTO ls_object
|
||||
USING KEY type
|
||||
WHERE type = zif_abapgit_definitions=>c_type-ref_d.
|
||||
WHERE type = zif_abapgit_git_definitions=>c_type-ref_d.
|
||||
INSERT ls_object INTO TABLE lt_deltas.
|
||||
ENDLOOP.
|
||||
|
||||
DELETE ct_objects
|
||||
USING KEY type
|
||||
WHERE type = zif_abapgit_definitions=>c_type-ref_d.
|
||||
WHERE type = zif_abapgit_git_definitions=>c_type-ref_d.
|
||||
|
||||
"Restore correct Delta Order
|
||||
SORT lt_deltas BY index.
|
||||
|
@ -453,7 +453,7 @@ CLASS ZCL_ABAPGIT_GIT_PACK IMPLEMENTATION.
|
|||
lc_null TYPE x VALUE '00'.
|
||||
|
||||
DATA: lv_xstring TYPE xstring,
|
||||
lv_chmod TYPE zif_abapgit_definitions=>ty_chmod,
|
||||
lv_chmod TYPE zif_abapgit_git_definitions=>ty_chmod,
|
||||
lv_name TYPE string,
|
||||
lv_string TYPE string,
|
||||
lv_len TYPE i,
|
||||
|
@ -478,10 +478,10 @@ CLASS ZCL_ABAPGIT_GIT_PACK IMPLEMENTATION.
|
|||
|
||||
CLEAR ls_node.
|
||||
ls_node-chmod = lv_chmod.
|
||||
IF ls_node-chmod <> zif_abapgit_definitions=>c_chmod-dir
|
||||
AND ls_node-chmod <> zif_abapgit_definitions=>c_chmod-file
|
||||
AND ls_node-chmod <> zif_abapgit_definitions=>c_chmod-executable
|
||||
AND ls_node-chmod <> zif_abapgit_definitions=>c_chmod-submodule.
|
||||
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-executable
|
||||
AND ls_node-chmod <> zif_abapgit_git_definitions=>c_chmod-submodule.
|
||||
zcx_abapgit_exception=>raise( |Unknown chmod| ).
|
||||
ENDIF.
|
||||
|
||||
|
@ -530,7 +530,7 @@ CLASS ZCL_ABAPGIT_GIT_PACK IMPLEMENTATION.
|
|||
WITH KEY sha COMPONENTS sha1 = is_object-sha1.
|
||||
IF sy-subrc <> 0.
|
||||
zcx_abapgit_exception=>raise( |Base not found, { is_object-sha1 }| ).
|
||||
ELSEIF <ls_object>-type = zif_abapgit_definitions=>c_type-ref_d.
|
||||
ELSEIF <ls_object>-type = zif_abapgit_git_definitions=>c_type-ref_d.
|
||||
* sanity check
|
||||
zcx_abapgit_exception=>raise( |Delta, base eq delta| ).
|
||||
ENDIF.
|
||||
|
@ -824,15 +824,15 @@ CLASS ZCL_ABAPGIT_GIT_PACK IMPLEMENTATION.
|
|||
|
||||
CASE lv_xtype.
|
||||
WHEN 16.
|
||||
rv_type = zif_abapgit_definitions=>c_type-commit.
|
||||
rv_type = zif_abapgit_git_definitions=>c_type-commit.
|
||||
WHEN 32.
|
||||
rv_type = zif_abapgit_definitions=>c_type-tree.
|
||||
rv_type = zif_abapgit_git_definitions=>c_type-tree.
|
||||
WHEN 48.
|
||||
rv_type = zif_abapgit_definitions=>c_type-blob.
|
||||
rv_type = zif_abapgit_git_definitions=>c_type-blob.
|
||||
WHEN 64.
|
||||
rv_type = zif_abapgit_definitions=>c_type-tag.
|
||||
rv_type = zif_abapgit_git_definitions=>c_type-tag.
|
||||
WHEN 112.
|
||||
rv_type = zif_abapgit_definitions=>c_type-ref_d.
|
||||
rv_type = zif_abapgit_git_definitions=>c_type-ref_d.
|
||||
WHEN OTHERS.
|
||||
zcx_abapgit_exception=>raise( |Todo, unknown git pack type| ).
|
||||
ENDCASE.
|
||||
|
@ -855,7 +855,7 @@ CLASS ZCL_ABAPGIT_GIT_PACK IMPLEMENTATION.
|
|||
|
||||
LOOP AT it_nodes ASSIGNING <ls_node>.
|
||||
APPEND INITIAL LINE TO lt_sort ASSIGNING <ls_sort>.
|
||||
IF <ls_node>-chmod = zif_abapgit_definitions=>c_chmod-dir.
|
||||
IF <ls_node>-chmod = zif_abapgit_git_definitions=>c_chmod-dir.
|
||||
CONCATENATE <ls_node>-name '/' INTO <ls_sort>-sort.
|
||||
ELSE.
|
||||
<ls_sort>-sort = <ls_node>-name.
|
||||
|
@ -883,15 +883,15 @@ CLASS ZCL_ABAPGIT_GIT_PACK IMPLEMENTATION.
|
|||
|
||||
|
||||
CASE iv_type.
|
||||
WHEN zif_abapgit_definitions=>c_type-commit.
|
||||
WHEN zif_abapgit_git_definitions=>c_type-commit.
|
||||
lv_type = 16.
|
||||
WHEN zif_abapgit_definitions=>c_type-tree.
|
||||
WHEN zif_abapgit_git_definitions=>c_type-tree.
|
||||
lv_type = 32.
|
||||
WHEN zif_abapgit_definitions=>c_type-blob.
|
||||
WHEN zif_abapgit_git_definitions=>c_type-blob.
|
||||
lv_type = 48.
|
||||
WHEN zif_abapgit_definitions=>c_type-tag.
|
||||
WHEN zif_abapgit_git_definitions=>c_type-tag.
|
||||
lv_type = 64.
|
||||
WHEN zif_abapgit_definitions=>c_type-ref_d.
|
||||
WHEN zif_abapgit_git_definitions=>c_type-ref_d.
|
||||
lv_type = 112.
|
||||
WHEN OTHERS.
|
||||
zcx_abapgit_exception=>raise( |Unexpected object type while encoding pack| ).
|
||||
|
|
|
@ -18,7 +18,7 @@ CLASS ltcl_tree IMPLEMENTATION.
|
|||
lt_result TYPE zcl_abapgit_git_pack=>ty_nodes_tt.
|
||||
|
||||
CLEAR ls_node.
|
||||
ls_node-chmod = zif_abapgit_definitions=>c_chmod-file.
|
||||
ls_node-chmod = zif_abapgit_git_definitions=>c_chmod-file.
|
||||
ls_node-name = 'foobar.txt'.
|
||||
ls_node-sha1 = '5f46cb3c4b7f0b3600b64f744cde614a283a88dc'.
|
||||
APPEND ls_node TO lt_nodes.
|
||||
|
@ -40,13 +40,13 @@ CLASS ltcl_tree IMPLEMENTATION.
|
|||
lt_result TYPE zcl_abapgit_git_pack=>ty_nodes_tt.
|
||||
|
||||
CLEAR ls_node.
|
||||
ls_node-chmod = zif_abapgit_definitions=>c_chmod-file.
|
||||
ls_node-chmod = zif_abapgit_git_definitions=>c_chmod-file.
|
||||
ls_node-name = 'foobar.txt'.
|
||||
ls_node-sha1 = '5f46cb3c4b7f0b3600b64f744cde614a283a88dc'.
|
||||
APPEND ls_node TO lt_nodes.
|
||||
|
||||
CLEAR ls_node.
|
||||
ls_node-chmod = zif_abapgit_definitions=>c_chmod-file.
|
||||
ls_node-chmod = zif_abapgit_git_definitions=>c_chmod-file.
|
||||
ls_node-name = 'something.md'.
|
||||
ls_node-sha1 = '1236cb3c4b7f0b3600b64f744cde614a283a88dc'.
|
||||
APPEND ls_node TO lt_nodes.
|
||||
|
@ -68,7 +68,7 @@ CLASS ltcl_tree IMPLEMENTATION.
|
|||
lt_result TYPE zcl_abapgit_git_pack=>ty_nodes_tt.
|
||||
|
||||
CLEAR ls_node.
|
||||
ls_node-chmod = zif_abapgit_definitions=>c_chmod-file.
|
||||
ls_node-chmod = zif_abapgit_git_definitions=>c_chmod-file.
|
||||
ls_node-name = 'foobar.txt'.
|
||||
ls_node-sha1 = '0000003c4b7f0b3600b64f744cde614a28000000'.
|
||||
APPEND ls_node TO lt_nodes.
|
||||
|
@ -95,7 +95,7 @@ CLASS ltcl_type_and_length DEFINITION FOR TESTING DURATION SHORT RISK LEVEL HARM
|
|||
test
|
||||
IMPORTING
|
||||
iv_length TYPE i
|
||||
iv_type TYPE zif_abapgit_git_definitions=>ty_type DEFAULT zif_abapgit_definitions=>c_type-commit
|
||||
iv_type TYPE zif_abapgit_git_definitions=>ty_type DEFAULT zif_abapgit_git_definitions=>c_type-commit
|
||||
iv_expected TYPE xstring
|
||||
RAISING
|
||||
zcx_abapgit_exception,
|
||||
|
@ -154,7 +154,7 @@ CLASS ltcl_type_and_length IMPLEMENTATION.
|
|||
METHOD type_and_length_90000.
|
||||
|
||||
test( iv_length = 90000
|
||||
iv_type = zif_abapgit_definitions=>c_type-blob
|
||||
iv_type = zif_abapgit_git_definitions=>c_type-blob
|
||||
iv_expected = 'B0F92B' ).
|
||||
|
||||
ENDMETHOD.
|
||||
|
@ -261,12 +261,12 @@ CLASS ltcl_pack IMPLEMENTATION.
|
|||
|
||||
|
||||
APPEND INITIAL LINE TO lt_tree ASSIGNING <ls_tree>.
|
||||
<ls_tree>-chmod = zif_abapgit_definitions=>c_chmod-file.
|
||||
<ls_tree>-chmod = zif_abapgit_git_definitions=>c_chmod-file.
|
||||
<ls_tree>-name = 'b.txt'.
|
||||
<ls_tree>-sha1 = '0123'.
|
||||
|
||||
APPEND INITIAL LINE TO lt_tree ASSIGNING <ls_tree>.
|
||||
<ls_tree>-chmod = zif_abapgit_definitions=>c_chmod-file.
|
||||
<ls_tree>-chmod = zif_abapgit_git_definitions=>c_chmod-file.
|
||||
<ls_tree>-name = 'a.txt'.
|
||||
<ls_tree>-sha1 = '0123'.
|
||||
|
||||
|
@ -289,12 +289,12 @@ CLASS ltcl_pack IMPLEMENTATION.
|
|||
|
||||
|
||||
APPEND INITIAL LINE TO lt_tree ASSIGNING <ls_tree>.
|
||||
<ls_tree>-chmod = zif_abapgit_definitions=>c_chmod-file.
|
||||
<ls_tree>-chmod = zif_abapgit_git_definitions=>c_chmod-file.
|
||||
<ls_tree>-name = 'foo.txt'.
|
||||
<ls_tree>-sha1 = '0123'.
|
||||
|
||||
APPEND INITIAL LINE TO lt_tree ASSIGNING <ls_tree>.
|
||||
<ls_tree>-chmod = zif_abapgit_definitions=>c_chmod-dir.
|
||||
<ls_tree>-chmod = zif_abapgit_git_definitions=>c_chmod-dir.
|
||||
<ls_tree>-name = 'foo'.
|
||||
<ls_tree>-sha1 = '0123'.
|
||||
|
||||
|
@ -327,7 +327,7 @@ CLASS ltcl_pack IMPLEMENTATION.
|
|||
lv_data = lc_data.
|
||||
CLEAR ls_object.
|
||||
ls_object-sha1 = zcl_abapgit_hash=>sha1_blob( lv_data ).
|
||||
ls_object-type = zif_abapgit_definitions=>c_type-blob.
|
||||
ls_object-type = zif_abapgit_git_definitions=>c_type-blob.
|
||||
ls_object-data = lv_data.
|
||||
ls_object-index = 1.
|
||||
ls_object-adler32 = zcl_abapgit_hash=>adler32( lv_data ).
|
||||
|
@ -343,7 +343,7 @@ CLASS ltcl_pack IMPLEMENTATION.
|
|||
lv_data = zcl_abapgit_git_pack=>encode_commit( ls_commit ).
|
||||
CLEAR ls_object.
|
||||
ls_object-sha1 = zcl_abapgit_hash=>sha1_commit( lv_data ).
|
||||
ls_object-type = zif_abapgit_definitions=>c_type-commit.
|
||||
ls_object-type = zif_abapgit_git_definitions=>c_type-commit.
|
||||
ls_object-data = lv_data.
|
||||
ls_object-index = 2.
|
||||
ls_object-adler32 = zcl_abapgit_hash=>adler32( lv_data ).
|
||||
|
@ -358,7 +358,7 @@ CLASS ltcl_pack IMPLEMENTATION.
|
|||
lv_data = zcl_abapgit_git_pack=>encode_tree( lt_nodes ).
|
||||
CLEAR ls_object.
|
||||
ls_object-sha1 = zcl_abapgit_hash=>sha1_tree( lv_data ).
|
||||
ls_object-type = zif_abapgit_definitions=>c_type-tree.
|
||||
ls_object-type = zif_abapgit_git_definitions=>c_type-tree.
|
||||
ls_object-data = lv_data.
|
||||
ls_object-index = 3.
|
||||
ls_object-adler32 = zcl_abapgit_hash=>adler32( lv_data ).
|
||||
|
@ -378,7 +378,7 @@ CLASS ltcl_pack IMPLEMENTATION.
|
|||
METHOD object_blob.
|
||||
|
||||
rs_object-sha1 = zcl_abapgit_hash=>sha1_blob( iv_data ).
|
||||
rs_object-type = zif_abapgit_definitions=>c_type-blob.
|
||||
rs_object-type = zif_abapgit_git_definitions=>c_type-blob.
|
||||
rs_object-data = iv_data.
|
||||
rs_object-index = 1.
|
||||
rs_object-adler32 = zcl_abapgit_hash=>adler32( iv_data ).
|
||||
|
|
|
@ -79,7 +79,7 @@ CLASS zcl_abapgit_git_porcelain DEFINITION
|
|||
!it_objects TYPE zif_abapgit_definitions=>ty_objects_tt
|
||||
!iv_parent TYPE zif_abapgit_git_definitions=>ty_sha1
|
||||
RETURNING
|
||||
VALUE(rt_expanded) TYPE zif_abapgit_definitions=>ty_expanded_tt
|
||||
VALUE(rt_expanded) TYPE zif_abapgit_git_definitions=>ty_expanded_tt
|
||||
RAISING
|
||||
zcx_abapgit_exception .
|
||||
PROTECTED SECTION.
|
||||
|
@ -107,14 +107,14 @@ CLASS zcl_abapgit_git_porcelain DEFINITION
|
|||
|
||||
CLASS-METHODS build_trees
|
||||
IMPORTING
|
||||
!it_expanded TYPE zif_abapgit_definitions=>ty_expanded_tt
|
||||
!it_expanded TYPE zif_abapgit_git_definitions=>ty_expanded_tt
|
||||
RETURNING
|
||||
VALUE(rt_trees) TYPE ty_trees_tt
|
||||
RAISING
|
||||
zcx_abapgit_exception .
|
||||
CLASS-METHODS find_folders
|
||||
IMPORTING
|
||||
!it_expanded TYPE zif_abapgit_definitions=>ty_expanded_tt
|
||||
!it_expanded TYPE zif_abapgit_git_definitions=>ty_expanded_tt
|
||||
RETURNING
|
||||
VALUE(rt_folders) TYPE ty_folders_tt .
|
||||
CLASS-METHODS pull
|
||||
|
@ -140,7 +140,7 @@ CLASS zcl_abapgit_git_porcelain DEFINITION
|
|||
!iv_tree TYPE zif_abapgit_git_definitions=>ty_sha1
|
||||
!iv_base TYPE string
|
||||
RETURNING
|
||||
VALUE(rt_expanded) TYPE zif_abapgit_definitions=>ty_expanded_tt
|
||||
VALUE(rt_expanded) TYPE zif_abapgit_git_definitions=>ty_expanded_tt
|
||||
RAISING
|
||||
zcx_abapgit_exception .
|
||||
CLASS-METHODS receive_pack_push
|
||||
|
@ -228,7 +228,7 @@ CLASS zcl_abapgit_git_porcelain IMPLEMENTATION.
|
|||
lv_len = strlen( <ls_folder>-path ).
|
||||
IF strlen( <ls_sub>-path ) > lv_len AND <ls_sub>-path(lv_len) = <ls_folder>-path.
|
||||
APPEND INITIAL LINE TO lt_nodes ASSIGNING <ls_node>.
|
||||
<ls_node>-chmod = zif_abapgit_definitions=>c_chmod-dir.
|
||||
<ls_node>-chmod = zif_abapgit_git_definitions=>c_chmod-dir.
|
||||
|
||||
* extract folder name, this can probably be done easier using regular expressions
|
||||
<ls_node>-name = <ls_sub>-path+lv_len.
|
||||
|
@ -262,7 +262,7 @@ CLASS zcl_abapgit_git_porcelain IMPLEMENTATION.
|
|||
|
||||
* new tag
|
||||
ls_tag-object = is_tag-sha1.
|
||||
ls_tag-type = zif_abapgit_definitions=>c_type-commit.
|
||||
ls_tag-type = zif_abapgit_git_definitions=>c_type-commit.
|
||||
ls_tag-tag = is_tag-name.
|
||||
ls_tag-tagger_name = is_tag-tagger_name.
|
||||
ls_tag-tagger_email = is_tag-tagger_email.
|
||||
|
@ -276,7 +276,7 @@ CLASS zcl_abapgit_git_porcelain IMPLEMENTATION.
|
|||
lv_new_tag_sha1 = zcl_abapgit_hash=>sha1_tag( lv_tag ).
|
||||
|
||||
ls_object-sha1 = lv_new_tag_sha1.
|
||||
ls_object-type = zif_abapgit_definitions=>c_type-tag.
|
||||
ls_object-type = zif_abapgit_git_definitions=>c_type-tag.
|
||||
ls_object-data = lv_tag.
|
||||
ls_object-index = 1.
|
||||
APPEND ls_object TO lt_objects.
|
||||
|
@ -477,7 +477,7 @@ CLASS zcl_abapgit_git_porcelain IMPLEMENTATION.
|
|||
|
||||
READ TABLE it_objects INTO ls_object
|
||||
WITH KEY type COMPONENTS
|
||||
type = zif_abapgit_definitions=>c_type-commit
|
||||
type = zif_abapgit_git_definitions=>c_type-commit
|
||||
sha1 = iv_parent.
|
||||
IF sy-subrc <> 0.
|
||||
zcx_abapgit_exception=>raise( 'commit not found' ).
|
||||
|
@ -498,7 +498,7 @@ CLASS zcl_abapgit_git_porcelain IMPLEMENTATION.
|
|||
|
||||
READ TABLE it_objects INTO ls_object
|
||||
WITH KEY type COMPONENTS
|
||||
type = zif_abapgit_definitions=>c_type-commit
|
||||
type = zif_abapgit_git_definitions=>c_type-commit
|
||||
sha1 = iv_commit.
|
||||
|
||||
IF sy-subrc <> 0.
|
||||
|
@ -551,7 +551,7 @@ CLASS zcl_abapgit_git_porcelain IMPLEMENTATION.
|
|||
|
||||
METHOD push.
|
||||
|
||||
DATA: lt_expanded TYPE zif_abapgit_definitions=>ty_expanded_tt,
|
||||
DATA: lt_expanded TYPE zif_abapgit_git_definitions=>ty_expanded_tt,
|
||||
lt_blobs TYPE zif_abapgit_git_definitions=>ty_files_tt,
|
||||
lv_sha1 TYPE zif_abapgit_git_definitions=>ty_sha1,
|
||||
lv_new_tree TYPE zif_abapgit_git_definitions=>ty_sha1,
|
||||
|
@ -584,7 +584,7 @@ CLASS zcl_abapgit_git_porcelain IMPLEMENTATION.
|
|||
APPEND INITIAL LINE TO lt_expanded ASSIGNING <ls_exp>.
|
||||
<ls_exp>-name = <ls_stage>-file-filename.
|
||||
<ls_exp>-path = <ls_stage>-file-path.
|
||||
<ls_exp>-chmod = zif_abapgit_definitions=>c_chmod-file.
|
||||
<ls_exp>-chmod = zif_abapgit_git_definitions=>c_chmod-file.
|
||||
ENDIF.
|
||||
|
||||
lv_sha1 = zcl_abapgit_hash=>sha1_blob( <ls_stage>-file-data ).
|
||||
|
@ -668,7 +668,7 @@ CLASS zcl_abapgit_git_porcelain IMPLEMENTATION.
|
|||
lv_commit = zcl_abapgit_git_pack=>encode_commit( ls_commit ).
|
||||
|
||||
ls_object-sha1 = zcl_abapgit_hash=>sha1_commit( lv_commit ).
|
||||
ls_object-type = zif_abapgit_definitions=>c_type-commit.
|
||||
ls_object-type = zif_abapgit_git_definitions=>c_type-commit.
|
||||
ls_object-data = lv_commit.
|
||||
APPEND ls_object TO et_new_objects.
|
||||
|
||||
|
@ -678,7 +678,7 @@ CLASS zcl_abapgit_git_porcelain IMPLEMENTATION.
|
|||
|
||||
READ TABLE et_new_objects
|
||||
WITH KEY type COMPONENTS
|
||||
type = zif_abapgit_definitions=>c_type-tree
|
||||
type = zif_abapgit_git_definitions=>c_type-tree
|
||||
sha1 = ls_object-sha1
|
||||
TRANSPORTING NO FIELDS.
|
||||
IF sy-subrc = 0.
|
||||
|
@ -686,7 +686,7 @@ CLASS zcl_abapgit_git_porcelain IMPLEMENTATION.
|
|||
CONTINUE.
|
||||
ENDIF.
|
||||
|
||||
ls_object-type = zif_abapgit_definitions=>c_type-tree.
|
||||
ls_object-type = zif_abapgit_git_definitions=>c_type-tree.
|
||||
ls_object-data = <ls_tree>-data.
|
||||
lv_uindex = lv_uindex + 1.
|
||||
ls_object-index = lv_uindex.
|
||||
|
@ -699,7 +699,7 @@ CLASS zcl_abapgit_git_porcelain IMPLEMENTATION.
|
|||
|
||||
READ TABLE et_new_objects
|
||||
WITH KEY type COMPONENTS
|
||||
type = zif_abapgit_definitions=>c_type-blob
|
||||
type = zif_abapgit_git_definitions=>c_type-blob
|
||||
sha1 = ls_object-sha1
|
||||
TRANSPORTING NO FIELDS.
|
||||
IF sy-subrc = 0.
|
||||
|
@ -707,7 +707,7 @@ CLASS zcl_abapgit_git_porcelain IMPLEMENTATION.
|
|||
CONTINUE.
|
||||
ENDIF.
|
||||
|
||||
ls_object-type = zif_abapgit_definitions=>c_type-blob.
|
||||
ls_object-type = zif_abapgit_git_definitions=>c_type-blob.
|
||||
* note <ls_blob>-data can be empty, #1857 allow empty files - some more checks needed?
|
||||
ls_object-data = <ls_blob>-data.
|
||||
lv_uindex = lv_uindex + 1.
|
||||
|
@ -744,7 +744,7 @@ CLASS zcl_abapgit_git_porcelain IMPLEMENTATION.
|
|||
|
||||
READ TABLE it_objects ASSIGNING <ls_tree>
|
||||
WITH KEY type COMPONENTS
|
||||
type = zif_abapgit_definitions=>c_type-tree
|
||||
type = zif_abapgit_git_definitions=>c_type-tree
|
||||
sha1 = iv_sha1.
|
||||
IF sy-subrc <> 0.
|
||||
zcx_abapgit_exception=>raise( 'Walk, tree not found' ).
|
||||
|
@ -753,10 +753,10 @@ CLASS zcl_abapgit_git_porcelain IMPLEMENTATION.
|
|||
lt_nodes = zcl_abapgit_git_pack=>decode_tree( <ls_tree>-data ).
|
||||
|
||||
LOOP AT lt_nodes ASSIGNING <ls_node>.
|
||||
IF <ls_node>-chmod = zif_abapgit_definitions=>c_chmod-file.
|
||||
IF <ls_node>-chmod = zif_abapgit_git_definitions=>c_chmod-file.
|
||||
READ TABLE it_objects ASSIGNING <ls_blob>
|
||||
WITH KEY type COMPONENTS
|
||||
type = zif_abapgit_definitions=>c_type-blob
|
||||
type = zif_abapgit_git_definitions=>c_type-blob
|
||||
sha1 = <ls_node>-sha1.
|
||||
IF sy-subrc <> 0.
|
||||
zcx_abapgit_exception=>raise( 'Walk, blob not found' ).
|
||||
|
@ -771,7 +771,7 @@ CLASS zcl_abapgit_git_porcelain IMPLEMENTATION.
|
|||
ENDIF.
|
||||
ENDLOOP.
|
||||
|
||||
LOOP AT lt_nodes ASSIGNING <ls_node> WHERE chmod = zif_abapgit_definitions=>c_chmod-dir.
|
||||
LOOP AT lt_nodes ASSIGNING <ls_node> WHERE chmod = zif_abapgit_git_definitions=>c_chmod-dir.
|
||||
CONCATENATE iv_path <ls_node>-name '/' INTO lv_path.
|
||||
|
||||
walk( EXPORTING it_objects = it_objects
|
||||
|
@ -795,7 +795,7 @@ CLASS zcl_abapgit_git_porcelain IMPLEMENTATION.
|
|||
|
||||
READ TABLE it_objects INTO ls_object
|
||||
WITH KEY type COMPONENTS
|
||||
type = zif_abapgit_definitions=>c_type-tree
|
||||
type = zif_abapgit_git_definitions=>c_type-tree
|
||||
sha1 = iv_tree.
|
||||
IF sy-subrc <> 0.
|
||||
zcx_abapgit_exception=>raise( 'tree not found' ).
|
||||
|
@ -804,15 +804,15 @@ CLASS zcl_abapgit_git_porcelain IMPLEMENTATION.
|
|||
|
||||
LOOP AT lt_nodes ASSIGNING <ls_node>.
|
||||
CASE <ls_node>-chmod.
|
||||
WHEN zif_abapgit_definitions=>c_chmod-file
|
||||
OR zif_abapgit_definitions=>c_chmod-executable
|
||||
OR zif_abapgit_definitions=>c_chmod-submodule.
|
||||
WHEN zif_abapgit_git_definitions=>c_chmod-file
|
||||
OR zif_abapgit_git_definitions=>c_chmod-executable
|
||||
OR zif_abapgit_git_definitions=>c_chmod-submodule.
|
||||
APPEND INITIAL LINE TO rt_expanded ASSIGNING <ls_exp>.
|
||||
<ls_exp>-path = iv_base.
|
||||
<ls_exp>-name = <ls_node>-name.
|
||||
<ls_exp>-sha1 = <ls_node>-sha1.
|
||||
<ls_exp>-chmod = <ls_node>-chmod.
|
||||
WHEN zif_abapgit_definitions=>c_chmod-dir.
|
||||
WHEN zif_abapgit_git_definitions=>c_chmod-dir.
|
||||
lt_expanded = walk_tree(
|
||||
it_objects = it_objects
|
||||
iv_tree = <ls_node>-sha1
|
||||
|
|
|
@ -22,7 +22,7 @@ CLASS ltcl_git_porcelain DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHO
|
|||
sub FOR TESTING
|
||||
RAISING zcx_abapgit_exception.
|
||||
|
||||
DATA: mt_expanded TYPE zif_abapgit_definitions=>ty_expanded_tt,
|
||||
DATA: mt_expanded TYPE zif_abapgit_git_definitions=>ty_expanded_tt,
|
||||
mt_trees TYPE zcl_abapgit_git_porcelain=>ty_trees_tt.
|
||||
|
||||
ENDCLASS.
|
||||
|
@ -43,7 +43,7 @@ CLASS ltcl_git_porcelain IMPLEMENTATION.
|
|||
<ls_expanded>-path = iv_path.
|
||||
<ls_expanded>-name = iv_name.
|
||||
<ls_expanded>-sha1 = 'a'.
|
||||
<ls_expanded>-chmod = zif_abapgit_definitions=>c_chmod-file.
|
||||
<ls_expanded>-chmod = zif_abapgit_git_definitions=>c_chmod-file.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
|
|
@ -140,13 +140,13 @@ CLASS zcl_abapgit_hash IMPLEMENTATION.
|
|||
|
||||
|
||||
METHOD sha1_blob.
|
||||
rv_sha1 = sha1( iv_type = zif_abapgit_definitions=>c_type-blob
|
||||
rv_sha1 = sha1( iv_type = zif_abapgit_git_definitions=>c_type-blob
|
||||
iv_data = iv_data ).
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD sha1_commit.
|
||||
rv_sha1 = sha1( iv_type = zif_abapgit_definitions=>c_type-commit
|
||||
rv_sha1 = sha1( iv_type = zif_abapgit_git_definitions=>c_type-commit
|
||||
iv_data = iv_data ).
|
||||
ENDMETHOD.
|
||||
|
||||
|
@ -196,13 +196,13 @@ CLASS zcl_abapgit_hash IMPLEMENTATION.
|
|||
|
||||
|
||||
METHOD sha1_tag.
|
||||
rv_sha1 = sha1( iv_type = zif_abapgit_definitions=>c_type-tag
|
||||
rv_sha1 = sha1( iv_type = zif_abapgit_git_definitions=>c_type-tag
|
||||
iv_data = iv_data ).
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD sha1_tree.
|
||||
rv_sha1 = sha1( iv_type = zif_abapgit_definitions=>c_type-tree
|
||||
rv_sha1 = sha1( iv_type = zif_abapgit_git_definitions=>c_type-tree
|
||||
iv_data = iv_data ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
|
|
|
@ -32,7 +32,7 @@ CLASS ltcl_test IMPLEMENTATION.
|
|||
DATA: lv_sha1 TYPE zif_abapgit_git_definitions=>ty_sha1.
|
||||
|
||||
lv_sha1 = zcl_abapgit_hash=>sha1(
|
||||
iv_type = zif_abapgit_definitions=>c_type-commit
|
||||
iv_type = zif_abapgit_git_definitions=>c_type-commit
|
||||
iv_data = '112211221122' ).
|
||||
|
||||
cl_abap_unit_assert=>assert_equals(
|
||||
|
|
|
@ -73,4 +73,58 @@ INTERFACE zif_abapgit_git_definitions
|
|||
comment TYPE string,
|
||||
END OF ty_comment .
|
||||
|
||||
TYPES:
|
||||
ty_chmod TYPE c LENGTH 6 .
|
||||
|
||||
CONSTANTS:
|
||||
BEGIN OF c_chmod,
|
||||
file TYPE ty_chmod VALUE '100644',
|
||||
executable TYPE ty_chmod VALUE '100755',
|
||||
dir TYPE ty_chmod VALUE '40000 ',
|
||||
submodule TYPE ty_chmod VALUE '160000',
|
||||
END OF c_chmod .
|
||||
|
||||
TYPES:
|
||||
BEGIN OF ty_expanded,
|
||||
path TYPE string,
|
||||
name TYPE string,
|
||||
sha1 TYPE ty_sha1,
|
||||
chmod TYPE ty_chmod,
|
||||
END OF ty_expanded .
|
||||
TYPES:
|
||||
ty_expanded_tt TYPE STANDARD TABLE OF ty_expanded WITH DEFAULT KEY .
|
||||
|
||||
TYPES:
|
||||
BEGIN OF ty_create,
|
||||
name TYPE string,
|
||||
parent TYPE string,
|
||||
END OF ty_create .
|
||||
TYPES:
|
||||
BEGIN OF ty_commit,
|
||||
sha1 TYPE ty_sha1,
|
||||
parent1 TYPE ty_sha1,
|
||||
parent2 TYPE ty_sha1,
|
||||
author TYPE string,
|
||||
email TYPE string,
|
||||
time TYPE string,
|
||||
message TYPE string,
|
||||
body TYPE STANDARD TABLE OF string WITH DEFAULT KEY,
|
||||
branch TYPE string,
|
||||
merge TYPE string,
|
||||
tags TYPE STANDARD TABLE OF string WITH DEFAULT KEY,
|
||||
create TYPE STANDARD TABLE OF ty_create WITH DEFAULT KEY,
|
||||
compressed TYPE abap_bool,
|
||||
END OF ty_commit .
|
||||
TYPES:
|
||||
ty_commit_tt TYPE STANDARD TABLE OF ty_commit WITH DEFAULT KEY .
|
||||
|
||||
CONSTANTS:
|
||||
BEGIN OF c_type,
|
||||
commit TYPE ty_type VALUE 'commit', "#EC NOTEXT
|
||||
tree TYPE ty_type VALUE 'tree', "#EC NOTEXT
|
||||
ref_d TYPE ty_type VALUE 'ref_d', "#EC NOTEXT
|
||||
tag TYPE ty_type VALUE 'tag', "#EC NOTEXT
|
||||
blob TYPE ty_type VALUE 'blob', "#EC NOTEXT
|
||||
END OF c_type .
|
||||
|
||||
ENDINTERFACE.
|
||||
|
|
|
@ -33,7 +33,7 @@ CLASS zcl_abapgit_merge DEFINITION
|
|||
!ct_visit TYPE ty_visit_tt .
|
||||
METHODS all_files
|
||||
RETURNING
|
||||
VALUE(rt_files) TYPE zif_abapgit_definitions=>ty_expanded_tt .
|
||||
VALUE(rt_files) TYPE zif_abapgit_git_definitions=>ty_expanded_tt .
|
||||
METHODS calculate_result
|
||||
RAISING
|
||||
zcx_abapgit_exception .
|
||||
|
@ -61,7 +61,7 @@ ENDCLASS.
|
|||
|
||||
|
||||
|
||||
CLASS ZCL_ABAPGIT_MERGE IMPLEMENTATION.
|
||||
CLASS zcl_abapgit_merge IMPLEMENTATION.
|
||||
|
||||
|
||||
METHOD all_files.
|
||||
|
@ -77,7 +77,7 @@ CLASS ZCL_ABAPGIT_MERGE IMPLEMENTATION.
|
|||
|
||||
METHOD calculate_result.
|
||||
|
||||
DATA: lt_files TYPE zif_abapgit_definitions=>ty_expanded_tt,
|
||||
DATA: lt_files TYPE zif_abapgit_git_definitions=>ty_expanded_tt,
|
||||
lv_found_source TYPE abap_bool,
|
||||
lv_found_target TYPE abap_bool,
|
||||
lv_found_common TYPE abap_bool.
|
||||
|
@ -139,7 +139,7 @@ CLASS ZCL_ABAPGIT_MERGE IMPLEMENTATION.
|
|||
* added in source
|
||||
READ TABLE mt_objects ASSIGNING <ls_object>
|
||||
WITH KEY type COMPONENTS
|
||||
type = zif_abapgit_definitions=>c_type-blob
|
||||
type = zif_abapgit_git_definitions=>c_type-blob
|
||||
sha1 = <ls_source>-sha1.
|
||||
ASSERT sy-subrc = 0.
|
||||
|
||||
|
@ -164,14 +164,14 @@ CLASS ZCL_ABAPGIT_MERGE IMPLEMENTATION.
|
|||
<ls_conflict>-source_sha1 = <ls_source>-sha1.
|
||||
READ TABLE mt_objects ASSIGNING <ls_object>
|
||||
WITH KEY type COMPONENTS
|
||||
type = zif_abapgit_definitions=>c_type-blob
|
||||
type = zif_abapgit_git_definitions=>c_type-blob
|
||||
sha1 = <ls_source>-sha1.
|
||||
<ls_conflict>-source_data = <ls_object>-data.
|
||||
|
||||
<ls_conflict>-target_sha1 = <ls_target>-sha1.
|
||||
READ TABLE mt_objects ASSIGNING <ls_object>
|
||||
WITH KEY type COMPONENTS
|
||||
type = zif_abapgit_definitions=>c_type-blob
|
||||
type = zif_abapgit_git_definitions=>c_type-blob
|
||||
sha1 = <ls_target>-sha1.
|
||||
<ls_conflict>-target_data = <ls_object>-data.
|
||||
|
||||
|
@ -194,7 +194,7 @@ CLASS ZCL_ABAPGIT_MERGE IMPLEMENTATION.
|
|||
* changed in source
|
||||
READ TABLE mt_objects ASSIGNING <ls_object>
|
||||
WITH KEY type COMPONENTS
|
||||
type = zif_abapgit_definitions=>c_type-blob
|
||||
type = zif_abapgit_git_definitions=>c_type-blob
|
||||
sha1 = <ls_source>-sha1.
|
||||
ASSERT sy-subrc = 0.
|
||||
|
||||
|
@ -214,14 +214,14 @@ CLASS ZCL_ABAPGIT_MERGE IMPLEMENTATION.
|
|||
<ls_conflict>-source_sha1 = <ls_source>-sha1.
|
||||
READ TABLE mt_objects ASSIGNING <ls_object>
|
||||
WITH KEY type COMPONENTS
|
||||
type = zif_abapgit_definitions=>c_type-blob
|
||||
type = zif_abapgit_git_definitions=>c_type-blob
|
||||
sha1 = <ls_source>-sha1.
|
||||
<ls_conflict>-source_data = <ls_object>-data.
|
||||
|
||||
<ls_conflict>-target_sha1 = <ls_target>-sha1.
|
||||
READ TABLE mt_objects ASSIGNING <ls_object>
|
||||
WITH KEY type COMPONENTS
|
||||
type = zif_abapgit_definitions=>c_type-blob
|
||||
type = zif_abapgit_git_definitions=>c_type-blob
|
||||
sha1 = <ls_target>-sha1.
|
||||
<ls_conflict>-target_data = <ls_object>-data.
|
||||
|
||||
|
@ -287,7 +287,7 @@ CLASS ZCL_ABAPGIT_MERGE IMPLEMENTATION.
|
|||
LOOP AT lt_visit INTO lv_commit.
|
||||
READ TABLE mt_objects ASSIGNING <ls_object>
|
||||
WITH KEY type COMPONENTS
|
||||
type = zif_abapgit_definitions=>c_type-commit
|
||||
type = zif_abapgit_git_definitions=>c_type-commit
|
||||
sha1 = lv_commit.
|
||||
ASSERT sy-subrc = 0.
|
||||
|
||||
|
|
|
@ -6,10 +6,10 @@ INTERFACE zif_abapgit_merge PUBLIC .
|
|||
source TYPE zif_abapgit_git_definitions=>ty_git_branch,
|
||||
target TYPE zif_abapgit_git_definitions=>ty_git_branch,
|
||||
common TYPE zif_abapgit_definitions=>ty_ancestor,
|
||||
stree TYPE zif_abapgit_definitions=>ty_expanded_tt,
|
||||
ttree TYPE zif_abapgit_definitions=>ty_expanded_tt,
|
||||
ctree TYPE zif_abapgit_definitions=>ty_expanded_tt,
|
||||
result TYPE zif_abapgit_definitions=>ty_expanded_tt,
|
||||
stree TYPE zif_abapgit_git_definitions=>ty_expanded_tt,
|
||||
ttree TYPE zif_abapgit_git_definitions=>ty_expanded_tt,
|
||||
ctree TYPE zif_abapgit_git_definitions=>ty_expanded_tt,
|
||||
result TYPE zif_abapgit_git_definitions=>ty_expanded_tt,
|
||||
stage TYPE REF TO zcl_abapgit_stage,
|
||||
conflict TYPE string,
|
||||
END OF ty_merge .
|
||||
|
|
|
@ -31,10 +31,10 @@ CLASS zcl_abapgit_gui_page_merge DEFINITION
|
|||
|
||||
METHODS show_file
|
||||
IMPORTING
|
||||
!it_expanded TYPE zif_abapgit_definitions=>ty_expanded_tt
|
||||
!it_expanded TYPE zif_abapgit_git_definitions=>ty_expanded_tt
|
||||
!ii_html TYPE REF TO zif_abapgit_html
|
||||
!is_file TYPE zif_abapgit_definitions=>ty_expanded
|
||||
!is_result TYPE zif_abapgit_definitions=>ty_expanded .
|
||||
!is_file TYPE zif_abapgit_git_definitions=>ty_expanded
|
||||
!is_result TYPE zif_abapgit_git_definitions=>ty_expanded .
|
||||
METHODS build_menu
|
||||
IMPORTING
|
||||
VALUE(iv_with_conflict) TYPE abap_bool OPTIONAL
|
||||
|
|
|
@ -32,7 +32,7 @@ CLASS zcl_abapgit_gui_page_sett_remo DEFINITION
|
|||
url TYPE zif_abapgit_persistence=>ty_repo-url,
|
||||
branch TYPE zif_abapgit_git_definitions=>ty_git_branch-name,
|
||||
tag TYPE zif_abapgit_git_definitions=>ty_git_tag-name,
|
||||
commit TYPE zif_abapgit_definitions=>ty_commit-sha1,
|
||||
commit TYPE zif_abapgit_git_definitions=>ty_commit-sha1,
|
||||
pull_request TYPE string,
|
||||
head_type TYPE ty_head_type,
|
||||
switched_origin TYPE zif_abapgit_persistence=>ty_repo-switched_origin,
|
||||
|
@ -190,7 +190,7 @@ ENDCLASS.
|
|||
|
||||
|
||||
|
||||
CLASS ZCL_ABAPGIT_GUI_PAGE_SETT_REMO IMPLEMENTATION.
|
||||
CLASS zcl_abapgit_gui_page_sett_remo IMPLEMENTATION.
|
||||
|
||||
|
||||
METHOD check_protection.
|
||||
|
|
|
@ -90,7 +90,7 @@ CLASS zcl_abapgit_gui_page_tags DEFINITION
|
|||
|
||||
METHODS choose_commit
|
||||
RETURNING
|
||||
VALUE(rv_commit) TYPE zif_abapgit_definitions=>ty_commit-sha1
|
||||
VALUE(rv_commit) TYPE zif_abapgit_git_definitions=>ty_commit-sha1
|
||||
RAISING
|
||||
zcx_abapgit_exception.
|
||||
|
||||
|
@ -98,7 +98,7 @@ ENDCLASS.
|
|||
|
||||
|
||||
|
||||
CLASS ZCL_ABAPGIT_GUI_PAGE_TAGS IMPLEMENTATION.
|
||||
CLASS zcl_abapgit_gui_page_tags IMPLEMENTATION.
|
||||
|
||||
|
||||
METHOD choose_commit.
|
||||
|
|
|
@ -62,7 +62,7 @@ CLASS zcl_abapgit_popups DEFINITION
|
|||
!iv_branch_name TYPE string
|
||||
EXPORTING
|
||||
!et_value_tab TYPE ty_commit_value_tab_tt
|
||||
!et_commits TYPE zif_abapgit_definitions=>ty_commit_tt
|
||||
!et_commits TYPE zif_abapgit_git_definitions=>ty_commit_tt
|
||||
RAISING
|
||||
zcx_abapgit_exception.
|
||||
ENDCLASS.
|
||||
|
@ -126,7 +126,7 @@ CLASS zcl_abapgit_popups IMPLEMENTATION.
|
|||
lv_time_string TYPE c LENGTH 10.
|
||||
|
||||
FIELD-SYMBOLS:
|
||||
<ls_commit> TYPE zif_abapgit_definitions=>ty_commit,
|
||||
<ls_commit> TYPE zif_abapgit_git_definitions=>ty_commit,
|
||||
<ls_value_tab> TYPE ty_commit_value_tab.
|
||||
|
||||
CLEAR: et_commits, et_value_tab.
|
||||
|
@ -339,7 +339,7 @@ CLASS zcl_abapgit_popups IMPLEMENTATION.
|
|||
METHOD zif_abapgit_popups~commit_list_popup.
|
||||
|
||||
DATA:
|
||||
lt_commits TYPE zif_abapgit_definitions=>ty_commit_tt,
|
||||
lt_commits TYPE zif_abapgit_git_definitions=>ty_commit_tt,
|
||||
lt_value_tab TYPE ty_commit_value_tab_tt,
|
||||
lt_selected_values TYPE ty_commit_value_tab_tt,
|
||||
lt_columns TYPE zif_abapgit_popups=>ty_alv_column_tt.
|
||||
|
|
|
@ -69,7 +69,7 @@ INTERFACE zif_abapgit_popups
|
|||
!iv_repo_url TYPE string
|
||||
!iv_branch_name TYPE string OPTIONAL
|
||||
RETURNING
|
||||
VALUE(rs_commit) TYPE zif_abapgit_definitions=>ty_commit
|
||||
VALUE(rs_commit) TYPE zif_abapgit_git_definitions=>ty_commit
|
||||
RAISING
|
||||
zcx_abapgit_exception .
|
||||
TYPES ty_char1 TYPE c LENGTH 1.
|
||||
|
|
|
@ -96,8 +96,6 @@ INTERFACE zif_abapgit_definitions
|
|||
END OF ty_repo_file .
|
||||
TYPES:
|
||||
ty_repo_file_tt TYPE STANDARD TABLE OF ty_repo_file WITH DEFAULT KEY .
|
||||
TYPES:
|
||||
ty_chmod TYPE c LENGTH 6 .
|
||||
TYPES:
|
||||
BEGIN OF ty_object,
|
||||
sha1 TYPE zif_abapgit_git_definitions=>ty_sha1,
|
||||
|
@ -174,29 +172,7 @@ INTERFACE zif_abapgit_definitions
|
|||
branch_name TYPE string,
|
||||
commit_text TYPE string,
|
||||
END OF ty_transport_to_branch .
|
||||
TYPES:
|
||||
BEGIN OF ty_create,
|
||||
name TYPE string,
|
||||
parent TYPE string,
|
||||
END OF ty_create .
|
||||
TYPES:
|
||||
BEGIN OF ty_commit,
|
||||
sha1 TYPE zif_abapgit_git_definitions=>ty_sha1,
|
||||
parent1 TYPE zif_abapgit_git_definitions=>ty_sha1,
|
||||
parent2 TYPE zif_abapgit_git_definitions=>ty_sha1,
|
||||
author TYPE string,
|
||||
email TYPE string,
|
||||
time TYPE string,
|
||||
message TYPE string,
|
||||
body TYPE STANDARD TABLE OF string WITH DEFAULT KEY,
|
||||
branch TYPE string,
|
||||
merge TYPE string,
|
||||
tags TYPE STANDARD TABLE OF string WITH DEFAULT KEY,
|
||||
create TYPE STANDARD TABLE OF ty_create WITH DEFAULT KEY,
|
||||
compressed TYPE abap_bool,
|
||||
END OF ty_commit .
|
||||
TYPES:
|
||||
ty_commit_tt TYPE STANDARD TABLE OF ty_commit WITH DEFAULT KEY .
|
||||
|
||||
TYPES:
|
||||
BEGIN OF ty_diff,
|
||||
patch_flag TYPE abap_bool,
|
||||
|
@ -219,15 +195,6 @@ INTERFACE zif_abapgit_definitions
|
|||
delete TYPE i,
|
||||
update TYPE i,
|
||||
END OF ty_count .
|
||||
TYPES:
|
||||
BEGIN OF ty_expanded,
|
||||
path TYPE string,
|
||||
name TYPE string,
|
||||
sha1 TYPE zif_abapgit_git_definitions=>ty_sha1,
|
||||
chmod TYPE ty_chmod,
|
||||
END OF ty_expanded .
|
||||
TYPES:
|
||||
ty_expanded_tt TYPE STANDARD TABLE OF ty_expanded WITH DEFAULT KEY .
|
||||
TYPES:
|
||||
BEGIN OF ty_ancestor,
|
||||
commit TYPE zif_abapgit_git_definitions=>ty_sha1,
|
||||
|
@ -340,14 +307,6 @@ INTERFACE zif_abapgit_definitions
|
|||
delete TYPE c LENGTH 1 VALUE 'D',
|
||||
update TYPE c LENGTH 1 VALUE 'U',
|
||||
END OF c_diff .
|
||||
CONSTANTS:
|
||||
BEGIN OF c_type,
|
||||
commit TYPE zif_abapgit_git_definitions=>ty_type VALUE 'commit', "#EC NOTEXT
|
||||
tree TYPE zif_abapgit_git_definitions=>ty_type VALUE 'tree', "#EC NOTEXT
|
||||
ref_d TYPE zif_abapgit_git_definitions=>ty_type VALUE 'ref_d', "#EC NOTEXT
|
||||
tag TYPE zif_abapgit_git_definitions=>ty_type VALUE 'tag', "#EC NOTEXT
|
||||
blob TYPE zif_abapgit_git_definitions=>ty_type VALUE 'blob', "#EC NOTEXT
|
||||
END OF c_type .
|
||||
CONSTANTS:
|
||||
BEGIN OF c_state, " https://git-scm.com/docs/git-status
|
||||
unchanged TYPE zif_abapgit_git_definitions=>ty_item_state VALUE '',
|
||||
|
@ -356,13 +315,6 @@ INTERFACE zif_abapgit_definitions
|
|||
deleted TYPE zif_abapgit_git_definitions=>ty_item_state VALUE 'D',
|
||||
mixed TYPE zif_abapgit_git_definitions=>ty_item_state VALUE '*',
|
||||
END OF c_state .
|
||||
CONSTANTS:
|
||||
BEGIN OF c_chmod,
|
||||
file TYPE ty_chmod VALUE '100644',
|
||||
executable TYPE ty_chmod VALUE '100755',
|
||||
dir TYPE ty_chmod VALUE '40000 ',
|
||||
submodule TYPE ty_chmod VALUE '160000',
|
||||
END OF c_chmod .
|
||||
CONSTANTS c_english TYPE spras VALUE 'E' ##NO_TEXT.
|
||||
CONSTANTS c_root_dir TYPE string VALUE '/' ##NO_TEXT.
|
||||
CONSTANTS c_dot_abapgit TYPE string VALUE '.abapgit.xml' ##NO_TEXT.
|
||||
|
|
Loading…
Reference in New Issue
Block a user