mirror of
https://github.com/abapGit/abapGit.git
synced 2025-05-01 12:20:51 +08:00
New Advanced Link Transport refactor
This commit is contained in:
parent
552a9d9b84
commit
7b018144a6
|
@ -30,7 +30,7 @@ TYPES: ty_string_tt TYPE STANDARD TABLE OF string WITH DEFAULT KEY.
|
|||
|
||||
TYPES:
|
||||
BEGIN OF ty_git_user,
|
||||
name TYPE string,
|
||||
name TYPE string,
|
||||
email TYPE string,
|
||||
END OF ty_git_user.
|
||||
|
||||
|
@ -183,60 +183,61 @@ CONSTANTS: gc_newline TYPE abap_char1 VALUE cl_abap_char_utilities=>newline.
|
|||
|
||||
CONSTANTS: gc_english TYPE spras VALUE 'E'.
|
||||
|
||||
CONSTANTS: gc_root_dir TYPE string VALUE '/',
|
||||
gc_dot_abapgit TYPE string VALUE '.abapgit.xml' ##NO_TEXT,
|
||||
gc_author_regex TYPE string VALUE '^([\w\s\.@\-_1-9]+) <(.*)> (\d{10}) .\d{4}$' ##NO_TEXT.
|
||||
CONSTANTS: gc_root_dir TYPE string VALUE '/',
|
||||
gc_dot_abapgit TYPE string VALUE '.abapgit.xml' ##NO_TEXT,
|
||||
gc_author_regex TYPE string VALUE '^([\w\s\.@\-_1-9]+) <(.*)> (\d{10}).\d{4}$' ##NO_TEXT.
|
||||
|
||||
CONSTANTS: BEGIN OF gc_action,
|
||||
repo_clone TYPE string VALUE 'repo_clone',
|
||||
repo_refresh TYPE string VALUE 'repo_refresh',
|
||||
repo_remove TYPE string VALUE 'repo_remove',
|
||||
repo_purge TYPE string VALUE 'repo_purge',
|
||||
repo_newoffline TYPE string VALUE 'repo_newoffline',
|
||||
repo_remote_attach TYPE string VALUE 'repo_remote_attach',
|
||||
repo_remote_detach TYPE string VALUE 'repo_remote_detach',
|
||||
repo_remote_change TYPE string VALUE 'repo_remote_change',
|
||||
repo_refresh_checksums TYPE string VALUE 'repo_refresh_checksums',
|
||||
repo_toggle_fav TYPE string VALUE 'repo_toggle_fav',
|
||||
repo_clone TYPE string VALUE 'repo_clone',
|
||||
repo_refresh TYPE string VALUE 'repo_refresh',
|
||||
repo_remove TYPE string VALUE 'repo_remove',
|
||||
repo_purge TYPE string VALUE 'repo_purge',
|
||||
repo_newoffline TYPE string VALUE 'repo_newoffline',
|
||||
repo_remote_attach TYPE string VALUE 'repo_remote_attach',
|
||||
repo_remote_detach TYPE string VALUE 'repo_remote_detach',
|
||||
repo_remote_change TYPE string VALUE 'repo_remote_change',
|
||||
repo_refresh_checksums TYPE string VALUE 'repo_refresh_checksums',
|
||||
repo_toggle_fav TYPE string VALUE 'repo_toggle_fav',
|
||||
repo_transport_to_pull_reqst TYPE string VALUE 'go_transport_to_pull_request',
|
||||
|
||||
abapgit_home TYPE string VALUE 'abapgit_home',
|
||||
abapgit_wiki TYPE string VALUE 'abapgit_wiki',
|
||||
abapgit_install TYPE string VALUE 'abapgit_install',
|
||||
abapgit_install_pi TYPE string VALUE 'abapgit_install_pi',
|
||||
abapgit_home TYPE string VALUE 'abapgit_home',
|
||||
abapgit_wiki TYPE string VALUE 'abapgit_wiki',
|
||||
abapgit_install TYPE string VALUE 'abapgit_install',
|
||||
abapgit_install_pi TYPE string VALUE 'abapgit_install_pi',
|
||||
|
||||
zip_import TYPE string VALUE 'zip_import',
|
||||
zip_export TYPE string VALUE 'zip_export',
|
||||
zip_package TYPE string VALUE 'zip_package',
|
||||
zip_transport TYPE string VALUE 'zip_transport',
|
||||
zip_object TYPE string VALUE 'zip_object',
|
||||
zip_import TYPE string VALUE 'zip_import',
|
||||
zip_export TYPE string VALUE 'zip_export',
|
||||
zip_package TYPE string VALUE 'zip_package',
|
||||
zip_transport TYPE string VALUE 'zip_transport',
|
||||
zip_object TYPE string VALUE 'zip_object',
|
||||
|
||||
git_pull TYPE string VALUE 'git_pull',
|
||||
git_reset TYPE string VALUE 'git_reset',
|
||||
git_branch_create TYPE string VALUE 'git_branch_create',
|
||||
git_branch_switch TYPE string VALUE 'git_branch_switch',
|
||||
git_branch_delete TYPE string VALUE 'git_branch_delete',
|
||||
git_commit TYPE string VALUE 'git_commit',
|
||||
git_pull TYPE string VALUE 'git_pull',
|
||||
git_reset TYPE string VALUE 'git_reset',
|
||||
git_branch_create TYPE string VALUE 'git_branch_create',
|
||||
git_branch_switch TYPE string VALUE 'git_branch_switch',
|
||||
git_branch_delete TYPE string VALUE 'git_branch_delete',
|
||||
git_commit TYPE string VALUE 'git_commit',
|
||||
|
||||
db_delete TYPE string VALUE 'db_delete',
|
||||
db_update TYPE string VALUE 'db_update',
|
||||
db_display TYPE string VALUE 'db_display',
|
||||
db_edit TYPE string VALUE 'db_edit',
|
||||
bg_update TYPE string VALUE 'bg_update',
|
||||
db_delete TYPE string VALUE 'db_delete',
|
||||
db_update TYPE string VALUE 'db_update',
|
||||
db_display TYPE string VALUE 'db_display',
|
||||
db_edit TYPE string VALUE 'db_edit',
|
||||
bg_update TYPE string VALUE 'bg_update',
|
||||
|
||||
go_main TYPE string VALUE 'go_main',
|
||||
go_explore TYPE string VALUE 'go_explore',
|
||||
go_db TYPE string VALUE 'go_db',
|
||||
go_background TYPE string VALUE 'go_background',
|
||||
go_background_run TYPE string VALUE 'go_background_run',
|
||||
go_diff TYPE string VALUE 'go_diff',
|
||||
go_stage TYPE string VALUE 'go_stage',
|
||||
go_commit TYPE string VALUE 'go_commit',
|
||||
go_branch_overview TYPE string VALUE 'go_branch_overview',
|
||||
go_playground TYPE string VALUE 'go_playground',
|
||||
go_debuginfo TYPE string VALUE 'go_debuginfo',
|
||||
go_settings TYPE string VALUE 'go_settings',
|
||||
go_tutorial TYPE string VALUE 'go_tutorial',
|
||||
go_main TYPE string VALUE 'go_main',
|
||||
go_explore TYPE string VALUE 'go_explore',
|
||||
go_db TYPE string VALUE 'go_db',
|
||||
go_background TYPE string VALUE 'go_background',
|
||||
go_background_run TYPE string VALUE 'go_background_run',
|
||||
go_diff TYPE string VALUE 'go_diff',
|
||||
go_stage TYPE string VALUE 'go_stage',
|
||||
go_commit TYPE string VALUE 'go_commit',
|
||||
go_branch_overview TYPE string VALUE 'go_branch_overview',
|
||||
go_playground TYPE string VALUE 'go_playground',
|
||||
go_debuginfo TYPE string VALUE 'go_debuginfo',
|
||||
go_settings TYPE string VALUE 'go_settings',
|
||||
go_tutorial TYPE string VALUE 'go_tutorial',
|
||||
|
||||
jump TYPE string VALUE 'jump',
|
||||
jump_pkg TYPE string VALUE 'jump_pkg',
|
||||
jump TYPE string VALUE 'jump',
|
||||
jump_pkg TYPE string VALUE 'jump_pkg',
|
||||
END OF gc_action.
|
||||
|
|
|
@ -64,10 +64,12 @@ CLASS lcl_gui_router IMPLEMENTATION.
|
|||
|
||||
METHOD on_event.
|
||||
|
||||
DATA: lv_url TYPE string,
|
||||
lv_key TYPE lcl_persistence_repo=>ty_repo-key,
|
||||
ls_db TYPE lcl_persistence_db=>ty_content,
|
||||
ls_item TYPE ty_item.
|
||||
DATA: lv_url TYPE string,
|
||||
lv_key TYPE lcl_persistence_repo=>ty_repo-key,
|
||||
ls_db TYPE lcl_persistence_db=>ty_content,
|
||||
ls_item TYPE ty_item,
|
||||
lt_transport_headers TYPE trwbo_request_headers,
|
||||
lt_tadir TYPE scts_tadir.
|
||||
|
||||
lv_key = iv_getdata. " TODO refactor
|
||||
lv_url = iv_getdata. " TODO refactor
|
||||
|
@ -171,6 +173,11 @@ CLASS lcl_gui_router IMPLEMENTATION.
|
|||
WHEN gc_action-repo_toggle_fav. " Toggle repo as favorite
|
||||
lcl_services_repo=>toggle_favorite( lv_key ).
|
||||
ev_state = gc_event_state-re_render.
|
||||
WHEN gc_action-repo_transport_to_pull_reqst.
|
||||
lt_transport_headers = lcl_transport_popup=>show( ).
|
||||
lt_tadir = lcl_transport=>to_tadir( lt_transport_headers ).
|
||||
"lcl_services_repo=>transport_to_pull_request( lv_key ).
|
||||
ev_state = gc_event_state-re_render.
|
||||
|
||||
" ZIP services actions
|
||||
WHEN gc_action-zip_import. " Import repo from ZIP
|
||||
|
|
|
@ -1,17 +1,24 @@
|
|||
*&---------------------------------------------------------------------*
|
||||
*& Include ZABAPGIT_TRANSPORT
|
||||
*&---------------------------------------------------------------------*
|
||||
CLASS lcl_transport_popup DEFINITION.
|
||||
PUBLIC SECTION.
|
||||
CLASS-METHODS:
|
||||
show
|
||||
RETURNING VALUE(rt_trkorr) TYPE trwbo_request_headers.
|
||||
ENDCLASS.
|
||||
|
||||
CLASS lcl_transport DEFINITION FINAL.
|
||||
|
||||
PUBLIC SECTION.
|
||||
CLASS-METHODS:
|
||||
zip RAISING lcx_exception.
|
||||
zip RAISING lcx_exception,
|
||||
to_tadir IMPORTING it_transport_headers TYPE trwbo_request_headers
|
||||
RETURNING VALUE(rt_tadir) TYPE scts_tadir
|
||||
RAISING lcx_exception.
|
||||
|
||||
PRIVATE SECTION.
|
||||
CLASS-METHODS:
|
||||
popup
|
||||
RETURNING VALUE(rt_trkorr) TYPE trwbo_request_headers,
|
||||
read_requests
|
||||
IMPORTING it_trkorr TYPE trwbo_request_headers
|
||||
RETURNING VALUE(rt_requests) TYPE trwbo_requests
|
||||
|
@ -38,7 +45,7 @@ CLASS lcl_transport IMPLEMENTATION.
|
|||
lt_trkorr TYPE trwbo_request_headers.
|
||||
|
||||
|
||||
lt_trkorr = popup( ).
|
||||
lt_trkorr = lcl_transport_popup=>show( ).
|
||||
IF lines( lt_trkorr ) = 0.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
|
@ -67,6 +74,22 @@ CLASS lcl_transport IMPLEMENTATION.
|
|||
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD to_tadir.
|
||||
DATA: lt_requests TYPE trwbo_requests,
|
||||
lt_tadir TYPE scts_tadir,
|
||||
lv_package TYPE devclass,
|
||||
lt_trkorr TYPE trwbo_request_headers.
|
||||
|
||||
|
||||
lt_trkorr = lcl_transport_popup=>show( ).
|
||||
IF lines( lt_trkorr ) = 0.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
|
||||
lt_requests = read_requests( lt_trkorr ).
|
||||
lt_tadir = resolve( lt_requests ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD find_top_package.
|
||||
* assumption: all objects in transport share a common super package
|
||||
|
||||
|
@ -100,41 +123,6 @@ CLASS lcl_transport IMPLEMENTATION.
|
|||
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD popup.
|
||||
DATA: lrs_trfunction TYPE trsel_trs_function,
|
||||
lv_types TYPE string,
|
||||
ls_ranges TYPE trsel_ts_ranges.
|
||||
|
||||
" Fill all request types
|
||||
lv_types = 'KWTCOEMPDRSXQFG'.
|
||||
lrs_trfunction-sign = 'I'.
|
||||
lrs_trfunction-option = 'EQ'.
|
||||
WHILE lv_types NE space.
|
||||
lrs_trfunction-low = lv_types(1).
|
||||
APPEND lrs_trfunction TO ls_ranges-request_funcs.
|
||||
SHIFT lv_types.
|
||||
ENDWHILE.
|
||||
|
||||
CALL FUNCTION 'TRINT_SELECT_REQUESTS'
|
||||
EXPORTING
|
||||
iv_username_pattern = sy-uname
|
||||
iv_via_selscreen = 'X'
|
||||
iv_complete_projects = ''
|
||||
* is_popup =
|
||||
iv_title = 'abapGit: Transport Request Selection'
|
||||
IMPORTING
|
||||
et_requests = rt_trkorr
|
||||
CHANGING
|
||||
cs_ranges = ls_ranges
|
||||
EXCEPTIONS
|
||||
action_aborted_by_user = 1
|
||||
OTHERS = 2.
|
||||
IF sy-subrc <> 0.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD read_requests.
|
||||
|
||||
DATA lt_requests LIKE rt_requests.
|
||||
|
@ -205,3 +193,38 @@ CLASS lcl_transport IMPLEMENTATION.
|
|||
ENDMETHOD.
|
||||
|
||||
ENDCLASS.
|
||||
CLASS lcl_transport_popup IMPLEMENTATION.
|
||||
METHOD show.
|
||||
DATA: lrs_trfunction TYPE trsel_trs_function,
|
||||
lv_types TYPE string,
|
||||
ls_ranges TYPE trsel_ts_ranges.
|
||||
|
||||
" Fill all request types
|
||||
lv_types = 'KWTCOEMPDRSXQFG'.
|
||||
lrs_trfunction-sign = 'I'.
|
||||
lrs_trfunction-option = 'EQ'.
|
||||
WHILE lv_types NE space.
|
||||
lrs_trfunction-low = lv_types(1).
|
||||
APPEND lrs_trfunction TO ls_ranges-request_funcs.
|
||||
SHIFT lv_types.
|
||||
ENDWHILE.
|
||||
|
||||
CALL FUNCTION 'TRINT_SELECT_REQUESTS'
|
||||
EXPORTING
|
||||
iv_username_pattern = sy-uname
|
||||
iv_via_selscreen = 'X'
|
||||
iv_complete_projects = ''
|
||||
* is_popup =
|
||||
iv_title = 'abapGit: Transport Request Selection'
|
||||
IMPORTING
|
||||
et_requests = rt_trkorr
|
||||
CHANGING
|
||||
cs_ranges = ls_ranges
|
||||
EXCEPTIONS
|
||||
action_aborted_by_user = 1
|
||||
OTHERS = 2.
|
||||
IF sy-subrc <> 0.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
|
|
|
@ -309,6 +309,8 @@ CLASS lcl_gui_view_repo_content IMPLEMENTATION.
|
|||
iv_act = |{ gc_action-repo_remote_detach }?{ lv_key }| ).
|
||||
lo_tb_advanced->add( iv_txt = 'Force stage'
|
||||
iv_act = |{ gc_action-go_stage }?{ lv_key }| ).
|
||||
lo_tb_advanced->add( iv_txt = 'Transport to Pull Request'
|
||||
iv_act = |{ gc_action-repo_transport_to_pull_reqst }?{ lv_key }| ).
|
||||
ELSE.
|
||||
lo_tb_advanced->add( iv_txt = 'Make on-line'
|
||||
iv_act = |{ gc_action-repo_remote_attach }?{ lv_key }| ).
|
||||
|
|
Loading…
Reference in New Issue
Block a user