diff --git a/src/zabapgit_gui_router.prog.abap b/src/zabapgit_gui_router.prog.abap index 1ca98f889..ab2345a0c 100644 --- a/src/zabapgit_gui_router.prog.abap +++ b/src/zabapgit_gui_router.prog.abap @@ -247,6 +247,9 @@ CLASS lcl_gui_router IMPLEMENTATION. lcl_services_git=>delete_tag( lv_key ). lcl_services_repo=>refresh( lv_key ). ev_state = zif_abapgit_definitions=>gc_event_state-re_render. + WHEN zif_abapgit_definitions=>gc_action-git_tag_switch. " GIT Switch Tag + lcl_services_git=>switch_tag( lv_key ). + ev_state = zif_abapgit_definitions=>gc_event_state-re_render. "Others WHEN OTHERS. diff --git a/src/zabapgit_popups.prog.abap b/src/zabapgit_popups.prog.abap index f1ff13b0e..3dff516a1 100644 --- a/src/zabapgit_popups.prog.abap +++ b/src/zabapgit_popups.prog.abap @@ -670,7 +670,6 @@ CLASS lcl_popups IMPLEMENTATION. LOOP AT lt_tags ASSIGNING . -name = zcl_abapgit_tag=>remove_tag_prefix( -name ). - -sha1 = -sha1(7). ENDLOOP. @@ -687,7 +686,7 @@ CLASS lcl_popups IMPLEMENTATION. lo_columns->get_column( `IS_HEAD` )->set_technical( ). lo_columns->get_column( `DISPLAY_NAME` )->set_technical( ). - lo_columns->get_column( `SHA1` )->set_output_length( 10 ). + lo_columns->get_column( `SHA1` )->set_output_length( 30 ). lo_columns->get_column( `SHA1` )->set_medium_text( 'SHA' ). lo_columns->get_column( `NAME` )->set_medium_text( 'Tag name' ). @@ -695,9 +694,9 @@ CLASS lcl_popups IMPLEMENTATION. lo_columns->set_optimize( ). lo_alv->set_screen_popup( start_column = 5 - end_column = 50 + end_column = 70 start_line = 5 - end_line = 20 ). + end_line = 25 ). CREATE OBJECT lo_table_header EXPORTING diff --git a/src/zabapgit_repo_impl.prog.abap b/src/zabapgit_repo_impl.prog.abap index 964aed3ce..0f208f423 100644 --- a/src/zabapgit_repo_impl.prog.abap +++ b/src/zabapgit_repo_impl.prog.abap @@ -195,8 +195,14 @@ CLASS lcl_repo_online IMPLEMENTATION. METHOD push. DATA: lv_branch TYPE zif_abapgit_definitions=>ty_sha1, - lt_updated_files TYPE zif_abapgit_definitions=>ty_file_signatures_tt. + lt_updated_files TYPE zif_abapgit_definitions=>ty_file_signatures_tt, + lv_text TYPE string. + IF ms_data-branch_name CP 'refs/tags*'. + lv_text = |You're working on a tag. Currently it's not | + && |possible to push on tags. Consider creating a branch instead|. + zcx_abapgit_exception=>raise( lv_text ). + ENDIF. handle_stage_ignore( io_stage ). diff --git a/src/zabapgit_services_git.prog.abap b/src/zabapgit_services_git.prog.abap index 304e122fb..625997ec7 100644 --- a/src/zabapgit_services_git.prog.abap +++ b/src/zabapgit_services_git.prog.abap @@ -43,6 +43,10 @@ CLASS lcl_services_git DEFINITION FINAL. IMPORTING iv_key TYPE zcl_abapgit_persistence_repo=>ty_repo-key RAISING zcx_abapgit_exception zcx_abapgit_cancel. + CLASS-METHODS switch_tag + IMPORTING iv_key TYPE zcl_abapgit_persistence_repo=>ty_repo-key + RAISING zcx_abapgit_exception zcx_abapgit_cancel. + CLASS-METHODS tag_overview IMPORTING iv_key TYPE zcl_abapgit_persistence_repo=>ty_repo-key RAISING zcx_abapgit_exception zcx_abapgit_cancel. @@ -288,6 +292,27 @@ CLASS lcl_services_git IMPLEMENTATION. ENDMETHOD. + METHOD switch_tag. + + DATA: lo_repo TYPE REF TO lcl_repo_online, + ls_tag TYPE zcl_abapgit_git_branch_list=>ty_git_branch, + lv_text TYPE string. + + lo_repo ?= lcl_app=>repo_srv( )->get( iv_key ). + + ls_tag = lcl_popups=>tag_list_popup( lo_repo->get_url( ) ). + IF ls_tag IS INITIAL. + RAISE EXCEPTION TYPE zcx_abapgit_cancel. + ENDIF. + + lo_repo->set_branch_name( ls_tag-name ). + + COMMIT WORK. + + lo_repo->deserialize( ). + + ENDMETHOD. + METHOD tag_overview. DATA: lo_repo TYPE REF TO lcl_repo_online. diff --git a/src/zabapgit_view_repo.prog.abap b/src/zabapgit_view_repo.prog.abap index e389cb841..fd4abf9c2 100644 --- a/src/zabapgit_view_repo.prog.abap +++ b/src/zabapgit_view_repo.prog.abap @@ -300,6 +300,9 @@ CLASS lcl_gui_view_repo IMPLEMENTATION. lo_tb_tag->add( iv_txt = 'Overview' iv_act = |{ zif_abapgit_definitions=>gc_action-go_tag_overview }?{ lv_key }| ). + lo_tb_tag->add( iv_txt = 'Switch' + iv_act = |{ zif_abapgit_definitions=>gc_action-git_tag_switch }?{ lv_key }| + iv_opt = lv_wp_opt ). lo_tb_tag->add( iv_txt = 'Create' iv_act = |{ zif_abapgit_definitions=>gc_action-git_tag_create }?{ lv_key }| ). lo_tb_tag->add( iv_txt = 'Delete' diff --git a/src/zif_abapgit_definitions.intf.abap b/src/zif_abapgit_definitions.intf.abap index 14eb0229f..85de4267e 100644 --- a/src/zif_abapgit_definitions.intf.abap +++ b/src/zif_abapgit_definitions.intf.abap @@ -237,6 +237,7 @@ INTERFACE zif_abapgit_definitions PUBLIC. git_branch_delete TYPE string VALUE 'git_branch_delete', git_tag_create TYPE string VALUE 'git_tag_create', git_tag_delete TYPE string VALUE 'git_tag_delete', + git_tag_switch TYPE string VALUE 'git_tag_switch', git_commit TYPE string VALUE 'git_commit', db_delete TYPE string VALUE 'db_delete',