From 3ee89b3dfcf53248237547002fee76746191da53 Mon Sep 17 00:00:00 2001 From: sbcgua Date: Fri, 14 Oct 2016 22:09:03 +0200 Subject: [PATCH] all repo diff at stage page --- src/zabapgit_html_action_utils.prog.abap | 1 + src/zabapgit_page_diff.prog.abap | 22 ++++++++++++++++++---- src/zabapgit_page_stage.prog.abap | 6 ++++-- 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/src/zabapgit_html_action_utils.prog.abap b/src/zabapgit_html_action_utils.prog.abap index bf425fa06..c64cdeed9 100644 --- a/src/zabapgit_html_action_utils.prog.abap +++ b/src/zabapgit_html_action_utils.prog.abap @@ -221,6 +221,7 @@ CLASS lcl_html_action_utils IMPLEMENTATION. CLEAR: ev_key, eg_file, eg_object. lt_fields = cl_http_utility=>if_http_utility~string_to_fields( |{ iv_string }| ). + field_keys_to_upper( CHANGING ct_fields = lt_fields ). get_field( EXPORTING name = 'KEY' it = lt_fields CHANGING cv = ev_key ). diff --git a/src/zabapgit_page_diff.prog.abap b/src/zabapgit_page_diff.prog.abap index 1709886dc..19772c55b 100644 --- a/src/zabapgit_page_diff.prog.abap +++ b/src/zabapgit_page_diff.prog.abap @@ -56,7 +56,6 @@ CLASS lcl_gui_page_diff IMPLEMENTATION. super->constructor( ). - ASSERT is_file IS SUPPLIED OR is_object IS SUPPLIED. ASSERT is_file IS INITIAL OR is_object IS INITIAL. " just one passed lo_repo ?= lcl_app=>repo_srv( )->get( iv_key ). @@ -70,14 +69,29 @@ CLASS lcl_gui_page_diff IMPLEMENTATION. iv_path = is_file-path iv_filename = is_file-filename ). - ELSE. " is_object is supplied + ELSEIF is_object IS NOT INITIAL. lt_results = lo_repo->status( ). LOOP AT lt_results ASSIGNING WHERE obj_type = is_object-obj_type - AND obj_name = is_object-obj_name - AND match IS INITIAL. + AND obj_name = is_object-obj_name + AND match IS INITIAL. + + append_diff( it_remote = lt_remote + it_local = lt_local + iv_path = -path + iv_filename = -filename ). + + ENDLOOP. + + ELSE. " For the whole repo + + lt_results = lo_repo->status( ). + + LOOP AT lt_results ASSIGNING + WHERE obj_type IS NOT INITIAL + AND match IS INITIAL. append_diff( it_remote = lt_remote it_local = lt_local diff --git a/src/zabapgit_page_stage.prog.abap b/src/zabapgit_page_stage.prog.abap index 248cf4ce0..4bac565d5 100644 --- a/src/zabapgit_page_stage.prog.abap +++ b/src/zabapgit_page_stage.prog.abap @@ -150,8 +150,10 @@ CLASS lcl_gui_page_stage IMPLEMENTATION. LOOP AT ms_files-local ASSIGNING . AT FIRST. ro_html->add(''). - ro_html->add('LOCAL' ). - ro_html->add(''). + ro_html->add('LOCAL' ). + ro_html->add_anchor( iv_txt = |{ lines( ms_files-local ) } diffs| + iv_act = |{ gc_action-go_diff }?key={ mo_repo->get_key( ) }| ). + ro_html->add(''). ro_html->add(''). ENDAT.