mirror of
https://github.com/abapGit/abapGit.git
synced 2025-05-01 12:20:51 +08:00
Strip XML details user exit (#4599)
* exit draft * call exit * linter fix * PRE_CALCULATE_REPO_STATUS docs * settings UI * wire status calculation and repo settings * uppercase * diff rendering fix * adjust docs * adjust docs * Remove settings * more docs adjustments * pass repo meta data into the exit Co-authored-by: Lars Hvam <larshp@hotmail.com>
This commit is contained in:
parent
a77160e58c
commit
17eac7b6c3
BIN
docs/img/deployment_diff_difference_sample.png
Normal file
BIN
docs/img/deployment_diff_difference_sample.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 26 KiB |
|
@ -60,3 +60,11 @@ Can be used to set the URL to display a commit. There are default implementation
|
|||
| github | http(s):\/\/github.com/<user\>/\<repo\>.git | http(s):\/\/github.com/<user\>/\<repo\>/commit/<sha1\> |
|
||||
| bitbucket | http(s):\/\/bitbucket.org/<user\>/\<repo\>.git | http(s):\/\/bitbucket.org/<user\>/\<repo\>/commits/<sha1\> |
|
||||
| gitlab | http(s):\/\/gitlab.com/<user\>/\<repo\>.git | http(s):\/\/gitlab.com/\<user\>/\<repo\>/-/commit/<sha1\> |
|
||||
|
||||
### PRE_CALCULATE_REPO_STATUS
|
||||
|
||||
Can be used to modify local and remote files before calculating diff status. Useful to remove diffs which are caused by deployment between different system version. See also: [abapgit xml stripper plugin](https://github.com/sbcgua/abapgit_xml_stripper_plugin)
|
||||
|
||||

|
||||
|
||||
The exit also receives a repo meta data snapshot (`zif_abapgit_persistence=>ty_repo`) to identify the repo and it's attributes in the current system (e.g. package). This can be used to enable/disable the exit for specific repos.
|
||||
|
|
|
@ -113,7 +113,7 @@ ENDCLASS.
|
|||
|
||||
|
||||
|
||||
CLASS zcl_abapgit_file_status IMPLEMENTATION.
|
||||
CLASS ZCL_ABAPGIT_FILE_STATUS IMPLEMENTATION.
|
||||
|
||||
|
||||
METHOD build_existing.
|
||||
|
@ -673,6 +673,8 @@ CLASS zcl_abapgit_file_status IMPLEMENTATION.
|
|||
METHOD status.
|
||||
|
||||
DATA lt_local TYPE zif_abapgit_definitions=>ty_files_item_tt.
|
||||
DATA lt_remote TYPE zif_abapgit_definitions=>ty_files_tt.
|
||||
DATA li_exit TYPE REF TO zif_abapgit_exit.
|
||||
|
||||
lt_local = io_repo->get_files_local( ii_log ).
|
||||
|
||||
|
@ -684,11 +686,21 @@ CLASS zcl_abapgit_file_status IMPLEMENTATION.
|
|||
io_repo->find_remote_dot_abapgit( ).
|
||||
ENDIF.
|
||||
|
||||
lt_remote = io_repo->get_files_remote( ).
|
||||
|
||||
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 ).
|
||||
|
||||
rt_results = calculate_status(
|
||||
iv_devclass = io_repo->get_package( )
|
||||
io_dot = io_repo->get_dot_abapgit( )
|
||||
it_local = io_repo->get_files_local( ii_log )
|
||||
it_remote = io_repo->get_files_remote( )
|
||||
it_local = lt_local
|
||||
it_remote = lt_remote
|
||||
it_cur_state = io_repo->get_local_checksums_per_file( ) ).
|
||||
|
||||
run_checks(
|
||||
|
|
|
@ -204,7 +204,7 @@ ENDCLASS.
|
|||
|
||||
|
||||
|
||||
CLASS zcl_abapgit_gui_page_diff IMPLEMENTATION.
|
||||
CLASS ZCL_ABAPGIT_GUI_PAGE_DIFF IMPLEMENTATION.
|
||||
|
||||
|
||||
METHOD add_filter_sub_menu.
|
||||
|
@ -414,6 +414,8 @@ CLASS zcl_abapgit_gui_page_diff IMPLEMENTATION.
|
|||
lt_local TYPE zif_abapgit_definitions=>ty_files_item_tt,
|
||||
lt_status TYPE zif_abapgit_definitions=>ty_results_tt.
|
||||
|
||||
DATA li_exit TYPE REF TO zif_abapgit_exit.
|
||||
|
||||
FIELD-SYMBOLS: <ls_status> LIKE LINE OF lt_status.
|
||||
|
||||
CLEAR: mt_diff_files.
|
||||
|
@ -423,6 +425,14 @@ CLASS zcl_abapgit_gui_page_diff IMPLEMENTATION.
|
|||
mo_repo->reset_status( ).
|
||||
lt_status = mo_repo->status( ).
|
||||
|
||||
li_exit = zcl_abapgit_exit=>get_instance( ).
|
||||
li_exit->pre_calculate_repo_status(
|
||||
EXPORTING
|
||||
is_repo_meta = mo_repo->ms_data
|
||||
CHANGING
|
||||
ct_local = lt_local
|
||||
ct_remote = lt_remote ).
|
||||
|
||||
IF is_file IS NOT INITIAL. " Diff for one file
|
||||
|
||||
READ TABLE lt_status ASSIGNING <ls_status>
|
||||
|
|
|
@ -73,7 +73,7 @@ ENDCLASS.
|
|||
|
||||
|
||||
|
||||
CLASS zcl_abapgit_gui_page_sett_locl IMPLEMENTATION.
|
||||
CLASS ZCL_ABAPGIT_GUI_PAGE_SETT_LOCL IMPLEMENTATION.
|
||||
|
||||
|
||||
METHOD constructor.
|
||||
|
|
|
@ -15,7 +15,7 @@ ENDCLASS.
|
|||
|
||||
|
||||
|
||||
CLASS zcl_abapgit_exit IMPLEMENTATION.
|
||||
CLASS ZCL_ABAPGIT_EXIT IMPLEMENTATION.
|
||||
|
||||
|
||||
METHOD get_instance.
|
||||
|
@ -32,6 +32,23 @@ CLASS zcl_abapgit_exit IMPLEMENTATION.
|
|||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD zif_abapgit_exit~adjust_display_commit_url.
|
||||
|
||||
TRY.
|
||||
gi_exit->adjust_display_commit_url(
|
||||
EXPORTING
|
||||
iv_repo_url = iv_repo_url
|
||||
iv_repo_name = iv_repo_name
|
||||
iv_repo_key = iv_repo_key
|
||||
iv_commit_hash = iv_commit_hash
|
||||
CHANGING
|
||||
cv_display_url = cv_display_url ).
|
||||
CATCH cx_sy_ref_is_initial cx_sy_dyn_call_illegal_method ##NO_HANDLER.
|
||||
ENDTRY.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD zif_abapgit_exit~allow_sap_objects.
|
||||
|
||||
TRY.
|
||||
|
@ -178,20 +195,17 @@ CLASS zcl_abapgit_exit IMPLEMENTATION.
|
|||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD zif_abapgit_exit~adjust_display_commit_url.
|
||||
METHOD zif_abapgit_exit~pre_calculate_repo_status.
|
||||
|
||||
TRY.
|
||||
gi_exit->adjust_display_commit_url(
|
||||
gi_exit->pre_calculate_repo_status(
|
||||
EXPORTING
|
||||
iv_repo_url = iv_repo_url
|
||||
iv_repo_name = iv_repo_name
|
||||
iv_repo_key = iv_repo_key
|
||||
iv_commit_hash = iv_commit_hash
|
||||
is_repo_meta = is_repo_meta
|
||||
CHANGING
|
||||
cv_display_url = cv_display_url ).
|
||||
ct_local = ct_local
|
||||
ct_remote = ct_remote ).
|
||||
CATCH cx_sy_ref_is_initial cx_sy_dyn_call_illegal_method ##NO_HANDLER.
|
||||
ENDTRY.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
ENDCLASS.
|
||||
|
|
|
@ -79,4 +79,12 @@ INTERFACE zif_abapgit_exit
|
|||
!cv_display_url TYPE csequence
|
||||
RAISING
|
||||
zcx_abapgit_exception .
|
||||
METHODS pre_calculate_repo_status
|
||||
IMPORTING
|
||||
is_repo_meta TYPE zif_abapgit_persistence=>ty_repo
|
||||
CHANGING
|
||||
!ct_local TYPE zif_abapgit_definitions=>ty_files_item_tt
|
||||
!ct_remote TYPE zif_abapgit_definitions=>ty_files_tt
|
||||
RAISING
|
||||
zcx_abapgit_exception .
|
||||
ENDINTERFACE.
|
||||
|
|
Loading…
Reference in New Issue
Block a user