╭ changed ──────────────╮ │src/ui/Repo/Patches.zig│ ╰───────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭─────────────────────────────────────────────╮ │37 fork_oid: []const u8 = "", │ │38 no_changes: bool = false, │ │39 fork_exists: bool = false, │ │40 + mergeability: pch.Mergeability = .{},│ │41 }; │ │42 │ │43 pub const Entry = PatchWithId; │ ╰─────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │231 }); │ │232 } │ │233 │ │233 -pub fn mergePatch(data: *const Self, session: *ui.Session, allocator: std.mem.Allocator, id: []const u8, squash: bool) !void { │ │234 +pub fn mergePatch(data: *const Self, session: *ui.Session, allocator: std.mem.Allocator, id: []const u8, revision: pch.MergeRevision) !void {│ │235 const io = session.io orelse return error.NotFound; │ │236 const repos_dir = session.repos_dir orelse return error.NotFound; │ │237 const admin_repo = session.admin_repo orelse return error.NotFound; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────╮ │245 defer target_repo.deinit(io, allocator); │ │246 try pch.mergeAndRemoveFork(.{}, io, allocator, repos_dir, admin_repo, &target_repo, .{│ │247 .id = id_hex, │ │247 - .revision = if (squash) .squash else .source, │ │248 + .revision = revision, │ │249 .author = author, │ │250 .timestamp = @intCast(std.Io.Timestamp.now(io, .real).toSeconds()), │ │251 }); │ ╰───────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │604 else => revision.source_oid, │ │605 }; │ │606 if (item.record.event.status.kind() == .merged) continue; │ │607 + if (comptime repo_kind == .xit) { │ │608 + var moment = try repo.core.latestMoment(); │ │609 + const state = rp.Repo(.xit, repo_opts).State(.read_only){ .core = &repo.core, .extra = .{ .moment = &moment } };│ │610 + const id = try evt.parseEventId(item.id); │ │611 + item.mergeability = pch.readMergeability(repo_opts, state, io, arena, &id, item.record.event) catch .{}; │ │612 + } │ │613 const target_oid = try repo.readRef(io, .{ .kind = .head, .name = target_branch }); │ │614 item.no_changes = if (target_oid) |oid| std.mem.eql(u8, &oid, revision.source_oid) else false; │ │615 } │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯