All files / output zcl_abapgit_gui_page_merge.clas.mjs

4.77% Statements 14/293
66.66% Branches 2/3
7.69% Functions 1/13
4.77% Lines 14/293

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 2931x 1x 1x                           1x       1x       1x 1x                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         1x 1x 1x 1x 1x 1x 1x
const {zcl_abapgit_gui_component} = await import("./zcl_abapgit_gui_component.clas.mjs");
const {cx_root} = await import("./cx_root.clas.mjs");
// zcl_abapgit_gui_page_merge.clas.abap
class zcl_abapgit_gui_page_merge extends zcl_abapgit_gui_component {
  static INTERNAL_TYPE = 'CLAS';
  static INTERNAL_NAME = 'ZCL_ABAPGIT_GUI_PAGE_MERGE';
  static IMPLEMENTED_INTERFACES = ["ZIF_ABAPGIT_GUI_EVENT_HANDLER","ZIF_ABAPGIT_GUI_MENU_PROVIDER","ZIF_ABAPGIT_GUI_RENDERABLE"];
  static ATTRIBUTES = {"MI_REPO_ONLINE": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_REPO_ONLINE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_REPO_ONLINE"});}, "visibility": "I", "is_constant": " ", "is_class": " "},
  "MI_MERGE": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_MERGE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_MERGE"});}, "visibility": "I", "is_constant": " ", "is_class": " "},
  "C_ACTIONS": {"type": () => {return new abap.types.Structure({
  "merge": new abap.types.String({qualifiedName: "STRING"}),
  "res_conflicts": new abap.types.String({qualifiedName: "STRING"})}, undefined, undefined, {}, {});}, "visibility": "I", "is_constant": "X", "is_class": "X"}};
  static METHODS = {"SHOW_FILE": {"visibility": "I", "parameters": {"IT_EXPANDED": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({
  "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_EXPANDED-PATH"}),
  "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_EXPANDED-NAME"}),
  "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
  "chmod": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_git_definitions=>ty_chmod"})}, "zif_abapgit_git_definitions=>ty_expanded", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[{"name":"path_name","type":"SORTED","isUnique":false,"keyFields":["PATH","NAME"]}]}, "zif_abapgit_git_definitions=>ty_expanded_tt");}, "is_optional": " "}, "II_HTML": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_HTML", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_HTML"});}, "is_optional": " "}, "IS_FILE": {"type": () => {return new abap.types.Structure({
  "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_EXPANDED-PATH"}),
  "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_EXPANDED-NAME"}),
  "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
  "chmod": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_git_definitions=>ty_chmod"})}, "zif_abapgit_git_definitions=>ty_expanded", undefined, {}, {});}, "is_optional": " "}, "IS_RESULT": {"type": () => {return new abap.types.Structure({
  "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_EXPANDED-PATH"}),
  "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_EXPANDED-NAME"}),
  "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
  "chmod": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_git_definitions=>ty_chmod"})}, "zif_abapgit_git_definitions=>ty_expanded", undefined, {}, {});}, "is_optional": " "}}},
  "CREATE": {"visibility": "U", "parameters": {"RI_PAGE": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_RENDERABLE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_RENDERABLE"});}, "is_optional": " "}, "II_REPO_ONLINE": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_REPO_ONLINE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_REPO_ONLINE"});}, "is_optional": " "}, "IV_SOURCE": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_TARGET": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}},
  "CONSTRUCTOR": {"visibility": "U", "parameters": {"II_REPO_ONLINE": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_REPO_ONLINE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_REPO_ONLINE"});}, "is_optional": " "}, "IV_SOURCE": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_TARGET": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}};
  #mi_repo_online;
  #mi_merge;
  constructor() {
    const sup = super();
    this.me = new abap.types.ABAPObject();
    this.me.set(this);
    this.INTERNAL_ID = abap.internalIdCounter++;
    this.FRIENDS_ACCESS_INSTANCE = {
      "SUPER": sup.FRIENDS_ACCESS_INSTANCE,
      "show_file": this.#show_file.bind(this),
    };
    this.#mi_repo_online = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_REPO_ONLINE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_REPO_ONLINE"});
    this.FRIENDS_ACCESS_INSTANCE["mi_repo_online"] = this.#mi_repo_online;
    this.#mi_merge = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_MERGE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_MERGE"});
    this.FRIENDS_ACCESS_INSTANCE["mi_merge"] = this.#mi_merge;
    this.c_actions = zcl_abapgit_gui_page_merge.c_actions;
  }
  async constructor_(INPUT) {
    let ii_repo_online = INPUT?.ii_repo_online;
    if (ii_repo_online?.getQualifiedName === undefined || ii_repo_online.getQualifiedName() !== "ZIF_ABAPGIT_REPO_ONLINE") { ii_repo_online = undefined; }
    if (ii_repo_online === undefined) { ii_repo_online = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_REPO_ONLINE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_REPO_ONLINE"}).set(INPUT.ii_repo_online); }
    let iv_source = INPUT?.iv_source;
    if (iv_source?.getQualifiedName === undefined || iv_source.getQualifiedName() !== "STRING") { iv_source = undefined; }
    if (iv_source === undefined) { iv_source = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_source); }
    let iv_target = INPUT?.iv_target;
    if (iv_target?.getQualifiedName === undefined || iv_target.getQualifiedName() !== "STRING") { iv_target = undefined; }
    if (iv_target === undefined) { iv_target = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_target); }
    await super.constructor_();
    this.#mi_repo_online.set(ii_repo_online);
    await ii_repo_online.get().zif_abapgit_repo_online$select_branch({iv_branch_name: new abap.types.String().set(`${abap.templateFormatting(abap.Classes['ZIF_ABAPGIT_GIT_DEFINITIONS'].zif_abapgit_git_definitions$c_git_branch.get().heads_prefix)}${abap.templateFormatting(iv_target)}`)});
    this.#mi_merge.set(await (new abap.Classes['ZCL_ABAPGIT_MERGE']()).constructor_({ii_repo_online: ii_repo_online, iv_source_branch: iv_source}));
    await this.#mi_merge.get().zif_abapgit_merge$run();
    return this;
  }
  async create(INPUT) {
    return zcl_abapgit_gui_page_merge.create(INPUT);
  }
  static async create(INPUT) {
    let ri_page = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_RENDERABLE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_RENDERABLE"});
    let ii_repo_online = INPUT?.ii_repo_online;
    if (ii_repo_online?.getQualifiedName === undefined || ii_repo_online.getQualifiedName() !== "ZIF_ABAPGIT_REPO_ONLINE") { ii_repo_online = undefined; }
    if (ii_repo_online === undefined) { ii_repo_online = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_REPO_ONLINE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_REPO_ONLINE"}).set(INPUT.ii_repo_online); }
    let iv_source = INPUT?.iv_source;
    if (iv_source?.getQualifiedName === undefined || iv_source.getQualifiedName() !== "STRING") { iv_source = undefined; }
    if (iv_source === undefined) { iv_source = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_source); }
    let iv_target = INPUT?.iv_target;
    if (iv_target?.getQualifiedName === undefined || iv_target.getQualifiedName() !== "STRING") { iv_target = undefined; }
    if (iv_target === undefined) { iv_target = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_target); }
    let lo_component = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_GUI_PAGE_MERGE", RTTIName: "\\CLASS=ZCL_ABAPGIT_GUI_PAGE_MERGE"});
    lo_component.set(await (new abap.Classes['ZCL_ABAPGIT_GUI_PAGE_MERGE']()).constructor_({ii_repo_online: ii_repo_online, iv_source: iv_source, iv_target: iv_target}));
    ri_page.set((await abap.Classes['ZCL_ABAPGIT_GUI_PAGE_HOC'].create({iv_page_title: abap.CharacterFactory.get(5, 'Merge'), ii_page_menu_provider: lo_component, ii_child_component: lo_component})));
    return ri_page;
  }
  async #show_file(INPUT) {
    let it_expanded = INPUT?.it_expanded;
    if (it_expanded?.getQualifiedName === undefined || it_expanded.getQualifiedName() !== "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_EXPANDED_TT") { it_expanded = undefined; }
    if (it_expanded === undefined) { it_expanded = abap.types.TableFactory.construct(new abap.types.Structure({
    "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_EXPANDED-PATH"}),
    "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_EXPANDED-NAME"}),
    "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
    "chmod": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_git_definitions=>ty_chmod"})}, "zif_abapgit_git_definitions=>ty_expanded", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[{"name":"path_name","type":"SORTED","isUnique":false,"keyFields":["PATH","NAME"]}]}, "zif_abapgit_git_definitions=>ty_expanded_tt").set(INPUT.it_expanded); }
    let ii_html = INPUT?.ii_html;
    if (ii_html?.getQualifiedName === undefined || ii_html.getQualifiedName() !== "ZIF_ABAPGIT_HTML") { ii_html = undefined; }
    if (ii_html === undefined) { ii_html = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_HTML", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_HTML"}).set(INPUT.ii_html); }
    let is_file = INPUT?.is_file;
    if (is_file?.getQualifiedName === undefined || is_file.getQualifiedName() !== "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_EXPANDED") { is_file = undefined; }
    if (is_file === undefined) { is_file = new abap.types.Structure({
    "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_EXPANDED-PATH"}),
    "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_EXPANDED-NAME"}),
    "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
    "chmod": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_git_definitions=>ty_chmod"})}, "zif_abapgit_git_definitions=>ty_expanded", undefined, {}, {}).set(INPUT.is_file); }
    let is_result = INPUT?.is_result;
    if (is_result?.getQualifiedName === undefined || is_result.getQualifiedName() !== "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_EXPANDED") { is_result = undefined; }
    if (is_result === undefined) { is_result = new abap.types.Structure({
    "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_EXPANDED-PATH"}),
    "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_EXPANDED-NAME"}),
    "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
    "chmod": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_git_definitions=>ty_chmod"})}, "zif_abapgit_git_definitions=>ty_expanded", undefined, {}, {}).set(INPUT.is_result); }
    let fs_ls_show_ = new abap.types.FieldSymbol(new abap.types.Structure({
    "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_EXPANDED-PATH"}),
    "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_EXPANDED-NAME"}),
    "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
    "chmod": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_git_definitions=>ty_chmod"})}, "zif_abapgit_git_definitions=>ty_expanded", undefined, {}, {}));
    abap.statements.readTable(it_expanded,{keyName: "path_name",
      assigning: fs_ls_show_,
      withKey: (i) => {return abap.compare.eq(i.path, is_file.get().path) && abap.compare.eq(i.name, is_file.get().name);},
      withKeyValue: [{key: (i) => {return i.path}, value: is_file.get().path},{key: (i) => {return i.name}, value: is_file.get().name}],
      usesTableLine: false,
      withKeySimple: {"path": is_file.get().path,"name": is_file.get().name}});
    if (abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) {
      if (abap.compare.eq(fs_ls_show_.get().sha1, is_result.get().sha1)) {
        await ii_html.get().zif_abapgit_html$add({ig_chunk: new abap.types.String().set(`<td>${abap.templateFormatting(fs_ls_show_.get().path)}${abap.templateFormatting(fs_ls_show_.get().name)}</td><td><b>${abap.templateFormatting(fs_ls_show_.get().sha1.getOffset({length: 7}))}</b></td>`)});
      } else {
        await ii_html.get().zif_abapgit_html$add({ig_chunk: new abap.types.String().set(`<td>${abap.templateFormatting(fs_ls_show_.get().path)}${abap.templateFormatting(fs_ls_show_.get().name)}</td><td>${abap.templateFormatting(fs_ls_show_.get().sha1.getOffset({length: 7}))}</td>`)});
      }
    } else {
      await ii_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(18, '<td></td><td></td>')});
    }
  }
  async zif_abapgit_gui_event_handler$on_event(INPUT) {
    let rs_handled = new abap.types.Structure({
    "page": new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_RENDERABLE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_RENDERABLE"}),
    "state": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_GUI_EVENT_HANDLER=>TY_HANDLING_RESULT-STATE"})}, "zif_abapgit_gui_event_handler=>ty_handling_result", undefined, {}, {});
    let ii_event = INPUT?.ii_event;
    if (ii_event?.getQualifiedName === undefined || ii_event.getQualifiedName() !== "ZIF_ABAPGIT_GUI_EVENT") { ii_event = undefined; }
    if (ii_event === undefined) { ii_event = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_EVENT", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_EVENT"}).set(INPUT.ii_event); }
    let li_repo = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_REPO", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_REPO"});
    let unique960 = ii_event.get().zif_abapgit_gui_event$mv_action;
    if (abap.compare.eq(unique960, zcl_abapgit_gui_page_merge.c_actions.get().merge)) {
      if (abap.compare.eq((await this.#mi_merge.get().zif_abapgit_merge$has_conflicts()), abap.builtin.abap_true)) {
        await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: abap.CharacterFactory.get(16, 'conflicts exists')});
      }
      if (abap.compare.eq((await (await this.#mi_merge.get().zif_abapgit_merge$get_result()).get().stage.get().count()), abap.IntegerFactory.get(0))) {
        await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: abap.CharacterFactory.get(16, 'nothing to merge')});
      }
      li_repo.set(this.#mi_repo_online);
      if (abap.compare.initial(((await li_repo.get().zif_abapgit_repo$get_local_settings())).get().code_inspector_check_variant) === false) {
        rs_handled.get().page.set((await abap.Classes['ZCL_ABAPGIT_GUI_PAGE_CODE_INSP'].create({ii_repo: this.#mi_repo_online, io_stage: ((await this.#mi_merge.get().zif_abapgit_merge$get_result())).get().stage})));
      } else {
        rs_handled.get().page.set((await abap.Classes['ZCL_ABAPGIT_GUI_PAGE_COMMIT'].create({ii_repo_online: this.#mi_repo_online, io_stage: ((await this.#mi_merge.get().zif_abapgit_merge$get_result())).get().stage})));
      }
      rs_handled.get().state.set(abap.Classes['ZCL_ABAPGIT_GUI'].c_event_state.get().new_page);
    } else if (abap.compare.eq(unique960, zcl_abapgit_gui_page_merge.c_actions.get().res_conflicts)) {
      rs_handled.get().page.set((await abap.Classes['ZCL_ABAPGIT_GUI_PAGE_MERGE_RES'].create({ii_repo_online: this.#mi_repo_online, io_merge_page: this.me, io_merge: this.#mi_merge})));
      rs_handled.get().state.set(abap.Classes['ZCL_ABAPGIT_GUI'].c_event_state.get().new_page);
    }
    return rs_handled;
  }
  async zif_abapgit_gui_menu_provider$get_menu() {
    let ro_toolbar = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_HTML_TOOLBAR", RTTIName: "\\CLASS=ZCL_ABAPGIT_HTML_TOOLBAR"});
    ro_toolbar.set((await abap.Classes['ZCL_ABAPGIT_HTML_TOOLBAR'].create({iv_id: abap.CharacterFactory.get(13, 'toolbar-merge')})));
    await ro_toolbar.get().add({iv_txt: abap.CharacterFactory.get(5, 'Merge'), iv_act: zcl_abapgit_gui_page_merge.c_actions.get().merge, iv_cur: abap.builtin.abap_false});
    if (abap.compare.eq((await this.#mi_merge.get().zif_abapgit_merge$has_conflicts()), abap.builtin.abap_true)) {
      await ro_toolbar.get().add({iv_txt: abap.CharacterFactory.get(17, 'Resolve Conflicts'), iv_act: zcl_abapgit_gui_page_merge.c_actions.get().res_conflicts});
    }
    return ro_toolbar;
  }
  async zif_abapgit_gui_renderable$render() {
    let ri_html = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_HTML", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_HTML"});
    let ls_merge = new abap.types.Structure({
    "repo_online": new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_REPO_ONLINE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_REPO_ONLINE"}),
    "source": new abap.types.Structure({
    "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
    "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_BRANCH-NAME"}),
    "type": new abap.types.Character(2, {"qualifiedName":"zif_abapgit_git_definitions=>ty_git_branch_type"}),
    "is_head": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}),
    "display_name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_BRANCH-DISPLAY_NAME"})}, "zif_abapgit_git_definitions=>ty_git_branch", undefined, {}, {}),
    "target": new abap.types.Structure({
    "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
    "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_BRANCH-NAME"}),
    "type": new abap.types.Character(2, {"qualifiedName":"zif_abapgit_git_definitions=>ty_git_branch_type"}),
    "is_head": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}),
    "display_name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_GIT_BRANCH-DISPLAY_NAME"})}, "zif_abapgit_git_definitions=>ty_git_branch", undefined, {}, {}),
    "common": new abap.types.Structure({
    "commit": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
    "tree": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
    "time": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_ANCESTOR-TIME"}),
    "body": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_DEFINITIONS=>TY_ANCESTOR-BODY"})}, "zif_abapgit_definitions=>ty_ancestor", undefined, {}, {}),
    "stree": abap.types.TableFactory.construct(new abap.types.Structure({
    "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_EXPANDED-PATH"}),
    "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_EXPANDED-NAME"}),
    "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
    "chmod": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_git_definitions=>ty_chmod"})}, "zif_abapgit_git_definitions=>ty_expanded", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[{"name":"path_name","type":"SORTED","isUnique":false,"keyFields":["PATH","NAME"]}]}, "zif_abapgit_git_definitions=>ty_expanded_tt"),
    "ttree": abap.types.TableFactory.construct(new abap.types.Structure({
    "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_EXPANDED-PATH"}),
    "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_EXPANDED-NAME"}),
    "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
    "chmod": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_git_definitions=>ty_chmod"})}, "zif_abapgit_git_definitions=>ty_expanded", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[{"name":"path_name","type":"SORTED","isUnique":false,"keyFields":["PATH","NAME"]}]}, "zif_abapgit_git_definitions=>ty_expanded_tt"),
    "ctree": abap.types.TableFactory.construct(new abap.types.Structure({
    "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_EXPANDED-PATH"}),
    "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_EXPANDED-NAME"}),
    "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
    "chmod": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_git_definitions=>ty_chmod"})}, "zif_abapgit_git_definitions=>ty_expanded", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[{"name":"path_name","type":"SORTED","isUnique":false,"keyFields":["PATH","NAME"]}]}, "zif_abapgit_git_definitions=>ty_expanded_tt"),
    "result": abap.types.TableFactory.construct(new abap.types.Structure({
    "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_EXPANDED-PATH"}),
    "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_EXPANDED-NAME"}),
    "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
    "chmod": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_git_definitions=>ty_chmod"})}, "zif_abapgit_git_definitions=>ty_expanded", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[{"name":"path_name","type":"SORTED","isUnique":false,"keyFields":["PATH","NAME"]}]}, "zif_abapgit_git_definitions=>ty_expanded_tt"),
    "stage": new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_STAGE", RTTIName: "\\CLASS=ZCL_ABAPGIT_STAGE"}),
    "conflict": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_MERGE=>TY_MERGE-CONFLICT"})}, "zif_abapgit_merge=>ty_merge", undefined, {}, {});
    let lt_files = abap.types.TableFactory.construct(new abap.types.Structure({
    "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_EXPANDED-PATH"}),
    "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_EXPANDED-NAME"}),
    "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
    "chmod": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_git_definitions=>ty_chmod"})}, "zif_abapgit_git_definitions=>ty_expanded", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[{"name":"path_name","type":"SORTED","isUnique":false,"keyFields":["PATH","NAME"]}]}, "zif_abapgit_git_definitions=>ty_expanded_tt");
    let ls_result = new abap.types.Structure({
    "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_EXPANDED-PATH"}),
    "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_EXPANDED-NAME"}),
    "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
    "chmod": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_git_definitions=>ty_chmod"})}, "zif_abapgit_git_definitions=>ty_expanded", undefined, {}, {});
    let fs_ls_file_ = new abap.types.FieldSymbol(new abap.types.Structure({
    "path": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_EXPANDED-PATH"}),
    "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GIT_DEFINITIONS=>TY_EXPANDED-NAME"}),
    "sha1": new abap.types.Character(40, {"qualifiedName":"zif_abapgit_git_definitions=>ty_sha1"}),
    "chmod": new abap.types.Character(6, {"qualifiedName":"zif_abapgit_git_definitions=>ty_chmod"})}, "zif_abapgit_git_definitions=>ty_expanded", undefined, {}, {}));
    await this.register_handlers();
    ls_merge.set((await this.#mi_merge.get().zif_abapgit_merge$get_result()));
    ri_html.set(await (new abap.Classes['ZCL_ABAPGIT_HTML']()).constructor_());
    await ri_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(14, '<div id="toc">')});
    await ri_html.get().zif_abapgit_html$add({ig_chunk: (await abap.Classes['ZCL_ABAPGIT_GUI_CHUNK_LIB'].render_repo_top({ii_repo: this.#mi_repo_online, iv_show_package: abap.builtin.abap_false, iv_show_branch: abap.builtin.abap_false}))});
    await ri_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(7, '<table>')});
    await ri_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(4, '<tr>')});
    await ri_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(15, '<td>Source</td>')});
    await ri_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(4, '<td>')});
    await ri_html.get().zif_abapgit_html$add({ig_chunk: ls_merge.get().source.get().name});
    await ri_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(10, '</td></tr>')});
    await ri_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(4, '<tr>')});
    await ri_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(15, '<td>Target</td>')});
    await ri_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(4, '<td>')});
    await ri_html.get().zif_abapgit_html$add({ig_chunk: ls_merge.get().target.get().name});
    await ri_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(10, '</td></tr>')});
    await ri_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(4, '<tr>')});
    await ri_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(17, '<td>Ancestor</td>')});
    await ri_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(4, '<td>')});
    await ri_html.get().zif_abapgit_html$add({ig_chunk: ls_merge.get().common.get().commit});
    await ri_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(10, '</td></tr>')});
    await ri_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(8, '</table>')});
    await ri_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(4, '<br>')});
    abap.statements.append({source: ls_merge.get().stree, lines: true, target: lt_files});
    abap.statements.append({source: ls_merge.get().ttree, lines: true, target: lt_files});
    abap.statements.append({source: ls_merge.get().ctree, lines: true, target: lt_files});
    abap.statements.sort(lt_files,{by: [{component: "path", descending: true},{component: "name"}]});
    await abap.statements.deleteInternal(lt_files,{adjacent: true,comparing: ['path','name']});
    await ri_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(7, '<table>')});
    await ri_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(4, '<tr>')});
    await ri_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(22, '<td><u>Source</u></td>')});
    await ri_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(9, '<td></td>')});
    await ri_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(22, '<td><u>Target</u></td>')});
    await ri_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(9, '<td></td>')});
    await ri_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(24, '<td><u>Ancestor</u></td>')});
    await ri_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(9, '<td></td>')});
    await ri_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(22, '<td><u>Result</u></td>')});
    await ri_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(9, '<td></td>')});
    await ri_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(5, '</tr>')});
    for await (const unique961 of abap.statements.loop(lt_files)) {
      fs_ls_file_.assign(unique961);
      ls_result.clear();
      abap.statements.readTable(ls_merge.get().result,{keyName: "path_name",
        into: ls_result,
        withKey: (i) => {return abap.compare.eq(i.path, fs_ls_file_.get().path) && abap.compare.eq(i.name, fs_ls_file_.get().name);},
        withKeyValue: [{key: (i) => {return i.path}, value: fs_ls_file_.get().path},{key: (i) => {return i.name}, value: fs_ls_file_.get().name}],
        usesTableLine: false,
        withKeySimple: {"path": fs_ls_file_.get().path,"name": fs_ls_file_.get().name}});
      await ri_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(4, '<tr>')});
      await this.#show_file({it_expanded: ls_merge.get().stree, ii_html: ri_html, is_file: fs_ls_file_, is_result: ls_result});
      await this.#show_file({it_expanded: ls_merge.get().ttree, ii_html: ri_html, is_file: fs_ls_file_, is_result: ls_result});
      await this.#show_file({it_expanded: ls_merge.get().ctree, ii_html: ri_html, is_file: fs_ls_file_, is_result: ls_result});
      await this.#show_file({it_expanded: ls_merge.get().result, ii_html: ri_html, is_file: fs_ls_file_, is_result: ls_result});
      await ri_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(5, '</tr>')});
    }
    await ri_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(8, '</table>')});
    await ri_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(4, '<br>')});
    await ri_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(3, '<b>')});
    await ri_html.get().zif_abapgit_html$add({ig_chunk: ls_merge.get().conflict});
    await ri_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(4, '</b>')});
    await ri_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(6, '</div>')});
    return ri_html;
  }
}
abap.Classes['ZCL_ABAPGIT_GUI_PAGE_MERGE'] = zcl_abapgit_gui_page_merge;
zcl_abapgit_gui_page_merge.c_actions = new abap.types.Structure({
"merge": new abap.types.String({qualifiedName: "STRING"}),
"res_conflicts": new abap.types.String({qualifiedName: "STRING"})}, undefined, undefined, {}, {});
zcl_abapgit_gui_page_merge.c_actions.get().merge.set('merge');
zcl_abapgit_gui_page_merge.c_actions.get().res_conflicts.set('res_conflicts');
export {zcl_abapgit_gui_page_merge};