Improved branching messages (#3685)

* Improvements to branch messages

* Names without refs/heads
This commit is contained in:
Frederik Hudák 2020-07-31 06:15:56 +02:00 committed by GitHub
parent 6c04eac591
commit a1ecc65ecc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 8 deletions

View File

@ -100,7 +100,7 @@ ENDCLASS.
CLASS ZCL_ABAPGIT_POPUPS IMPLEMENTATION.
CLASS zcl_abapgit_popups IMPLEMENTATION.
METHOD add_field.
@ -504,6 +504,8 @@ CLASS ZCL_ABAPGIT_POPUPS IMPLEMENTATION.
ENDIF.
ASSERT <ls_branch> IS ASSIGNED.
rs_branch = lo_branches->find_by_name( <ls_branch>-name ).
MESSAGE |Branch switched from { zcl_abapgit_git_branch_list=>get_display_name( iv_default_branch ) } to {
zcl_abapgit_git_branch_list=>get_display_name( rs_branch-name ) } | TYPE 'S'.
ENDIF.
ENDMETHOD.
@ -587,9 +589,11 @@ CLASS ZCL_ABAPGIT_POPUPS IMPLEMENTATION.
TRY.
_popup_3_get_values( EXPORTING iv_popup_title = 'Create branch' "#EC NOTEXT
IMPORTING ev_value_1 = lv_name
CHANGING ct_fields = lt_fields ).
_popup_3_get_values(
EXPORTING iv_popup_title = |Create branch from {
zcl_abapgit_git_branch_list=>get_display_name( iv_source_branch_name ) }|
IMPORTING ev_value_1 = lv_name
CHANGING ct_fields = lt_fields ).
ev_name = zcl_abapgit_git_branch_list=>complete_heads_branch_name(
zcl_abapgit_git_branch_list=>normalize_branch_name( lv_name ) ).

View File

@ -186,24 +186,30 @@ CLASS zcl_abapgit_services_git IMPLEMENTATION.
lv_cancel TYPE abap_bool,
lo_repo TYPE REF TO zcl_abapgit_repo_online,
lv_msg TYPE string,
li_popups TYPE REF TO zif_abapgit_popups.
li_popups TYPE REF TO zif_abapgit_popups,
lv_source_branch_name TYPE string.
lo_repo ?= zcl_abapgit_repo_srv=>get_instance( )->get( iv_key ).
lv_source_branch_name = lo_repo->get_branch_name( ).
li_popups = zcl_abapgit_ui_factory=>get_popups( ).
li_popups->create_branch_popup(
EXPORTING
iv_source_branch_name = lv_source_branch_name
IMPORTING
ev_name = lv_name
ev_cancel = lv_cancel ).
IF lv_cancel = abap_true.
RAISE EXCEPTION TYPE zcx_abapgit_cancel.
ENDIF.
lo_repo->create_branch( lv_name ).
lv_msg = |Switched to new branch { zcl_abapgit_git_branch_list=>get_display_name( lv_name ) }|.
MESSAGE lv_msg TYPE 'S' ##NO_TEXT.
lv_msg = |Branch switched from { zcl_abapgit_git_branch_list=>get_display_name( lv_source_branch_name )
} to new branch { zcl_abapgit_git_branch_list=>get_display_name( lv_name ) }|.
MESSAGE lv_msg TYPE 'S'.
ENDMETHOD.

View File

@ -41,6 +41,8 @@ INTERFACE zif_abapgit_popups
RAISING
zcx_abapgit_exception .
METHODS create_branch_popup
IMPORTING
iv_source_branch_name TYPE string
EXPORTING
!ev_name TYPE string
!ev_cancel TYPE abap_bool
@ -161,4 +163,4 @@ INTERFACE zif_abapgit_popups
VALUE(rt_proxy_bypass) TYPE zif_abapgit_definitions=>ty_range_proxy_bypass_url
RAISING
zcx_abapgit_exception.
ENDINTERFACE.
ENDINTERFACE.