╭ changed ────╮ │src/patch.zig│ ╰─────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ 94 const history = try DB.ArrayList(.read_write).init(repo.core.db.rootCursor()); │ │ 95 try history.appendContext(.{ .slot = try history.getSlot(-1) }, Ctx{ .repo = repo, .io = io, .arena = &arena, .id = id, .patch = patch, .expected_patch = expected_patch, .author = author, .checks = &checks, .first_parent = first_parent });│ │ 96 } │ │ 97 - if (host == .server) evt.bumpRepoActivityAt(io, allocator, host.server.users_dir, repo.core.work_path); │ │ 97 + if (host == .server) evt.bumpRepoActivityAt(io, allocator, host.server, repo.core.work_path); │ │ 98 } │ │ 99 } │ │100 │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────╮ │885 comptime repo_opts: rp.RepoOpts(.xit), │ │886 io: std.Io, │ │887 allocator: std.mem.Allocator, │ │888 - users_dir: []const u8, │ │888 + server: evt.Host.Server, │ │889 admin_repo: *rp.Repo(.xit, evt.admin_repo_opts),│ │890 target_repo: *rp.Repo(.xit, repo_opts), │ │891 input: PublishInput, │ ╰─────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │895 defer arena.deinit(); │ │896 │ │897 // validate the fork ownership and publishing identity │ │898 - var user_repo = (try evt.openUserRepo(io, allocator, users_dir, &input.user_id)) orelse return error.InvalidPatchDraft; │ │898 + var user_repo = (try evt.openUserRepo(io, allocator, server.users_dir, &input.user_id)) orelse return error.InvalidPatchDraft;│ │899 defer user_repo.deinit(io, allocator); │ │900 const admin_moment = try evt.currentMoment(evt.admin_repo_opts, admin_repo); │ │901 const user_moment = (try evt.userMoment(&user_repo)) orelse return error.InvalidPatchDraft; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │907 !std.mem.eql(u8, user.event.email, input.author.email)) return error.InvalidPatchDraft; │ │908 │ │909 // read the patch staged in the fork │ │910 - const fork_path = try fork.forkPath(arena.allocator(), users_dir, &input.user_id, &patch_id); │ │910 + const fork_path = try fork.forkPath(arena.allocator(), server.users_dir, &input.user_id, &patch_id); │ │911 var fork_repo = rp.Repo(.xit, repo_opts).open(io, allocator, .{ .path = fork_path }) catch return error.PatchDataUnavailable;│ │912 defer fork_repo.deinit(io, allocator); │ │913 const fork_moment = evt.currentMoment(repo_opts, &fork_repo) catch return error.PatchDataUnavailable; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ 998 else => |e| return e, │ │ 999 }; │ │1000 } │ │1001 - evt.bumpRepoActivityAt(io, allocator, users_dir, target_repo.core.work_path); │ │1001 + evt.bumpRepoActivityAt(io, allocator, server, target_repo.core.work_path); │ │1002 │ │1003 // remove the consumed draft from the fork │ │1004 - try evt.consume(.{ .server = .{ .users_dir = users_dir } }, .fork, .xit, repo_opts, io, allocator, &fork_repo, evt.events_ref, &.{.{│ │1004 + try evt.consume(.{ .server = server }, .fork, .xit, repo_opts, io, allocator, &fork_repo, evt.events_ref, &.{.{ │ │1005 .id = input.id, │ │1006 .timestamp = input.timestamp, │ │1007 .author = input.author, │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1013 if (fork_record.event.stage == .draft) { │ │1014 var published = fork_record.event; │ │1015 published.stage = .publish; │ │1016 - try evt.consume(.{ .server = .{ .users_dir = users_dir } }, .user, .xit, evt.user_repo_opts, io, allocator, &user_repo, evt.events_ref, &.{.{│ │1016 + try evt.consume(.{ .server = server }, .user, .xit, evt.user_repo_opts, io, allocator, &user_repo, evt.events_ref, &.{.{ │ │1017 .id = input.id, │ │1018 .timestamp = input.timestamp, │ │1019 .author = input.author, │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────╮ │1083 comptime repo_opts: rp.RepoOpts(.xit), │ │1084 io: std.Io, │ │1085 allocator: std.mem.Allocator, │ │1086 - users_dir: []const u8, │ │1086 + server: evt.Host.Server, │ │1087 target_repo: *rp.Repo(.xit, repo_opts),│ │1088 input: MergeInput, │ │1089 ) !void { │ ╰─────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1090 const patch_id = try evt.parseEventId(&input.id); │ │1091 - mergeInner(repo_opts, io, allocator, users_dir, target_repo, input, patch_id) catch |err| { │ │1091 + mergeInner(repo_opts, io, allocator, server, target_repo, input, patch_id) catch |err| { │ │1092 if (err == error.PatchDataUnavailable or err == error.PatchOutOfDate) { │ │1093 - refreshMergeability(repo_opts, io, allocator, target_repo, users_dir, patch_id); │ │1093 + refreshMergeability(repo_opts, io, allocator, target_repo, server.users_dir, patch_id);│ │1094 } │ │1095 return err; │ │1096 }; │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────╮ │1100 comptime repo_opts: rp.RepoOpts(.xit), │ │1101 io: std.Io, │ │1102 allocator: std.mem.Allocator, │ │1103 - users_dir: []const u8, │ │1103 + server: evt.Host.Server, │ │1104 target_repo: *rp.Repo(.xit, repo_opts),│ │1105 input: MergeInput, │ │1106 patch_id: [evt.event_id_size]u8, │ ╰─────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1125 var config = try target_repo.listConfig(io, allocator); │ │1126 defer config.deinit(); │ │1127 const forker_id = (try fork.readForkerId(&config.sections, &patch_id)) orelse return error.PatchDataUnavailable; │ │1128 - const fork_path = try fork.forkPath(arena.allocator(), users_dir, &forker_id, &patch_id); │ │1128 + const fork_path = try fork.forkPath(arena.allocator(), server.users_dir, &forker_id, &patch_id); │ │1129 break :blk rp.Repo(.xit, repo_opts).open(io, allocator, .{ .path = fork_path, .require_repo_root = true }) catch return error.PatchDataUnavailable;│ │1130 }; │ │1131 defer if (fork_repo_maybe) |*repo| repo.deinit(io, allocator); │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯