╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ──────────╮ │src/event/Issue.zig│ ╰───────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │134 │ │135 // the id set retains removed records so merges can carry removals │ │136 if (existing_cursor_maybe == null) { │ │137 - const issue_id_set_cursor = try haxy_moment.putCursor(hash.hashInt(hash_kind, id_set_key)); │ │137 + const issue_id_set_cursor = try haxy_moment.putCursor(hash.hashInt(hash_kind, all_id_set_key));│ │138 const issue_id_set = try DB.SortedSet(.read_write).init(issue_id_set_cursor); │ │139 try issue_id_set.put(&order_key); │ │140 } │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──────────╮ │src/event/Patch.zig│ ╰───────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────╮ │126 pub const tag_max_len = 64; │ │127 pub const merge_policy: evt.MergePolicy = .field_conflicts; │ │128 pub const record_map_key = "event-id->patch"; │ │129 -pub const id_set_key = "patch-id-set"; │ │129 +pub const all_id_set_key = "patch-id-set"; │ │130 pub const conflicts_key = "conflicted-patch-id->conflict"; │ │131 pub const id_to_field_to_oid_key = "patch-id->field->oid"; │ │132 pub const target_patch_id_to_patch_id_set_key = "target-patch-id->patch-id-set";│ ╰─────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │245 try evt.indexEvent(DB, hash_kind, haxy_moment, event_id, .patch, existing_maybe, record); │ │246 │ │247 if (existing_cursor_maybe == null) { │ │248 - const ids = try DB.SortedSet(.read_write).init(try haxy_moment.putCursor(hash.hashInt(hash_kind, id_set_key))); │ │248 + const ids = try DB.SortedSet(.read_write).init(try haxy_moment.putCursor(hash.hashInt(hash_kind, all_id_set_key))); │ │249 try ids.put(&order_key); │ │250 if (target_patch_id) |*target_id| { │ │251 const targets = try DB.HashMap(.read_write).init(try haxy_moment.putCursor(hash.hashInt(hash_kind, target_patch_id_to_patch_id_set_key)));│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────╮ │src/event/PatchRev.zig│ ╰──────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────╮ │25 │ │26 pub const merge_policy: evt.MergePolicy = .target_wins; │ │27 pub const record_map_key = "event-id->patchrev"; │ │28 -pub const id_set_key = "patchrev-id-set"; │ │28 +pub const all_id_set_key = "patchrev-id-set"; │ │29 │ │30 // create the mergeable squash commit represented by this patch revision│ │31 pub fn writeSquashCommit( │ ╰────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │135 try evt.indexEvent(DB, hash_kind, haxy_moment, event_id, .patchrev, existing_maybe, record); │ │136 │ │137 if (existing_cursor_maybe == null) { │ │138 - const ids = try DB.SortedSet(.read_write).init(try haxy_moment.putCursor(hash.hashInt(hash_kind, id_set_key))); │ │138 + const ids = try DB.SortedSet(.read_write).init(try haxy_moment.putCursor(hash.hashInt(hash_kind, all_id_set_key)));│ │139 try ids.put(&evt.orderKeyDesc(record.created_order, event_id)); │ │140 } │ │141 } │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │170 haxy_moment: DB.HashMap(.read_only), │ │171 arena: *std.heap.ArenaAllocator, │ │172 ) !?WithId { │ │173 - const ids_cursor = try haxy_moment.getCursor(hash.hashInt(hash_kind, id_set_key)) orelse return null; │ │173 + const ids_cursor = try haxy_moment.getCursor(hash.hashInt(hash_kind, all_id_set_key)) orelse return null;│ │174 const ids = try DB.SortedSet(.read_only).init(ids_cursor); │ │175 var iter = try ids.iteratorFromIndex(0); │ │176 while (try iter.next()) |cursor| { │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │193 var arena = std.heap.ArenaAllocator.init(allocator); │ │194 defer arena.deinit(); │ │195 │ │196 - const ids_cursor = try haxy_moment.getCursor(hash.hashInt(hash_kind, id_set_key)) orelse return try roots.toOwnedSlice(allocator); │ │196 + const ids_cursor = try haxy_moment.getCursor(hash.hashInt(hash_kind, all_id_set_key)) orelse return try roots.toOwnedSlice(allocator);│ │197 const ids = try DB.SortedSet(.read_only).init(ids_cursor); │ │198 var iter = try ids.iteratorFromIndex(0); │ │199 while (try iter.next()) |cursor| { │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────╮ │src/event/Repo.zig│ ╰──────────────────╯ ╭─────────────────────────────────────────────────────────────────╮ │37 // the moment keys `evt.merge` reads and writes for this kind│ │38 pub const merge_policy: evt.MergePolicy = .target_wins; │ │39 pub const record_map_key = "event-id->repo"; │ │40 -pub const id_set_key = "repo-id-set"; │ │40 +pub const all_id_set_key = "repo-id-set"; │ │41 +pub const active_id_set_key = "active-repo-id-set"; │ │42 pub const name_index_key = "name->repo-id"; │ │43 │ │44 pub fn validateName(name: []const u8) !void { │ ╰─────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │117 │ │118 // the id set retains removed records so merges can carry removals │ │119 if (existing_cursor_maybe == null) { │ │119 - const repo_id_set_cursor = try haxy_moment.putCursor(hash.hashInt(hash_kind, id_set_key)); │ │120 + const repo_id_set_cursor = try haxy_moment.putCursor(hash.hashInt(hash_kind, all_id_set_key));│ │121 const repo_id_set = try DB.SortedSet(.read_write).init(repo_id_set_cursor); │ │122 try repo_id_set.put(&order_key); │ │123 } │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │124 │ │124 - if (!record_to_write.removed) { │ │125 + const active = try DB.SortedSet(.read_write).init(try haxy_moment.putCursor(hash.hashInt(hash_kind, active_id_set_key)));│ │126 + if (record_to_write.removed) { │ │127 + _ = try active.remove(&order_key); │ │128 + } else { │ │129 + try active.put(&order_key); │ │130 const repo_path = try record_to_write.indexKey(arena.allocator()); │ │131 try name_to_repo_id.put(hash.hashInt(hash_kind, repo_path), .{ .bytes = event_id }); │ │132 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯