mirror of
https://github.com/abapGit/abapGit.git
synced 2025-05-02 04:36:49 +08:00
Repo View: Consolidate "Pull" and "Selective Pull" (#5951)
This commit is contained in:
parent
d0167ff97d
commit
f87073e606
|
@ -412,7 +412,7 @@ CLASS zcl_abapgit_gui_page_repo_over IMPLEMENTATION.
|
||||||
|
|
||||||
lo_toolbar->add(
|
lo_toolbar->add(
|
||||||
iv_txt = |Pull|
|
iv_txt = |Pull|
|
||||||
iv_act = |{ zif_abapgit_definitions=>c_action-git_reset }{ lc_dummy_key }|
|
iv_act = |{ zif_abapgit_definitions=>c_action-git_pull }{ lc_dummy_key }|
|
||||||
iv_class = |{ lc_action_class } { lc_online_class }|
|
iv_class = |{ lc_action_class } { lc_online_class }|
|
||||||
iv_li_class = |{ lc_action_class }| ).
|
iv_li_class = |{ lc_action_class }| ).
|
||||||
|
|
||||||
|
@ -903,7 +903,7 @@ CLASS zcl_abapgit_gui_page_repo_over IMPLEMENTATION.
|
||||||
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.
|
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.
|
||||||
|
|
||||||
ls_hotkey_action-description = |Pull|.
|
ls_hotkey_action-description = |Pull|.
|
||||||
ls_hotkey_action-action = zif_abapgit_definitions=>c_action-git_reset.
|
ls_hotkey_action-action = zif_abapgit_definitions=>c_action-git_pull.
|
||||||
ls_hotkey_action-hotkey = |p|.
|
ls_hotkey_action-hotkey = |p|.
|
||||||
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.
|
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.
|
||||||
|
|
||||||
|
|
|
@ -271,12 +271,6 @@ CLASS zcl_abapgit_gui_page_repo_view IMPLEMENTATION.
|
||||||
|
|
||||||
CREATE OBJECT ro_advanced_dropdown.
|
CREATE OBJECT ro_advanced_dropdown.
|
||||||
|
|
||||||
IF mo_repo_aggregated_state->is_unchanged( ) = abap_false. " In case of asyncronicities
|
|
||||||
ro_advanced_dropdown->add( iv_txt = 'Selective Pull'
|
|
||||||
iv_act = |{ zif_abapgit_definitions=>c_action-git_reset }?key={ mv_key }|
|
|
||||||
iv_opt = get_crossout( iv_protected = abap_true ) ).
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
IF mo_repo->is_offline( ) = abap_false. " Online ?
|
IF mo_repo->is_offline( ) = abap_false. " Online ?
|
||||||
ro_advanced_dropdown->add(
|
ro_advanced_dropdown->add(
|
||||||
iv_txt = 'Transport to Branch'
|
iv_txt = 'Transport to Branch'
|
||||||
|
@ -430,14 +424,11 @@ CLASS zcl_abapgit_gui_page_repo_view IMPLEMENTATION.
|
||||||
IF mo_repo->is_offline( ) = abap_false.
|
IF mo_repo->is_offline( ) = abap_false.
|
||||||
" online repo
|
" online repo
|
||||||
|
|
||||||
IF mo_repo_aggregated_state->remote( ) IS NOT INITIAL
|
IF mo_repo_aggregated_state->is_unchanged( ) = abap_false. " Any changes
|
||||||
OR mo_repo_aggregated_state->is_reassigned( ) = abap_true. " Something new at remote
|
|
||||||
ro_toolbar->add( iv_txt = 'Pull'
|
ro_toolbar->add( iv_txt = 'Pull'
|
||||||
iv_act = |{ zif_abapgit_definitions=>c_action-git_pull }?key={ mv_key }|
|
iv_act = |{ zif_abapgit_definitions=>c_action-git_pull }?key={ mv_key }|
|
||||||
iv_opt = get_crossout( iv_protected = abap_true
|
iv_opt = get_crossout( iv_protected = abap_true
|
||||||
iv_strong = abap_true ) ).
|
iv_strong = abap_true ) ).
|
||||||
ENDIF.
|
|
||||||
IF mo_repo_aggregated_state->is_unchanged( ) = abap_false. " Any changes
|
|
||||||
ro_toolbar->add( iv_txt = 'Stage'
|
ro_toolbar->add( iv_txt = 'Stage'
|
||||||
iv_act = |{ zif_abapgit_definitions=>c_action-go_stage }?key={ mv_key }|
|
iv_act = |{ zif_abapgit_definitions=>c_action-go_stage }?key={ mv_key }|
|
||||||
iv_opt = zif_abapgit_html=>c_html_opt-strong ).
|
iv_opt = zif_abapgit_html=>c_html_opt-strong ).
|
||||||
|
|
|
@ -456,9 +456,6 @@ CLASS zcl_abapgit_gui_router IMPLEMENTATION.
|
||||||
WHEN zif_abapgit_definitions=>c_action-git_pull. " GIT Pull
|
WHEN zif_abapgit_definitions=>c_action-git_pull. " GIT Pull
|
||||||
zcl_abapgit_services_git=>pull( lv_key ).
|
zcl_abapgit_services_git=>pull( lv_key ).
|
||||||
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
|
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
|
||||||
WHEN zif_abapgit_definitions=>c_action-git_reset. " GIT Reset
|
|
||||||
zcl_abapgit_services_git=>reset( lv_key ).
|
|
||||||
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
|
|
||||||
WHEN zif_abapgit_definitions=>c_action-git_branch_create. " GIT Create new branch
|
WHEN zif_abapgit_definitions=>c_action-git_branch_create. " GIT Create new branch
|
||||||
zcl_abapgit_services_git=>create_branch( lv_key ).
|
zcl_abapgit_services_git=>create_branch( lv_key ).
|
||||||
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
|
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
|
||||||
|
|
|
@ -9,11 +9,6 @@ CLASS zcl_abapgit_services_git DEFINITION
|
||||||
!iv_key TYPE zif_abapgit_persistence=>ty_repo-key
|
!iv_key TYPE zif_abapgit_persistence=>ty_repo-key
|
||||||
RAISING
|
RAISING
|
||||||
zcx_abapgit_exception.
|
zcx_abapgit_exception.
|
||||||
CLASS-METHODS reset
|
|
||||||
IMPORTING
|
|
||||||
!iv_key TYPE zif_abapgit_persistence=>ty_repo-key
|
|
||||||
RAISING
|
|
||||||
zcx_abapgit_exception.
|
|
||||||
CLASS-METHODS create_branch
|
CLASS-METHODS create_branch
|
||||||
IMPORTING
|
IMPORTING
|
||||||
!iv_key TYPE zif_abapgit_persistence=>ty_repo-key
|
!iv_key TYPE zif_abapgit_persistence=>ty_repo-key
|
||||||
|
@ -196,23 +191,6 @@ CLASS zcl_abapgit_services_git IMPLEMENTATION.
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
||||||
METHOD reset.
|
|
||||||
|
|
||||||
DATA lo_repo TYPE REF TO zcl_abapgit_repo.
|
|
||||||
|
|
||||||
lo_repo ?= zcl_abapgit_repo_srv=>get_instance( )->get( iv_key ).
|
|
||||||
|
|
||||||
IF lo_repo->get_local_settings( )-write_protected = abap_true.
|
|
||||||
zcx_abapgit_exception=>raise( 'Cannot pull. Local code is write-protected in repo settings' ).
|
|
||||||
ENDIF.
|
|
||||||
|
|
||||||
zcl_abapgit_services_repo=>gui_deserialize(
|
|
||||||
io_repo = lo_repo
|
|
||||||
iv_reset_all = abap_true ).
|
|
||||||
|
|
||||||
ENDMETHOD.
|
|
||||||
|
|
||||||
|
|
||||||
METHOD switch_branch.
|
METHOD switch_branch.
|
||||||
|
|
||||||
DATA: lo_repo TYPE REF TO zcl_abapgit_repo_online,
|
DATA: lo_repo TYPE REF TO zcl_abapgit_repo_online,
|
||||||
|
|
|
@ -54,7 +54,6 @@ CLASS zcl_abapgit_services_repo DEFINITION
|
||||||
CLASS-METHODS gui_deserialize
|
CLASS-METHODS gui_deserialize
|
||||||
IMPORTING
|
IMPORTING
|
||||||
!io_repo TYPE REF TO zcl_abapgit_repo
|
!io_repo TYPE REF TO zcl_abapgit_repo
|
||||||
!iv_reset_all TYPE abap_bool DEFAULT abap_false
|
|
||||||
RAISING
|
RAISING
|
||||||
zcx_abapgit_exception .
|
zcx_abapgit_exception .
|
||||||
PROTECTED SECTION.
|
PROTECTED SECTION.
|
||||||
|
@ -70,7 +69,6 @@ CLASS zcl_abapgit_services_repo DEFINITION
|
||||||
CLASS-METHODS popup_decisions
|
CLASS-METHODS popup_decisions
|
||||||
IMPORTING
|
IMPORTING
|
||||||
!io_repo TYPE REF TO zcl_abapgit_repo
|
!io_repo TYPE REF TO zcl_abapgit_repo
|
||||||
!iv_reset_all TYPE abap_bool
|
|
||||||
CHANGING
|
CHANGING
|
||||||
!cs_checks TYPE zif_abapgit_definitions=>ty_deserialize_checks
|
!cs_checks TYPE zif_abapgit_definitions=>ty_deserialize_checks
|
||||||
RAISING
|
RAISING
|
||||||
|
@ -182,7 +180,6 @@ CLASS zcl_abapgit_services_repo IMPLEMENTATION.
|
||||||
popup_decisions(
|
popup_decisions(
|
||||||
EXPORTING
|
EXPORTING
|
||||||
io_repo = io_repo
|
io_repo = io_repo
|
||||||
iv_reset_all = iv_reset_all
|
|
||||||
CHANGING
|
CHANGING
|
||||||
cs_checks = ls_checks ).
|
cs_checks = ls_checks ).
|
||||||
|
|
||||||
|
@ -279,11 +276,13 @@ CLASS zcl_abapgit_services_repo IMPLEMENTATION.
|
||||||
|
|
||||||
lt_decision = cs_checks-overwrite.
|
lt_decision = cs_checks-overwrite.
|
||||||
|
|
||||||
" For regular pull, some objects are automatically handled (see below)
|
" Only if all objects are new/added (like an initial pull),
|
||||||
IF iv_reset_all IS INITIAL.
|
" the objects are handled automatically (see below)
|
||||||
DELETE lt_decision
|
LOOP AT lt_decision TRANSPORTING NO FIELDS WHERE action <> zif_abapgit_objects=>c_deserialize_action-add.
|
||||||
WHERE action = zif_abapgit_objects=>c_deserialize_action-add
|
EXIT.
|
||||||
OR action = zif_abapgit_objects=>c_deserialize_action-update.
|
ENDLOOP.
|
||||||
|
IF sy-subrc <> 0.
|
||||||
|
CLEAR lt_decision.
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
|
||||||
" Ask user what to do
|
" Ask user what to do
|
||||||
|
@ -315,7 +314,7 @@ CLASS zcl_abapgit_services_repo IMPLEMENTATION.
|
||||||
IF sy-subrc = 0.
|
IF sy-subrc = 0.
|
||||||
<ls_overwrite>-decision = <ls_decision>-decision.
|
<ls_overwrite>-decision = <ls_decision>-decision.
|
||||||
ELSE.
|
ELSE.
|
||||||
" If user was not asked (regular pull), deny deletions and confirm other changes (add and update)
|
" If user was not asked, deny deletions and confirm other changes (add and update)
|
||||||
CASE <ls_overwrite>-action.
|
CASE <ls_overwrite>-action.
|
||||||
WHEN zif_abapgit_objects=>c_deserialize_action-delete
|
WHEN zif_abapgit_objects=>c_deserialize_action-delete
|
||||||
OR zif_abapgit_objects=>c_deserialize_action-delete_add.
|
OR zif_abapgit_objects=>c_deserialize_action-delete_add.
|
||||||
|
|
|
@ -468,7 +468,6 @@ INTERFACE zif_abapgit_definitions
|
||||||
performance_test TYPE string VALUE 'performance_test',
|
performance_test TYPE string VALUE 'performance_test',
|
||||||
ie_devtools TYPE string VALUE 'ie_devtools',
|
ie_devtools TYPE string VALUE 'ie_devtools',
|
||||||
git_pull TYPE string VALUE 'git_pull',
|
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_create TYPE string VALUE 'git_branch_create',
|
||||||
git_branch_switch TYPE string VALUE 'git_branch_switch',
|
git_branch_switch TYPE string VALUE 'git_branch_switch',
|
||||||
git_branch_delete TYPE string VALUE 'git_branch_delete',
|
git_branch_delete TYPE string VALUE 'git_branch_delete',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user