╭ changed ───────────────╮ │src/test/event/patch.zig│ ╰────────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │311 .{ .tree = .{ .name = "head", .oid = &source_b_tree } }, │ │312 }; │ │313 var parent_patch = updated_patch; │ │314 - parent_patch.status = .merged; │ │314 + parent_patch.status = .{ .merged = &source_b_oid }; │ │315 { │ │316 try consumePatchWithRevision(.repo, io, allocator, &target, side_events_ref, patchrev_b_id, .{│ │317 .base_oid = &base_oid, │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │426 .event = .{ .patch = closed_child }, │ │427 }}); │ │428 var merged_child = child.event; │ │429 - merged_child.status = .merged; │ │429 + merged_child.status = .{ .merged = (child.event.revision orelse return error.NotFound).source_oid };│ │430 try evt.consume(.repo, .xit, repo_opts, io, allocator, &target, status_side_ref, &.{.{ │ │431 .id = std.fmt.bytesToHex(child_id, .lower), │ │432 .timestamp = 15, │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │439 _ = arena.reset(.retain_capacity); │ │440 const status_moment = try evt.currentMoment(repo_opts, &target); │ │441 const merged_child_record = (try evt.Patch.readById(Repo.DB, repo_opts.hash, status_moment, &arena, &child_id)) orelse return error.NotFound;│ │442 - try std.testing.expectEqual(.merged, merged_child_record.event.status); │ │442 + try std.testing.expectEqual(.merged, merged_child_record.event.status.kind()); │ │443 try std.testing.expectEqual(0, try patchStatusCount(status_moment, .open)); │ │444 try std.testing.expectEqual(1, try patchStatusCount(status_moment, .closed)); │ │445 try std.testing.expectEqual(1, try patchStatusCount(status_moment, .merged)); │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────╮ │467 .title = "invalid merged patch", │ │468 .description = "has no revision", │ │469 .tags = "enhancement", │ │470 - .status = .merged, │ │470 + .status = .{ .merged = &base_oid },│ │471 } }, │ │472 }})); │ │473 │ ╰────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │788 _ = arena.reset(.retain_capacity); │ │789 const merged_moment = try evt.currentMoment(repo_opts, &target); │ │790 const merged = (try evt.Patch.readById(Repo.DB, repo_opts.hash, merged_moment, &arena, &patch_id)) orelse return error.NotFound;│ │791 - try std.testing.expectEqual(.merged, merged.event.status); │ │791 + try std.testing.expectEqual(.merged, merged.event.status.kind()); │ │792 + const merged_oid = switch (merged.event.status) { │ │793 + .merged => |oid| oid, │ │794 + else => return error.InvalidPatch, │ │795 + }; │ │796 + try std.testing.expectEqualStrings(&selected_oid, merged_oid); │ │797 try std.testing.expect(null != try evt.PatchRev.readById(Repo.DB, repo_opts.hash, merged_moment, &arena, &first_patchrev_id)); │ │798 │ │799 _ = arena.reset(.retain_capacity); │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │813 return try ids.count(); │ │814 } │ │815 │ │811 -fn patchStatusCount(moment: Repo.DB.HashMap(.read_only), status: evt.Patch.Status) !u64 { │ │816 +fn patchStatusCount(moment: Repo.DB.HashMap(.read_only), status: evt.Patch.StatusKind) !u64 { │ │817 const statuses_cursor = try moment.getCursor(hash.hashInt(repo_opts.hash, evt.Patch.status_to_id_set_key)) orelse return 0;│ │818 const statuses = try Repo.DB.SortedMap(.read_only).init(statuses_cursor); │ │819 const ids_cursor = try statuses.getCursor(@tagName(status)) orelse return 0; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │821 return try ids.count(); │ │822 } │ │823 │ │819 -fn patchTagStatusCount(moment: Repo.DB.HashMap(.read_only), tag: []const u8, status: evt.Patch.Status) !u64 { │ │824 +fn patchTagStatusCount(moment: Repo.DB.HashMap(.read_only), tag: []const u8, status: evt.Patch.StatusKind) !u64 { │ │825 const tags_cursor = try moment.getCursor(hash.hashInt(repo_opts.hash, evt.Patch.tag_status_to_id_set_key)) orelse return 0;│ │826 const tags = try Repo.DB.SortedMap(.read_only).init(tags_cursor); │ │827 var key_buffer: evt.Patch.TagStatusKey = undefined; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯