Merge pull request #579 from larshp/ignore_subpackages

ignore subpackages
This commit is contained in:
Lars Hvam 2017-01-26 07:41:55 +01:00 committed by GitHub
commit 39b285cb9d
4 changed files with 44 additions and 28 deletions

View File

@ -107,6 +107,7 @@ CLASS lcl_persistence_repo DEFINITION FINAL.
master_language TYPE spras, master_language TYPE spras,
head_branch TYPE string, " HEAD symref of the repo, master branch head_branch TYPE string, " HEAD symref of the repo, master branch
write_protect TYPE sap_bool, " Deny destructive ops: pull, switch branch ... write_protect TYPE sap_bool, " Deny destructive ops: pull, switch branch ...
ignore_subpackages TYPE sap_bool,
END OF ty_repo_xml. END OF ty_repo_xml.
TYPES: BEGIN OF ty_repo, TYPES: BEGIN OF ty_repo,

View File

@ -34,6 +34,8 @@ CLASS lcl_repo DEFINITION ABSTRACT FRIENDS lcl_repo_srv.
RETURNING VALUE(rv_language) TYPE spras, RETURNING VALUE(rv_language) TYPE spras,
is_write_protected is_write_protected
RETURNING VALUE(rv_yes) TYPE sap_bool, RETURNING VALUE(rv_yes) TYPE sap_bool,
ignore_subpackages
RETURNING VALUE(rv_yes) TYPE sap_bool,
delete delete
RAISING lcx_exception, RAISING lcx_exception,
get_dot_abapgit get_dot_abapgit

View File

@ -535,7 +535,9 @@ CLASS lcl_repo IMPLEMENTATION.
iv_data = <ls_return>-file-data ). iv_data = <ls_return>-file-data ).
lt_cache = mt_local. lt_cache = mt_local.
lt_tadir = lcl_tadir=>read( get_package( ) ). lt_tadir = lcl_tadir=>read(
iv_package = get_package( )
iv_ignore_subpackages = ignore_subpackages( ) ).
lt_filter = it_filter. lt_filter = it_filter.
lv_filter_exist = boolc( lines( lt_filter ) > 0 ) . lv_filter_exist = boolc( lines( lt_filter ) > 0 ) .
@ -655,6 +657,10 @@ CLASS lcl_repo IMPLEMENTATION.
rv_yes = ms_data-write_protect. rv_yes = ms_data-write_protect.
ENDMETHOD. "is_write_protected ENDMETHOD. "is_write_protected
METHOD ignore_subpackages.
rv_yes = ms_data-ignore_subpackages.
ENDMETHOD.
METHOD rebuild_local_checksums. "LOCAL (BASE) METHOD rebuild_local_checksums. "LOCAL (BASE)
DATA: lt_local TYPE ty_files_item_tt, DATA: lt_local TYPE ty_files_item_tt,
@ -665,6 +671,7 @@ CLASS lcl_repo IMPLEMENTATION.
<ls_file_sig> LIKE LINE OF <ls_checksum>-files, <ls_file_sig> LIKE LINE OF <ls_checksum>-files,
<ls_local> LIKE LINE OF lt_local. <ls_local> LIKE LINE OF lt_local.
lt_local = get_files_local( ). lt_local = get_files_local( ).
DELETE lt_local " Remove non-code related files except .abapgit DELETE lt_local " Remove non-code related files except .abapgit

View File

@ -13,6 +13,7 @@ CLASS lcl_tadir DEFINITION FINAL.
CLASS-METHODS: CLASS-METHODS:
read read
IMPORTING iv_package TYPE tadir-devclass IMPORTING iv_package TYPE tadir-devclass
iv_ignore_subpackages TYPE abap_bool DEFAULT abap_false
RETURNING VALUE(rt_tadir) TYPE ty_tadir_tt RETURNING VALUE(rt_tadir) TYPE ty_tadir_tt
RAISING lcx_exception, RAISING lcx_exception,
read_single read_single
@ -35,6 +36,7 @@ CLASS lcl_tadir DEFINITION FINAL.
build build
IMPORTING iv_package TYPE tadir-devclass IMPORTING iv_package TYPE tadir-devclass
iv_path TYPE string iv_path TYPE string
iv_ignore_subpackages TYPE abap_bool DEFAULT abap_false
RETURNING VALUE(rt_tadir) TYPE ty_tadir_tt RETURNING VALUE(rt_tadir) TYPE ty_tadir_tt
RAISING lcx_exception. RAISING lcx_exception.
@ -111,7 +113,8 @@ CLASS lcl_tadir IMPLEMENTATION.
* start recursion * start recursion
rt_tadir = build( iv_package = iv_package rt_tadir = build( iv_package = iv_package
iv_path = '' ). iv_path = ''
iv_ignore_subpackages = iv_ignore_subpackages ).
rt_tadir = check_exists( rt_tadir ). rt_tadir = check_exists( rt_tadir ).
@ -161,9 +164,12 @@ CLASS lcl_tadir IMPLEMENTATION.
ENDLOOP. ENDLOOP.
* look for subpackages * look for subpackages
IF iv_ignore_subpackages = abap_false.
SELECT * FROM tdevc INTO TABLE lt_tdevc SELECT * FROM tdevc INTO TABLE lt_tdevc
WHERE parentcl = iv_package WHERE parentcl = iv_package
ORDER BY PRIMARY KEY. "#EC CI_SUBRC "#EC CI_GENBUFF ORDER BY PRIMARY KEY. "#EC CI_SUBRC "#EC CI_GENBUFF
ENDIF.
LOOP AT lt_tdevc ASSIGNING <ls_tdevc>. LOOP AT lt_tdevc ASSIGNING <ls_tdevc>.
lv_len = strlen( iv_package ). lv_len = strlen( iv_package ).
IF <ls_tdevc>-devclass(lv_len) <> iv_package. IF <ls_tdevc>-devclass(lv_len) <> iv_package.