╭ changed ─────────────╮ │src/event/PatchRev.zig│ ╰──────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭─────────────────────────────────────────╮ │14 removed: bool = false, │ │15 author_email: ?[]const u8 = null,│ │16 created_order: u64 = 0, │ │17 + updated_order: u64 = 0, │ │18 event_oid: []const u8, │ │19 base_tree_oid: []const u8, │ │20 head_tree_oid: []const u8, │ ╰─────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │106 existing_maybe = try evt.read(Record, DB, hash_kind, arena, try DB.HashMap(.read_only).init(cursor)); │ │107 } │ │108 │ │108 - var record = if (record_maybe) |value| │ │109 - value │ │110 - else blk: { │ │111 - var value = existing_maybe orelse return error.EventNotFound; │ │112 - value.removed = true; │ │113 - break :blk value; │ │114 - }; │ │109 + var record = record_maybe orelse try evt.removedRecord(Record, DB, hash_kind, haxy_moment.readOnly(), existing_maybe);│ │110 │ │111 try validateOid(hash_kind, record.event.base_oid); │ │112 try validateOid(hash_kind, record.event.source_oid); │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │132 │ │133 const cursor = try records.putCursor(record_key); │ │134 try evt.upsert(Record, DB, hash_kind, try DB.HashMap(.read_write).init(cursor), record); │ │140 - try evt.indexEvent(DB, hash_kind, haxy_moment, event_id, .patchrev, record.created_order, record.removed); │ │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)));│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯