mirror of
https://github.com/abapGit/abapGit.git
synced 2025-05-01 12:20:51 +08:00
Merge pull request #1169 from christianguenter2/feature-checkout-tag
Checkout tags
This commit is contained in:
commit
c739ed9d6e
|
@ -247,6 +247,9 @@ CLASS lcl_gui_router IMPLEMENTATION.
|
||||||
lcl_services_git=>delete_tag( lv_key ).
|
lcl_services_git=>delete_tag( lv_key ).
|
||||||
lcl_services_repo=>refresh( lv_key ).
|
lcl_services_repo=>refresh( lv_key ).
|
||||||
ev_state = zif_abapgit_definitions=>gc_event_state-re_render.
|
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
|
"Others
|
||||||
WHEN OTHERS.
|
WHEN OTHERS.
|
||||||
|
|
|
@ -670,7 +670,6 @@ CLASS lcl_popups IMPLEMENTATION.
|
||||||
LOOP AT lt_tags ASSIGNING <ls_tag>.
|
LOOP AT lt_tags ASSIGNING <ls_tag>.
|
||||||
|
|
||||||
<ls_tag>-name = zcl_abapgit_tag=>remove_tag_prefix( <ls_tag>-name ).
|
<ls_tag>-name = zcl_abapgit_tag=>remove_tag_prefix( <ls_tag>-name ).
|
||||||
<ls_tag>-sha1 = <ls_tag>-sha1(7).
|
|
||||||
|
|
||||||
ENDLOOP.
|
ENDLOOP.
|
||||||
|
|
||||||
|
@ -687,7 +686,7 @@ CLASS lcl_popups IMPLEMENTATION.
|
||||||
lo_columns->get_column( `IS_HEAD` )->set_technical( ).
|
lo_columns->get_column( `IS_HEAD` )->set_technical( ).
|
||||||
lo_columns->get_column( `DISPLAY_NAME` )->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( `SHA1` )->set_medium_text( 'SHA' ).
|
||||||
|
|
||||||
lo_columns->get_column( `NAME` )->set_medium_text( 'Tag name' ).
|
lo_columns->get_column( `NAME` )->set_medium_text( 'Tag name' ).
|
||||||
|
@ -695,9 +694,9 @@ CLASS lcl_popups IMPLEMENTATION.
|
||||||
lo_columns->set_optimize( ).
|
lo_columns->set_optimize( ).
|
||||||
|
|
||||||
lo_alv->set_screen_popup( start_column = 5
|
lo_alv->set_screen_popup( start_column = 5
|
||||||
end_column = 50
|
end_column = 70
|
||||||
start_line = 5
|
start_line = 5
|
||||||
end_line = 20 ).
|
end_line = 25 ).
|
||||||
|
|
||||||
CREATE OBJECT lo_table_header
|
CREATE OBJECT lo_table_header
|
||||||
EXPORTING
|
EXPORTING
|
||||||
|
|
|
@ -195,8 +195,14 @@ CLASS lcl_repo_online IMPLEMENTATION.
|
||||||
METHOD push.
|
METHOD push.
|
||||||
|
|
||||||
DATA: lv_branch TYPE zif_abapgit_definitions=>ty_sha1,
|
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 ).
|
handle_stage_ignore( io_stage ).
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,10 @@ CLASS lcl_services_git DEFINITION FINAL.
|
||||||
IMPORTING iv_key TYPE zcl_abapgit_persistence_repo=>ty_repo-key
|
IMPORTING iv_key TYPE zcl_abapgit_persistence_repo=>ty_repo-key
|
||||||
RAISING zcx_abapgit_exception zcx_abapgit_cancel.
|
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
|
CLASS-METHODS tag_overview
|
||||||
IMPORTING iv_key TYPE zcl_abapgit_persistence_repo=>ty_repo-key
|
IMPORTING iv_key TYPE zcl_abapgit_persistence_repo=>ty_repo-key
|
||||||
RAISING zcx_abapgit_exception zcx_abapgit_cancel.
|
RAISING zcx_abapgit_exception zcx_abapgit_cancel.
|
||||||
|
@ -288,6 +292,27 @@ CLASS lcl_services_git IMPLEMENTATION.
|
||||||
|
|
||||||
ENDMETHOD.
|
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.
|
METHOD tag_overview.
|
||||||
|
|
||||||
DATA: lo_repo TYPE REF TO lcl_repo_online.
|
DATA: lo_repo TYPE REF TO lcl_repo_online.
|
||||||
|
|
|
@ -300,6 +300,9 @@ CLASS lcl_gui_view_repo IMPLEMENTATION.
|
||||||
|
|
||||||
lo_tb_tag->add( iv_txt = 'Overview'
|
lo_tb_tag->add( iv_txt = 'Overview'
|
||||||
iv_act = |{ zif_abapgit_definitions=>gc_action-go_tag_overview }?{ lv_key }| ).
|
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'
|
lo_tb_tag->add( iv_txt = 'Create'
|
||||||
iv_act = |{ zif_abapgit_definitions=>gc_action-git_tag_create }?{ lv_key }| ).
|
iv_act = |{ zif_abapgit_definitions=>gc_action-git_tag_create }?{ lv_key }| ).
|
||||||
lo_tb_tag->add( iv_txt = 'Delete'
|
lo_tb_tag->add( iv_txt = 'Delete'
|
||||||
|
|
|
@ -237,6 +237,7 @@ INTERFACE zif_abapgit_definitions PUBLIC.
|
||||||
git_branch_delete TYPE string VALUE 'git_branch_delete',
|
git_branch_delete TYPE string VALUE 'git_branch_delete',
|
||||||
git_tag_create TYPE string VALUE 'git_tag_create',
|
git_tag_create TYPE string VALUE 'git_tag_create',
|
||||||
git_tag_delete TYPE string VALUE 'git_tag_delete',
|
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',
|
git_commit TYPE string VALUE 'git_commit',
|
||||||
|
|
||||||
db_delete TYPE string VALUE 'db_delete',
|
db_delete TYPE string VALUE 'db_delete',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user