refactor commit author regex fixes #410

This commit is contained in:
Fabio Zuber 2016-12-13 17:18:31 +01:00
parent 371ce55e3f
commit 8447e0cc2d
3 changed files with 4 additions and 3 deletions

View File

@ -156,7 +156,8 @@ CONSTANTS: gc_newline TYPE abap_char1 VALUE cl_abap_char_utilities=>newline.
CONSTANTS: gc_english TYPE spras VALUE 'E'. CONSTANTS: gc_english TYPE spras VALUE 'E'.
CONSTANTS: gc_root_dir TYPE string VALUE '/', CONSTANTS: gc_root_dir TYPE string VALUE '/',
gc_dot_abapgit TYPE string VALUE '.abapgit.xml' ##NO_TEXT. gc_dot_abapgit TYPE string VALUE '.abapgit.xml' ##NO_TEXT,
gc_author_regex TYPE string VALUE '^([\w\s\.@\-_1-9]+) <(.*)> (\d{10}) .\d{4}$' ##NO_TEXT.
CONSTANTS: BEGIN OF gc_action, CONSTANTS: BEGIN OF gc_action,
repo_clone TYPE string VALUE 'repo_clone', repo_clone TYPE string VALUE 'repo_clone',

View File

@ -193,7 +193,7 @@ CLASS lcl_branch_overview IMPLEMENTATION.
SPLIT ls_raw-body AT gc_newline INTO ls_commit-message lv_trash. SPLIT ls_raw-body AT gc_newline INTO ls_commit-message lv_trash.
* unix time stamps are in same time zone, so ignore the zone, * unix time stamps are in same time zone, so ignore the zone,
FIND REGEX '^([\w\s\.@]+) <(.*)> (\d{10}) .\d{4}$' IN ls_raw-author FIND REGEX gc_author_regex IN ls_raw-author
SUBMATCHES SUBMATCHES
ls_commit-author ls_commit-author
ls_commit-email ls_commit-email

View File

@ -283,7 +283,7 @@ CLASS lcl_merge IMPLEMENTATION.
<ls_ancestor>-commit = lv_commit. <ls_ancestor>-commit = lv_commit.
<ls_ancestor>-tree = ls_commit-tree. <ls_ancestor>-tree = ls_commit-tree.
<ls_ancestor>-body = ls_commit-body. <ls_ancestor>-body = ls_commit-body.
FIND REGEX '^[\w\s]+ <.*> (\d{10}) .\d{4}$' IN ls_commit-author FIND REGEX gc_author_regex IN ls_commit-author
SUBMATCHES <ls_ancestor>-time ##NO_TEXT. SUBMATCHES <ls_ancestor>-time ##NO_TEXT.
ASSERT sy-subrc = 0. ASSERT sy-subrc = 0.
ENDLOOP. ENDLOOP.