╭ changed ──────────╮ │src/event/Patch.zig│ ╰───────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────╮ │← previous│ ╰──────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │276 while (tag_iter.next()) |tag| { │ │277 if (tag.len == 0 or tag.len > tag_max_len) continue; │ │278 var key_buffer: TagStatusKey = undefined; │ │217 - const set = try DB.SortedSet(.read_write).init(try tag_statuses.putCursor(try tagStatusKey(&key_buffer, tag, record.event.status)));│ │279 + const set = try DB.SortedSet(.read_write).init(try tag_statuses.putCursor(try tagStatusKey(&key_buffer, tag, status_kind))); │ │280 try set.put(&order_key); │ │281 } │ │282 │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │221 - if (record.event.status != .merged) { │ │283 + if (status_kind != .merged) { │ │284 if (record.event.revision) |revision| { │ │285 const revisions = try DB.HashMap(.read_write).init(try haxy_moment.putCursor(hash.hashInt(hash_kind, revision_to_id_set_key)));│ │286 for ([_][]const u8{ revision.squash_oid, revision.source_oid }, 0..) |oid, i| { │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │304 const revision_index = std.meta.fieldIndex(Self, "revision") orelse @compileError("Patch.revision not found");│ │305 if (outcome[status_index] != .conflicted or outcome[revision_index] == .conflicted) return; │ │306 │ │245 - if (target.status == .merged and evt.fieldEqual(?Revision, target.revision, merged.revision)) { │ │246 - merged.status = .merged; │ │307 + if (target.status.kind() == .merged and evt.fieldEqual(?Revision, target.revision, merged.revision)) { │ │308 + merged.status = target.status; │ │309 outcome[status_index] = .kept; │ │248 - } else if (parent.status == .merged and evt.fieldEqual(?Revision, parent.revision, merged.revision)) { │ │249 - merged.status = .merged; │ │310 + } else if (parent.status.kind() == .merged and evt.fieldEqual(?Revision, parent.revision, merged.revision)) { │ │311 + merged.status = parent.status; │ │312 outcome[status_index] = .parent; │ │313 } │ │314 } │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────╮ │331 var updated = record.event; │ │332 switch (change) { │ │333 .status => |status| { │ │272 - if (updated.status == status) return; │ │273 - updated.status = status; │ │334 + if (updated.status.kind() == status) return; │ │335 + updated.status = switch (status) { │ │336 + .open => .open, │ │337 + .closed => .closed, │ │338 + .merged => return error.InvalidPatchStatus,│ │339 + }; │ │340 }, │ │341 .fields => |fields| { │ │342 updated.title = fields.title; │ ╰────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────╮ │449 fn statusSet( │ │450 comptime DB: type, │ │451 statuses: DB.SortedMap(.read_write), │ │386 - status: Status, │ │452 + status: StatusKind, │ │453 ) !DB.SortedSet(.read_write) { │ │454 return DB.SortedSet(.read_write).init(try statuses.putCursor(@tagName(status)));│ │455 } │ ╰─────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────╮ │458 comptime DB: type, │ │459 tag_statuses: DB.SortedMap(.read_write),│ │460 tags: []const u8, │ │395 - status: Status, │ │461 + status: StatusKind, │ │462 order_key: []const u8, │ │463 ) !void { │ │464 var tag_iter = tagIterator(tags); │ ╰─────────────────────────────────────────────────╯