mirror of
https://github.com/abapGit/abapGit.git
synced 2025-05-01 12:20:51 +08:00
Merge remote-tracking branch 'refs/remotes/larshp/master'
This commit is contained in:
commit
f5929ccc96
|
@ -140,6 +140,12 @@ TYPES: BEGIN OF ty_sotr,
|
||||||
|
|
||||||
TYPES: ty_sotr_tt TYPE STANDARD TABLE OF ty_sotr WITH DEFAULT KEY.
|
TYPES: ty_sotr_tt TYPE STANDARD TABLE OF ty_sotr WITH DEFAULT KEY.
|
||||||
|
|
||||||
|
TYPES:
|
||||||
|
BEGIN OF ty_transport_to_branch,
|
||||||
|
branch_name TYPE string,
|
||||||
|
commit_text TYPE string,
|
||||||
|
END OF ty_transport_to_branch.
|
||||||
|
|
||||||
CONSTANTS: BEGIN OF gc_state, " https://git-scm.com/docs/git-status
|
CONSTANTS: BEGIN OF gc_state, " https://git-scm.com/docs/git-status
|
||||||
unchanged TYPE char1 VALUE '',
|
unchanged TYPE char1 VALUE '',
|
||||||
added TYPE char1 VALUE 'A',
|
added TYPE char1 VALUE 'A',
|
||||||
|
@ -198,6 +204,7 @@ CONSTANTS: BEGIN OF gc_action,
|
||||||
repo_remote_change TYPE string VALUE 'repo_remote_change',
|
repo_remote_change TYPE string VALUE 'repo_remote_change',
|
||||||
repo_refresh_checksums TYPE string VALUE 'repo_refresh_checksums',
|
repo_refresh_checksums TYPE string VALUE 'repo_refresh_checksums',
|
||||||
repo_toggle_fav TYPE string VALUE 'repo_toggle_fav',
|
repo_toggle_fav TYPE string VALUE 'repo_toggle_fav',
|
||||||
|
repo_transport_to_branch TYPE string VALUE 'repo_transport_to_branch',
|
||||||
|
|
||||||
abapgit_home TYPE string VALUE 'abapgit_home',
|
abapgit_home TYPE string VALUE 'abapgit_home',
|
||||||
abapgit_wiki TYPE string VALUE 'abapgit_wiki',
|
abapgit_wiki TYPE string VALUE 'abapgit_wiki',
|
||||||
|
|
|
@ -171,6 +171,9 @@ CLASS lcl_gui_router IMPLEMENTATION.
|
||||||
WHEN gc_action-repo_toggle_fav. " Toggle repo as favorite
|
WHEN gc_action-repo_toggle_fav. " Toggle repo as favorite
|
||||||
lcl_services_repo=>toggle_favorite( lv_key ).
|
lcl_services_repo=>toggle_favorite( lv_key ).
|
||||||
ev_state = gc_event_state-re_render.
|
ev_state = gc_event_state-re_render.
|
||||||
|
WHEN gc_action-repo_transport_to_branch.
|
||||||
|
lcl_services_repo=>transport_to_branch( iv_repository_key = lv_key ).
|
||||||
|
ev_state = gc_event_state-re_render.
|
||||||
|
|
||||||
" ZIP services actions
|
" ZIP services actions
|
||||||
WHEN gc_action-zip_import. " Import repo from ZIP
|
WHEN gc_action-zip_import. " Import repo from ZIP
|
||||||
|
|
|
@ -557,7 +557,10 @@ CLASS lcl_object_oriented_class IMPLEMENTATION.
|
||||||
APPEND cl_oo_classname_service=>get_prisec_name( lv_class_name ) TO rt_includes.
|
APPEND cl_oo_classname_service=>get_prisec_name( lv_class_name ) TO rt_includes.
|
||||||
APPEND cl_oo_classname_service=>get_classpool_name( lv_class_name ) TO rt_includes.
|
APPEND cl_oo_classname_service=>get_classpool_name( lv_class_name ) TO rt_includes.
|
||||||
APPEND cl_oo_classname_service=>get_ct_name( lv_class_name ) TO rt_includes.
|
APPEND cl_oo_classname_service=>get_ct_name( lv_class_name ) TO rt_includes.
|
||||||
APPEND cl_oo_classname_service=>get_cs_name( lv_class_name ) TO rt_includes.
|
|
||||||
|
* skip the CS include, as it is sometimes generated on the fly instead of
|
||||||
|
* when the methods are changed
|
||||||
|
* APPEND cl_oo_classname_service=>get_cs_name( lv_class_name ) TO rt_includes.
|
||||||
|
|
||||||
lt_methods = cl_oo_classname_service=>get_all_method_includes( lv_class_name ).
|
lt_methods = cl_oo_classname_service=>get_all_method_includes( lv_class_name ).
|
||||||
LOOP AT lt_methods ASSIGNING <ls_method>.
|
LOOP AT lt_methods ASSIGNING <ls_method>.
|
||||||
|
|
|
@ -68,7 +68,18 @@ CLASS lcl_popups DEFINITION FINAL.
|
||||||
popup_to_create_package
|
popup_to_create_package
|
||||||
EXPORTING es_package_data TYPE scompkdtln
|
EXPORTING es_package_data TYPE scompkdtln
|
||||||
ev_create TYPE boolean
|
ev_create TYPE boolean
|
||||||
RAISING lcx_exception.
|
RAISING lcx_exception,
|
||||||
|
popup_to_create_transp_branch
|
||||||
|
IMPORTING it_transport_headers TYPE trwbo_request_headers
|
||||||
|
it_transport_objects TYPE scts_tadir
|
||||||
|
RETURNING VALUE(rs_transport_branch) TYPE ty_transport_to_branch
|
||||||
|
RAISING lcx_exception
|
||||||
|
lcx_cancel,
|
||||||
|
popup_to_select_transports
|
||||||
|
RETURNING VALUE(rt_trkorr) TYPE trwbo_request_headers.
|
||||||
|
PRIVATE SECTION.
|
||||||
|
|
||||||
|
|
||||||
ENDCLASS.
|
ENDCLASS.
|
||||||
|
|
||||||
CLASS lcl_popups IMPLEMENTATION.
|
CLASS lcl_popups IMPLEMENTATION.
|
||||||
|
@ -544,4 +555,92 @@ CLASS lcl_popups IMPLEMENTATION.
|
||||||
ENDIF.
|
ENDIF.
|
||||||
ENDMETHOD. " popup_to_create_package
|
ENDMETHOD. " popup_to_create_package
|
||||||
|
|
||||||
|
METHOD popup_to_select_transports.
|
||||||
|
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 popup_to_create_transp_branch.
|
||||||
|
DATA: lv_returncode TYPE c,
|
||||||
|
lt_fields TYPE TABLE OF sval,
|
||||||
|
lv_icon_ok TYPE icon-name,
|
||||||
|
lv_button_transport TYPE svalbutton-buttontext,
|
||||||
|
lv_icon_transport TYPE icon-name,
|
||||||
|
lv_transports_as_text TYPE string,
|
||||||
|
ls_transport_header LIKE LINE OF it_transport_headers.
|
||||||
|
|
||||||
|
FIELD-SYMBOLS: <ls_field> LIKE LINE OF lt_fields.
|
||||||
|
|
||||||
|
lv_transports_as_text = 'Transport(s)'.
|
||||||
|
LOOP AT it_transport_headers INTO ls_transport_header.
|
||||||
|
CONCATENATE lv_transports_as_text '_' ls_transport_header-trkorr INTO lv_transports_as_text.
|
||||||
|
ENDLOOP.
|
||||||
|
|
||||||
|
" TAB FLD LABEL DEF ATTR
|
||||||
|
_add_dialog_fld 'TEXTL' 'LINE' 'Branch name' lv_transports_as_text ''.
|
||||||
|
_add_dialog_fld 'ABAPTXT255' 'LINE' 'Commit text' lv_transports_as_text ''.
|
||||||
|
|
||||||
|
lv_icon_ok = icon_okay.
|
||||||
|
lv_button_transport = 'Transport(s)->Branch' ##NO_TEXT.
|
||||||
|
lv_icon_transport = icon_import_all_requests.
|
||||||
|
|
||||||
|
CALL FUNCTION 'POPUP_GET_VALUES'
|
||||||
|
EXPORTING
|
||||||
|
* no_value_check = SPACE " Deactivates data type check
|
||||||
|
popup_title = 'Transport to new Branch'
|
||||||
|
* start_column = '5' " Start column of the dialog box
|
||||||
|
* start_row = '5' " Start line of the dialog box
|
||||||
|
IMPORTING
|
||||||
|
returncode = lv_returncode
|
||||||
|
TABLES
|
||||||
|
fields = lt_fields " Table fields, values and attributes
|
||||||
|
EXCEPTIONS
|
||||||
|
error_in_fields = 1
|
||||||
|
OTHERS = 2.
|
||||||
|
IF sy-subrc <> 0.
|
||||||
|
lcx_exception=>raise( 'Error from POPUP_GET_VALUES' ).
|
||||||
|
ENDIF.
|
||||||
|
|
||||||
|
IF lv_returncode = 'A'.
|
||||||
|
RAISE EXCEPTION TYPE lcx_cancel.
|
||||||
|
ENDIF.
|
||||||
|
|
||||||
|
READ TABLE lt_fields INDEX 1 ASSIGNING <ls_field>.
|
||||||
|
ASSERT sy-subrc = 0.
|
||||||
|
rs_transport_branch-branch_name = <ls_field>-value.
|
||||||
|
|
||||||
|
READ TABLE lt_fields INDEX 2 ASSIGNING <ls_field>.
|
||||||
|
ASSERT sy-subrc = 0.
|
||||||
|
rs_transport_branch-commit_text = <ls_field>-value.
|
||||||
|
ENDMETHOD.
|
||||||
|
|
||||||
ENDCLASS.
|
ENDCLASS.
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
*& Include ZABAPGIT_SERVICES
|
*& Include ZABAPGIT_SERVICES
|
||||||
*&---------------------------------------------------------------------*
|
*&---------------------------------------------------------------------*
|
||||||
|
|
||||||
|
INCLUDE zabapgit_services_git.
|
||||||
INCLUDE zabapgit_services_repo.
|
INCLUDE zabapgit_services_repo.
|
||||||
INCLUDE zabapgit_services_abapgit.
|
INCLUDE zabapgit_services_abapgit.
|
||||||
INCLUDE zabapgit_services_git.
|
|
||||||
INCLUDE zabapgit_services_db.
|
INCLUDE zabapgit_services_db.
|
||||||
INCLUDE zabapgit_services_background.
|
INCLUDE zabapgit_services_background.
|
||||||
|
|
|
@ -47,6 +47,10 @@ CLASS lcl_services_repo DEFINITION FINAL.
|
||||||
IMPORTING iv_package TYPE devclass
|
IMPORTING iv_package TYPE devclass
|
||||||
RAISING lcx_exception.
|
RAISING lcx_exception.
|
||||||
|
|
||||||
|
CLASS-METHODS transport_to_branch
|
||||||
|
IMPORTING iv_repository_key TYPE lcl_persistence_db=>ty_value
|
||||||
|
RAISING lcx_exception lcx_cancel.
|
||||||
|
|
||||||
ENDCLASS. "lcl_services_repo
|
ENDCLASS. "lcl_services_repo
|
||||||
|
|
||||||
CLASS lcl_services_repo IMPLEMENTATION.
|
CLASS lcl_services_repo IMPLEMENTATION.
|
||||||
|
@ -314,4 +318,31 @@ CLASS lcl_services_repo IMPLEMENTATION.
|
||||||
|
|
||||||
ENDMETHOD. " open_se80.
|
ENDMETHOD. " open_se80.
|
||||||
|
|
||||||
|
|
||||||
|
METHOD transport_to_branch.
|
||||||
|
DATA:
|
||||||
|
lo_repository TYPE REF TO lcl_repo_online,
|
||||||
|
lo_transport_to_branch TYPE REF TO lcl_transport_to_branch,
|
||||||
|
lt_transport_headers TYPE trwbo_request_headers,
|
||||||
|
lt_transport_objects TYPE scts_tadir,
|
||||||
|
ls_transport_to_branch TYPE ty_transport_to_branch.
|
||||||
|
|
||||||
|
lo_repository ?= lcl_app=>repo_srv( )->get( iv_repository_key ).
|
||||||
|
|
||||||
|
lt_transport_headers = lcl_popups=>popup_to_select_transports( ).
|
||||||
|
lt_transport_objects = lcl_transport=>to_tadir( lt_transport_headers ).
|
||||||
|
IF lt_transport_objects IS INITIAL.
|
||||||
|
lcx_exception=>raise( 'Canceled or List of objects is empty ' ).
|
||||||
|
ENDIF.
|
||||||
|
ls_transport_to_branch = lcl_popups=>popup_to_create_transp_branch(
|
||||||
|
it_transport_headers = lt_transport_headers
|
||||||
|
it_transport_objects = lt_transport_objects ).
|
||||||
|
|
||||||
|
CREATE OBJECT lo_transport_to_branch.
|
||||||
|
lo_transport_to_branch->create(
|
||||||
|
io_repository = lo_repository
|
||||||
|
is_transport_to_branch = ls_transport_to_branch
|
||||||
|
it_transport_objects = lt_transport_objects ).
|
||||||
|
ENDMETHOD.
|
||||||
|
|
||||||
ENDCLASS. "lcl_services_repo
|
ENDCLASS. "lcl_services_repo
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
*&---------------------------------------------------------------------*
|
*&---------------------------------------------------------------------*
|
||||||
*& Include ZABAPGIT_TRANSPORT
|
*& Include ZABAPGIT_TRANSPORT
|
||||||
*&---------------------------------------------------------------------*
|
*&---------------------------------------------------------------------*
|
||||||
|
|
||||||
CLASS lcl_transport DEFINITION FINAL.
|
CLASS lcl_transport DEFINITION FINAL.
|
||||||
|
|
||||||
PUBLIC SECTION.
|
PUBLIC SECTION.
|
||||||
CLASS-METHODS:
|
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.
|
PRIVATE SECTION.
|
||||||
CLASS-METHODS:
|
CLASS-METHODS:
|
||||||
popup
|
|
||||||
RETURNING VALUE(rt_trkorr) TYPE trwbo_request_headers,
|
|
||||||
read_requests
|
read_requests
|
||||||
IMPORTING it_trkorr TYPE trwbo_request_headers
|
IMPORTING it_trkorr TYPE trwbo_request_headers
|
||||||
RETURNING VALUE(rt_requests) TYPE trwbo_requests
|
RETURNING VALUE(rt_requests) TYPE trwbo_requests
|
||||||
|
@ -38,7 +38,7 @@ CLASS lcl_transport IMPLEMENTATION.
|
||||||
lt_trkorr TYPE trwbo_request_headers.
|
lt_trkorr TYPE trwbo_request_headers.
|
||||||
|
|
||||||
|
|
||||||
lt_trkorr = popup( ).
|
lt_trkorr = lcl_popups=>popup_to_select_transports( ).
|
||||||
IF lines( lt_trkorr ) = 0.
|
IF lines( lt_trkorr ) = 0.
|
||||||
RETURN.
|
RETURN.
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
@ -67,6 +67,21 @@ CLASS lcl_transport IMPLEMENTATION.
|
||||||
|
|
||||||
ENDMETHOD.
|
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.
|
||||||
|
|
||||||
|
|
||||||
|
IF lines( it_transport_headers ) = 0.
|
||||||
|
RETURN.
|
||||||
|
ENDIF.
|
||||||
|
|
||||||
|
lt_requests = read_requests( it_transport_headers ).
|
||||||
|
rt_tadir = resolve( lt_requests ).
|
||||||
|
ENDMETHOD.
|
||||||
|
|
||||||
METHOD find_top_package.
|
METHOD find_top_package.
|
||||||
* assumption: all objects in transport share a common super package
|
* assumption: all objects in transport share a common super package
|
||||||
|
|
||||||
|
@ -100,41 +115,6 @@ CLASS lcl_transport IMPLEMENTATION.
|
||||||
|
|
||||||
ENDMETHOD.
|
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.
|
METHOD read_requests.
|
||||||
|
|
||||||
DATA lt_requests LIKE rt_requests.
|
DATA lt_requests LIKE rt_requests.
|
||||||
|
@ -203,5 +183,142 @@ CLASS lcl_transport IMPLEMENTATION.
|
||||||
DELETE ADJACENT DUPLICATES FROM rt_tadir COMPARING object obj_name.
|
DELETE ADJACENT DUPLICATES FROM rt_tadir COMPARING object obj_name.
|
||||||
DELETE rt_tadir WHERE table_line IS INITIAL.
|
DELETE rt_tadir WHERE table_line IS INITIAL.
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
ENDCLASS.
|
||||||
|
|
||||||
|
CLASS lcl_transport_to_branch DEFINITION.
|
||||||
|
PUBLIC SECTION.
|
||||||
|
METHODS:
|
||||||
|
create
|
||||||
|
IMPORTING io_repository TYPE REF TO lcl_repo_online
|
||||||
|
is_transport_to_branch TYPE ty_transport_to_branch
|
||||||
|
it_transport_objects TYPE scts_tadir
|
||||||
|
RAISING lcx_exception.
|
||||||
|
PRIVATE SECTION.
|
||||||
|
|
||||||
|
METHODS create_new_branch
|
||||||
|
IMPORTING
|
||||||
|
io_repository TYPE REF TO lcl_repo_online
|
||||||
|
iv_branch_name TYPE string
|
||||||
|
RAISING
|
||||||
|
lcx_exception.
|
||||||
|
METHODS generate_commit_message
|
||||||
|
IMPORTING
|
||||||
|
is_transport_to_branch TYPE ty_transport_to_branch
|
||||||
|
RETURNING
|
||||||
|
VALUE(rs_comment) TYPE ty_comment.
|
||||||
|
METHODS stage_transport_objects
|
||||||
|
IMPORTING
|
||||||
|
it_transport_objects TYPE scts_tadir
|
||||||
|
io_stage TYPE REF TO lcl_stage
|
||||||
|
is_stage_objects TYPE ty_stage_files
|
||||||
|
it_object_statuses TYPE ty_results_tt
|
||||||
|
RAISING
|
||||||
|
lcx_exception.
|
||||||
|
ENDCLASS.
|
||||||
|
|
||||||
|
CLASS lcl_transport_to_branch IMPLEMENTATION.
|
||||||
|
|
||||||
|
METHOD create.
|
||||||
|
DATA:
|
||||||
|
ls_transport_object TYPE LINE OF scts_tadir,
|
||||||
|
lt_items TYPE ty_files_item_tt,
|
||||||
|
ls_local_file TYPE LINE OF ty_files_item_tt,
|
||||||
|
ls_remote_file TYPE LINE OF ty_files_tt,
|
||||||
|
ls_item TYPE string,
|
||||||
|
lv_branch_name TYPE string,
|
||||||
|
ls_comment TYPE ty_comment,
|
||||||
|
lo_stage TYPE REF TO lcl_stage,
|
||||||
|
ls_stage_objects TYPE ty_stage_files,
|
||||||
|
lt_object_statuses TYPE ty_results_tt,
|
||||||
|
ls_object_status TYPE LINE OF ty_results_tt.
|
||||||
|
|
||||||
|
lv_branch_name = lcl_git_branch_list=>complete_heads_branch_name(
|
||||||
|
lcl_git_branch_list=>normalize_branch_name( is_transport_to_branch-branch_name ) ).
|
||||||
|
|
||||||
|
create_new_branch(
|
||||||
|
io_repository = io_repository
|
||||||
|
iv_branch_name = lv_branch_name ).
|
||||||
|
|
||||||
|
CREATE OBJECT lo_stage
|
||||||
|
EXPORTING
|
||||||
|
iv_branch_name = lv_branch_name
|
||||||
|
iv_branch_sha1 = io_repository->get_sha1_remote( ).
|
||||||
|
|
||||||
|
ls_stage_objects = lcl_stage_logic=>get( io_repository ).
|
||||||
|
|
||||||
|
lt_object_statuses = io_repository->status( ).
|
||||||
|
|
||||||
|
stage_transport_objects(
|
||||||
|
it_transport_objects = it_transport_objects
|
||||||
|
io_stage = lo_stage
|
||||||
|
is_stage_objects = ls_stage_objects
|
||||||
|
it_object_statuses = lt_object_statuses ).
|
||||||
|
|
||||||
|
ls_comment = generate_commit_message( is_transport_to_branch ).
|
||||||
|
|
||||||
|
io_repository->push( is_comment = ls_comment
|
||||||
|
io_stage = lo_stage ).
|
||||||
|
ENDMETHOD.
|
||||||
|
|
||||||
|
METHOD create_new_branch.
|
||||||
|
ASSERT iv_branch_name CP 'refs/heads/+*'.
|
||||||
|
TRY.
|
||||||
|
lcl_git_porcelain=>create_branch(
|
||||||
|
io_repo = io_repository
|
||||||
|
iv_name = iv_branch_name
|
||||||
|
iv_from = io_repository->get_sha1_local( ) ).
|
||||||
|
|
||||||
|
io_repository->set_branch_name( iv_branch_name ).
|
||||||
|
CATCH lcx_exception.
|
||||||
|
lcx_exception=>raise( 'Error when creating new branch').
|
||||||
|
ENDTRY.
|
||||||
|
ENDMETHOD.
|
||||||
|
|
||||||
|
METHOD generate_commit_message.
|
||||||
|
rs_comment-committer-name = sy-uname.
|
||||||
|
rs_comment-committer-email = |{ rs_comment-committer-name }@localhost|.
|
||||||
|
rs_comment-comment = is_transport_to_branch-commit_text.
|
||||||
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
|
METHOD stage_transport_objects.
|
||||||
|
|
||||||
|
DATA ls_transport_object TYPE tadir.
|
||||||
|
DATA ls_local_file TYPE ty_file_item.
|
||||||
|
DATA ls_object_status TYPE ty_result.
|
||||||
|
|
||||||
|
LOOP AT it_transport_objects INTO ls_transport_object.
|
||||||
|
READ TABLE it_object_statuses INTO ls_object_status
|
||||||
|
WITH KEY obj_name = ls_transport_object-obj_name
|
||||||
|
obj_type = ls_transport_object-object.
|
||||||
|
IF sy-subrc <> 0.
|
||||||
|
lcx_exception=>raise( |Object { ls_transport_object-obj_name } not found in the local repository files | ).
|
||||||
|
ENDIF.
|
||||||
|
|
||||||
|
CASE ls_object_status-lstate.
|
||||||
|
WHEN gc_state-added OR gc_state-modified.
|
||||||
|
ASSERT ls_transport_object-delflag = abap_false.
|
||||||
|
|
||||||
|
READ TABLE is_stage_objects-local
|
||||||
|
INTO ls_local_file
|
||||||
|
WITH KEY item-obj_name = ls_transport_object-obj_name
|
||||||
|
item-obj_type = ls_transport_object-object.
|
||||||
|
IF sy-subrc <> 0.
|
||||||
|
lcx_exception=>raise( |Object { ls_transport_object-obj_name } not found in the local repository files | ).
|
||||||
|
ENDIF.
|
||||||
|
|
||||||
|
io_stage->add(
|
||||||
|
iv_path = ls_local_file-file-path
|
||||||
|
iv_filename = ls_local_file-file-filename
|
||||||
|
iv_data = ls_local_file-file-data ).
|
||||||
|
WHEN gc_state-deleted.
|
||||||
|
ASSERT ls_transport_object-delflag = abap_true.
|
||||||
|
io_stage->rm(
|
||||||
|
iv_path = ls_object_status-path
|
||||||
|
iv_filename = ls_object_status-filename ).
|
||||||
|
WHEN OTHERS.
|
||||||
|
ASSERT 0 = 1. "Unexpected state
|
||||||
|
ENDCASE.
|
||||||
|
ENDLOOP.
|
||||||
|
ENDMETHOD.
|
||||||
ENDCLASS.
|
ENDCLASS.
|
||||||
|
|
|
@ -309,6 +309,8 @@ CLASS lcl_gui_view_repo_content IMPLEMENTATION.
|
||||||
iv_act = |{ gc_action-repo_remote_detach }?{ lv_key }| ).
|
iv_act = |{ gc_action-repo_remote_detach }?{ lv_key }| ).
|
||||||
lo_tb_advanced->add( iv_txt = 'Force stage'
|
lo_tb_advanced->add( iv_txt = 'Force stage'
|
||||||
iv_act = |{ gc_action-go_stage }?{ lv_key }| ).
|
iv_act = |{ gc_action-go_stage }?{ lv_key }| ).
|
||||||
|
lo_tb_advanced->add( iv_txt = 'Transport to Branch'
|
||||||
|
iv_act = |{ gc_action-repo_transport_to_branch }?{ lv_key }| ).
|
||||||
ELSE.
|
ELSE.
|
||||||
lo_tb_advanced->add( iv_txt = 'Make on-line'
|
lo_tb_advanced->add( iv_txt = 'Make on-line'
|
||||||
iv_act = |{ gc_action-repo_remote_attach }?{ lv_key }| ).
|
iv_act = |{ gc_action-repo_remote_attach }?{ lv_key }| ).
|
||||||
|
|
Loading…
Reference in New Issue
Block a user