clone without pull #832 (#1371)

* create online without pull #832

* update tutorial

* fix indentation
This commit is contained in:
Lars Hvam 2018-05-11 10:14:51 +02:00 committed by GitHub
parent 9080c0f1f7
commit e2b430779d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 41 additions and 43 deletions

View File

@ -64,7 +64,7 @@ CLASS ZCL_ABAPGIT_GUI_PAGE_MAIN IMPLEMENTATION.
lo_helpsub->add( iv_txt = 'Tutorial' iv_act = zif_abapgit_definitions=>gc_action-go_tutorial ) ##NO_TEXT.
lo_helpsub->add( iv_txt = 'abapGit wiki' iv_act = zif_abapgit_definitions=>gc_action-abapgit_wiki ) ##NO_TEXT.
ro_menu->add( iv_txt = '+ Clone' iv_act = zif_abapgit_definitions=>gc_action-repo_clone ) ##NO_TEXT.
ro_menu->add( iv_txt = '+ Online' iv_act = zif_abapgit_definitions=>gc_action-repo_newonline ) ##NO_TEXT.
ro_menu->add( iv_txt = '+ Offline' iv_act = zif_abapgit_definitions=>gc_action-repo_newoffline ) ##NO_TEXT.
ro_menu->add( iv_txt = 'Explore' iv_act = zif_abapgit_definitions=>gc_action-go_explore ) ##NO_TEXT.

View File

@ -272,8 +272,11 @@ CLASS ZCL_ABAPGIT_GUI_ROUTER IMPLEMENTATION.
WHEN zif_abapgit_definitions=>gc_action-repo_remove. " Repo remove
zcl_abapgit_services_repo=>remove( lv_key ).
ev_state = zif_abapgit_definitions=>gc_event_state-re_render.
WHEN zif_abapgit_definitions=>gc_action-repo_clone OR 'install'. " Repo clone, 'install' is for explore page
zcl_abapgit_services_repo=>clone( lv_url ).
WHEN zif_abapgit_definitions=>gc_action-repo_newonline.
zcl_abapgit_services_repo=>new_online( lv_url ).
ev_state = zif_abapgit_definitions=>gc_event_state-re_render.
WHEN 'install'. " 'install' is for explore page
zcl_abapgit_services_repo=>new_online( lv_url ).
ev_state = zif_abapgit_definitions=>gc_event_state-re_render.
WHEN zif_abapgit_definitions=>gc_action-repo_refresh_checksums. " Rebuil local checksums
zcl_abapgit_services_repo=>refresh_local_checksums( lv_key ).

View File

@ -26,7 +26,7 @@ CLASS ZCL_ABAPGIT_GUI_VIEW_TUTORIAL IMPLEMENTATION.
ro_html->add( '<p><ul>' ).
ro_html->add( `<li>To clone a remote repo (e.g. from github) click ` ).
ro_html->add_a( iv_txt = '+ Clone' iv_act = zif_abapgit_definitions=>gc_action-repo_clone ).
ro_html->add_a( iv_txt = '+ Online' iv_act = zif_abapgit_definitions=>gc_action-repo_newonline ).
ro_html->add( ' from the top menu. This will copy a remote repo to your system.</li>' ).
ro_html->add( `<li>To add a local package as a repo click ` ).

View File

@ -77,10 +77,6 @@ CLASS ZCL_ABAPGIT_SERVICES_ABAPGIT IMPLEMENTATION.
iv_branch_name = 'refs/heads/master'
iv_package = iv_package ) ##NO_TEXT.
lo_repo->initialize( ).
lo_repo->find_remote_dot_abapgit( ).
lo_repo->status( ). " check for errors
zcl_abapgit_services_repo=>gui_deserialize( lo_repo ).
zcl_abapgit_services_repo=>toggle_favorite( lo_repo->get_key( ) ).

View File

@ -5,9 +5,11 @@ CLASS zcl_abapgit_services_repo DEFINITION
PUBLIC SECTION.
CLASS-METHODS clone
CLASS-METHODS new_online
IMPORTING
!iv_url TYPE string
!iv_url TYPE string
RETURNING
VALUE(ro_repo) TYPE REF TO zcl_abapgit_repo_online
RAISING
zcx_abapgit_exception
zcx_abapgit_cancel .
@ -94,38 +96,7 @@ ENDCLASS.
CLASS zcl_abapgit_services_repo IMPLEMENTATION.
METHOD clone.
DATA: lo_repo TYPE REF TO zcl_abapgit_repo_online,
ls_popup TYPE zcl_abapgit_popups=>ty_popup.
ls_popup = zcl_abapgit_popups=>repo_popup( iv_url ).
IF ls_popup-cancel = abap_true.
RAISE EXCEPTION TYPE zcx_abapgit_cancel.
ENDIF.
lo_repo = zcl_abapgit_repo_srv=>get_instance( )->new_online(
iv_url = ls_popup-url
iv_branch_name = ls_popup-branch_name
iv_package = ls_popup-package ).
toggle_favorite( lo_repo->get_key( ) ).
lo_repo->initialize( ).
lo_repo->find_remote_dot_abapgit( ).
lo_repo->status( ). " check for errors
gui_deserialize( lo_repo ).
zcl_abapgit_persistence_user=>get_instance( )->set_repo_show( lo_repo->get_key( ) ). " Set default repo for user
COMMIT WORK.
ENDMETHOD. "clone
CLASS ZCL_ABAPGIT_SERVICES_REPO IMPLEMENTATION.
METHOD gui_deserialize.
@ -184,6 +155,31 @@ CLASS zcl_abapgit_services_repo IMPLEMENTATION.
ENDMETHOD. "new_offline
METHOD new_online.
DATA: ls_popup TYPE zcl_abapgit_popups=>ty_popup.
ls_popup = zcl_abapgit_popups=>repo_popup( iv_url ).
IF ls_popup-cancel = abap_true.
RAISE EXCEPTION TYPE zcx_abapgit_cancel.
ENDIF.
ro_repo = zcl_abapgit_repo_srv=>get_instance( )->new_online(
iv_url = ls_popup-url
iv_branch_name = ls_popup-branch_name
iv_package = ls_popup-package ).
toggle_favorite( ro_repo->get_key( ) ).
* Set default repo for user
zcl_abapgit_persistence_user=>get_instance( )->set_repo_show( ro_repo->get_key( ) ).
COMMIT WORK.
ENDMETHOD.
METHOD open_se80.
CALL FUNCTION 'RS_TOOL_ACCESS'

View File

@ -273,6 +273,9 @@ CLASS ZCL_ABAPGIT_REPO_SRV IMPLEMENTATION.
add( ro_repo ).
ro_repo->initialize( ).
ro_repo->find_remote_dot_abapgit( ).
ENDMETHOD. "new_online

View File

@ -347,11 +347,11 @@ INTERFACE zif_abapgit_definitions PUBLIC.
CONSTANTS gc_author_regex TYPE string VALUE '^([\\\w\s\.@\-_1-9\(\) ]+) <(.*)> (\d{10})\s?.\d{4}$' ##NO_TEXT.
CONSTANTS:
BEGIN OF gc_action,
repo_clone TYPE string VALUE 'repo_clone',
repo_refresh TYPE string VALUE 'repo_refresh',
repo_remove TYPE string VALUE 'repo_remove',
repo_settings TYPE string VALUE 'repo_settings',
repo_purge TYPE string VALUE 'repo_purge',
repo_newonline TYPE string VALUE 'repo_newonline',
repo_newoffline TYPE string VALUE 'repo_newoffline',
repo_remote_attach TYPE string VALUE 'repo_remote_attach',
repo_remote_detach TYPE string VALUE 'repo_remote_detach',