mirror of
https://github.com/abapGit/abapGit.git
synced 2025-05-01 12:20:51 +08:00
add tags to branch overview
This commit is contained in:
parent
7f1ade191b
commit
8861ac4d72
|
@ -602,6 +602,8 @@ CLASS lcl_git_pack IMPLEMENTATION.
|
|||
rv_type = zif_abapgit_definitions=>gc_type-tree.
|
||||
WHEN '011'.
|
||||
rv_type = zif_abapgit_definitions=>gc_type-blob.
|
||||
WHEN '100'.
|
||||
rv_type = zif_abapgit_definitions=>gc_type-tag.
|
||||
WHEN '111'.
|
||||
rv_type = zif_abapgit_definitions=>gc_type-ref_d.
|
||||
WHEN OTHERS.
|
||||
|
|
|
@ -20,6 +20,7 @@ CLASS lcl_branch_overview DEFINITION FINAL.
|
|||
message TYPE string,
|
||||
branch TYPE string,
|
||||
merge TYPE string,
|
||||
tags TYPE stringtab,
|
||||
create TYPE STANDARD TABLE OF ty_create WITH DEFAULT KEY,
|
||||
compressed TYPE abap_bool,
|
||||
END OF ty_commit.
|
||||
|
@ -54,11 +55,14 @@ CLASS lcl_branch_overview DEFINITION FINAL.
|
|||
get_git_objects
|
||||
IMPORTING io_repo TYPE REF TO lcl_repo_online
|
||||
RETURNING VALUE(rt_objects) TYPE zif_abapgit_definitions=>ty_objects_tt
|
||||
RAISING zcx_abapgit_exception,
|
||||
determine_tags
|
||||
RAISING zcx_abapgit_exception.
|
||||
|
||||
CLASS-DATA:
|
||||
gt_branches TYPE lcl_git_branch_list=>ty_git_branch_list_tt,
|
||||
gt_commits TYPE TABLE OF ty_commit.
|
||||
gt_commits TYPE TABLE OF ty_commit,
|
||||
gt_tags TYPE lcl_git_branch_list=>ty_git_branch_list_tt.
|
||||
|
||||
ENDCLASS.
|
||||
|
||||
|
@ -143,6 +147,7 @@ CLASS lcl_branch_overview IMPLEMENTATION.
|
|||
|
||||
determine_branch( ).
|
||||
determine_merges( ).
|
||||
determine_tags( ).
|
||||
fixes( ).
|
||||
|
||||
SORT gt_commits BY time ASCENDING.
|
||||
|
@ -153,6 +158,8 @@ CLASS lcl_branch_overview IMPLEMENTATION.
|
|||
|
||||
METHOD get_git_objects.
|
||||
|
||||
DATA: lo_branch_list TYPE REF TO lcl_git_branch_list.
|
||||
|
||||
lcl_progress=>show( iv_key = 'Get git objects'
|
||||
iv_current = 1
|
||||
iv_total = 1
|
||||
|
@ -162,7 +169,11 @@ CLASS lcl_branch_overview IMPLEMENTATION.
|
|||
* the selected branch
|
||||
|
||||
"TODO refactor
|
||||
gt_branches = lcl_git_transport=>branches( io_repo->get_url( ) )->get_branches_only( ).
|
||||
|
||||
lo_branch_list = lcl_git_transport=>branches( io_repo->get_url( ) ).
|
||||
|
||||
gt_branches = lo_branch_list->get_branches_only( ).
|
||||
gt_tags = lo_branch_list->get_tags_only( ).
|
||||
|
||||
lcl_git_transport=>upload_pack( EXPORTING io_repo = io_repo
|
||||
iv_deepen = abap_false
|
||||
|
@ -298,6 +309,26 @@ CLASS lcl_branch_overview IMPLEMENTATION.
|
|||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD determine_tags.
|
||||
|
||||
FIELD-SYMBOLS: <ls_tag> TYPE lcl_git_branch_list=>ty_git_branch,
|
||||
<ls_commit> TYPE lcl_branch_overview=>ty_commit.
|
||||
|
||||
LOOP AT gt_tags ASSIGNING <ls_tag>.
|
||||
|
||||
READ TABLE gt_commits WITH KEY sha1 = <ls_tag>-sha1
|
||||
ASSIGNING <ls_commit>.
|
||||
CHECK sy-subrc = 0.
|
||||
|
||||
INSERT replace( val = <ls_tag>-name
|
||||
sub = zif_abapgit_definitions=>gc_tag_prefix
|
||||
with = `` ) INTO TABLE <ls_commit>-tags.
|
||||
|
||||
ENDLOOP.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
ENDCLASS.
|
||||
|
||||
***********************
|
||||
|
@ -473,7 +504,8 @@ CLASS lcl_gui_page_boverview IMPLEMENTATION.
|
|||
ro_html->add( |{ escape_branch( <ls_commit>-branch ) }.commit(\{message: "{
|
||||
escape_message( <ls_commit>-message ) }", author: "{
|
||||
<ls_commit>-author }", sha1: "{
|
||||
<ls_commit>-sha1(7) }"\});| ).
|
||||
<ls_commit>-sha1(7) }", tag: "{ concat_lines_of( table = <ls_commit>-tags
|
||||
sep = ` | ` ) }"\});| ).
|
||||
ELSE.
|
||||
ro_html->add( |{ escape_branch( <ls_commit>-merge ) }.merge({
|
||||
escape_branch( <ls_commit>-branch ) }, \{message: "{
|
||||
|
|
|
@ -155,6 +155,7 @@ INTERFACE zif_abapgit_definitions
|
|||
commit TYPE zif_abapgit_definitions=>ty_type VALUE 'commit', "#EC NOTEXT
|
||||
tree TYPE zif_abapgit_definitions=>ty_type VALUE 'tree', "#EC NOTEXT
|
||||
ref_d TYPE zif_abapgit_definitions=>ty_type VALUE 'ref_d', "#EC NOTEXT
|
||||
tag TYPE zif_abapgit_definitions=>ty_type VALUE 'tag', "#EC NOTEXT
|
||||
blob TYPE zif_abapgit_definitions=>ty_type VALUE 'blob', "#EC NOTEXT
|
||||
END OF gc_type .
|
||||
CONSTANTS:
|
||||
|
|
Loading…
Reference in New Issue
Block a user