╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ──╮ │src/try.zig│ ╰───────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1391 // transaction moves the branch, refreshes the patches tracking it and records │ │1392 // the action, the way receive-pack does │ │1393 -fn seedPush(io: std.Io, allocator: std.mem.Allocator, repo: *rp.Repo(.xit, .{}), author: evt.CommitAuthor) !void { │ │1393 +fn seedPush(io: std.Io, allocator: std.mem.Allocator, repo: *rp.Repo(.xit, .{}), users_dir: []const u8, author: evt.CommitAuthor) !void {│ │1394 const Repo = rp.Repo(.xit, .{}); │ │1395 const DB = Repo.DB; │ │1396 const Ctx = struct { │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────╮ │1397 core: *Repo.Core, │ │1398 io: std.Io, │ │1399 allocator: std.mem.Allocator, │ │1400 + users_dir: []const u8, │ │1401 author: evt.CommitAuthor, │ │1402 │ │1403 pub fn run(ctx: @This(), cursor: *DB.Cursor(.read_write)) !void {│ ╰───────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1435 }, │ │1436 }; │ │1437 │ │1437 - _ = try pch.refreshBranchesInTransaction(.server, opts, state, &moment, ctx.io, ctx.allocator, &updates, null, null); │ │1438 + _ = try pch.refreshBranchesInTransaction(.{ .server = .{ .users_dir = ctx.users_dir } }, opts, state, &moment, ctx.io, ctx.allocator, &updates, null, null);│ │1439 try push.writeUndo(opts, state, ctx.io, ctx.allocator, ctx.author, &updates); │ │1440 } │ │1441 }; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1442 │ │1442 - try transaction(io, repo, Ctx{ .core = &repo.core, .io = io, .allocator = allocator, .author = author }); │ │1443 + try transaction(io, repo, Ctx{ .core = &repo.core, .io = io, .allocator = allocator, .users_dir = users_dir, .author = author });│ │1444 } │ │1445 │ │1446 // commit `events` onto `ref`, rooted at `parent`, as one transaction. │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─╮ │src/ui.zig│ ╰──────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │2288 return switch (try authorizeUser(io, moment, self.page_arena, users_dir, user_id, identity, min_role)) {│ │2289 .actor => |actor| actor, │ │2290 .login_required, .repo_not_found, .forbidden => null, │ │2291 + }; │ │2292 + } │ │2293 + │ │2294 + // where this session's event writes go. a server session always has a users dir │ │2295 + pub fn eventHost(self: *const Self) evt.Host { │ │2296 + return switch (self.data.host_kind) { │ │2297 + .local => .local, │ │2298 + .server => .{ .server = .{ .users_dir = self.users_dir orelse unreachable } }, │ │2299 }; │ │2300 } │ │2301 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │2331 self.apply(action); │ │2332 switch (action) { │ │2333 .toggle_ansi => if (self.data.user_id) |user_id| { │ │2326 - try evt.User.toggleAnsi(evt.admin_repo_opts, io, allocator, repo, user_id); │ │2334 + try evt.User.toggleAnsi(evt.admin_repo_opts, io, allocator, repo, self.users_dir orelse unreachable, user_id);│ │2335 }, │ │2336 } │ │2337 } │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──────────────╮ │src/ui/Repo/Patches.zig│ ╰───────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │341 var any_repo = try rp.AnyRepo(repo_kind, .{}).open(io, allocator, repo_source.localInitOpts()); │ │342 defer any_repo.deinit(io, allocator); │ │343 switch (any_repo) { │ │344 - inline else => |*repo| try pch.writeBranchPatch(session.data.host_kind, repo_kind, repo.self_repo_opts, io, allocator, repo, id, .{│ │344 + inline else => |*repo| try pch.writeBranchPatch(session.eventHost(), repo_kind, repo.self_repo_opts, io, allocator, repo, id, .{ │ │345 .title = title, │ │346 .labels = labels, │ │347 .description = description, │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ───────────────╮ │src/ui/widget/thread.zig│ ╰────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1364 var any_repo = try rp.AnyRepo(repo_kind, .{}).open(io, allocator, source.localInitOpts()); │ │1365 defer any_repo.deinit(io, allocator); │ │1366 switch (any_repo) { │ │1367 - inline else => |*repo| try evt.remove(self.session.data.host_kind, .repo, repo_kind, repo.self_repo_opts, io, allocator, repo, &id, event_kind, author),│ │1367 + inline else => |*repo| try evt.remove(self.session.eventHost(), .repo, repo_kind, repo.self_repo_opts, io, allocator, repo, &id, event_kind, author), │ │1368 } │ │1369 }, │ │1370 } │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1390 var any_repo = try rp.AnyRepo(repo_kind, .{}).open(io, allocator, source.localInitOpts()); │ │1391 defer any_repo.deinit(io, allocator); │ │1392 switch (any_repo) { │ │1393 - inline else => |*repo| try Event.update(self.session.data.host_kind, repo_kind, repo.self_repo_opts, io, allocator, repo, &id, .{ .status = status }, author),│ │1393 + inline else => |*repo| try Event.update(self.session.eventHost(), repo_kind, repo.self_repo_opts, io, allocator, repo, &id, .{ .status = status }, author), │ │1394 } │ │1395 }, │ │1396 } │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │2626 }; │ │2627 if (comptime @hasField(Event.Resolve, "theirs")) resolution.theirs = self.data.theirs_picks; │ │2628 const change = Event.Update{ .resolve = resolution }; │ │2629 - Event.update(self.session.data.host_kind, repo_kind, repo.self_repo_opts, io, allocator, repo, &id_bytes, change, author) catch |err| switch (err) {│ │2629 + Event.update(self.session.eventHost(), repo_kind, repo.self_repo_opts, io, allocator, repo, &id_bytes, change, author) catch |err| switch (err) { │ │2630 // leave the form up for correction │ │2631 error.InvalidFields => return, │ │2632 else => |e| return e, │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯