╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ───────────────╮ │src/test/event/patch.zig│ ╰────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │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; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ───────╮ │src/test/net.zig│ ╰────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │794 defer arena.deinit(); │ │795 const moment = try evt.currentMoment(.{}, &target); │ │796 const patch = (try evt.Patch.readById(evt.EventDB(.sha1), .sha1, moment, &arena, &fork_id)) orelse return error.NotFound; │ │797 - try std.testing.expectEqual(.merged, patch.event.status); │ │797 + try std.testing.expectEqual(.merged, patch.event.status.kind()); │ │798 + const merged_oid = switch (patch.event.status) { │ │799 + .merged => |oid| oid, │ │800 + else => return error.InvalidPatch, │ │801 + }; │ │802 + try std.testing.expectEqualStrings(&second_source_oid, merged_oid); │ │803 const imported = (try evt.PatchRev.readById(evt.EventDB(.sha1), .sha1, moment, &arena, &second_revision_id)) orelse return error.NotFound;│ │804 try std.testing.expectEqualStrings(&second_patch_oid, imported.patch_oid); │ │805 } │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──╮ │src/try.zig│ ╰───────────╯ ╭───────────────────────────────────────────────────────────────╮ │1085 title: []const u8, │ │1086 description: []const u8, │ │1087 tags: []const u8, │ │1088 - status: ?evt.Patch.Status, │ │1088 + status: ?evt.Patch.StatusKind, │ │1089 }{ │ │1090 .{ │ │1091 .title = "Draft a faster dependency scanner",│ ╰───────────────────────────────────────────────────────────────╯ ╭ changed ─╮ │src/ui.zig│ ╰──────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │564 } }; │ │565 } │ │566 │ │567 - pub fn repoPatchesRoute(identity: []const u8, status: evt.Patch.Status, tag: []const u8, selected: []const u8) ?RoutablePage { │ │567 + pub fn repoPatchesRoute(identity: []const u8, status: evt.Patch.StatusKind, tag: []const u8, selected: []const u8) ?RoutablePage {│ │568 return .{ .repo_patches = .{ │ │569 .name = Array(repo_route_max_len).from(identity) orelse return null, │ │570 .tag = Array(patch_tag_route_max_len).from(tag) orelse return null, │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1320 return repoPatchesConflictsRoute(pair, params.values.get(.start) orelse ""); │ │1321 } │ │1322 if (!params.only(&.{.tag})) return null; │ │1323 - if (std.meta.stringToEnum(evt.Patch.Status, view)) |status| return repoPatchesRoute(pair, status, tag_value, ""); │ │1323 + if (std.meta.stringToEnum(evt.Patch.StatusKind, view)) |status| return repoPatchesRoute(pair, status, tag_value, "");│ │1324 if (std.mem.eql(u8, view, "tags")) return repoThreadTagsRoute(.patch, pair, tag_value); │ │1325 if (std.mem.eql(u8, view, "new")) return if (tag_value.len == 0) repoThreadNewRoute(.patch, pair) else null; │ │1326 if (std.mem.eql(u8, view, "drafts")) return if (tag_value.len == 0) repoPatchesDraftsRoute(pair) else null; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────╮ │src/ui/Repo/Issues.zig│ ╰──────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │111 pub const ViewKind = ui.RoutablePage.IssuesView; │ │112 pub const thread_name = "issue"; │ │113 pub const header_widget_name = "repo_issues_header"; │ │114 + │ │115 +pub fn statusKind(event: Event) Status { │ │116 + return event.status; │ │117 +} │ │118 │ │119 pub fn listRoute(identity: []const u8, status: Status, tag: []const u8, selected: []const u8) ?ui.RoutablePage {│ │120 return ui.RoutablePage.repoIssuesRoute(identity, status, tag, selected); │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯