╭ changed ──╮ │src/try.zig│ ╰───────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │229 }; │ │230 } │ │231 // commit the seed events and consume them into the database │ │232 - try evt.consume(.server, .admin, .xit, evt.admin_repo_opts, io, allocator, &repo, evt.events_ref, &events_to_consume); │ │232 + const users_dir = try std.fs.path.join(arena.allocator(), &.{ server_path, "users" }); │ │233 + try evt.consume(.{ .server = .{ .users_dir = users_dir } }, .admin, .xit, evt.admin_repo_opts, io, allocator, &repo, evt.events_ref, &events_to_consume);│ │234 │ │235 // admin co-owns every repo, so it has full privileges everywhere │ │236 // (including undo) while the other users only own their own │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────╮ │254 } │ │255 │ │256 // each user's repo holds the repos they own │ │256 - const users_dir = try std.fs.path.join(arena.allocator(), &.{ server_path, "users" }); │ │257 for (user_ids, 0..) |user_id, user_index| { │ │258 const user_repo_path = try evt.userRepoPath(arena.allocator(), users_dir, &user_id);│ │259 var user_repo = try evt.initUserRepo(io, allocator, user_repo_path); │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │262 for (repo_data, repo_events) |r, event| { │ │263 if (r.user_index == user_index) try owned.append(arena.allocator(), event); │ │264 } │ │265 - if (owned.items.len > 0) try evt.consume(.server, .user, .xit, evt.user_repo_opts, io, allocator, &user_repo, evt.events_ref, owned.items); │ │265 + if (owned.items.len > 0) try evt.consume(.{ .server = .{ .users_dir = users_dir } }, .user, .xit, evt.user_repo_opts, io, allocator, &user_repo, evt.events_ref, owned.items);│ │266 } │ │267 │ │268 // every repo gets the same generated history, so build it once into a │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1115 .{ .tree = .{ .name = "base", .oid = &base_tree_oid } }, │ │1116 .{ .tree = .{ .name = "head", .oid = &head_tree_oid } }, │ │1117 }; │ │1118 - try evt.consume(.server, .fork, .xit, .{}, io, allocator, &fork_repo, evt.events_ref, &.{.{ │ │1118 + try evt.consume(.{ .server = .{ .users_dir = users_dir } }, .fork, .xit, .{}, io, allocator, &fork_repo, evt.events_ref, &.{.{│ │1119 .id = std.fmt.bytesToHex(revision_id, .lower), │ │1120 .timestamp = revision_timestamp, │ │1121 .author = author, │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1130 const patch_record = (try evt.Patch.readById(evt.EventDB(.sha1), .sha1, moment, &arena, patch_id)) orelse return error.NotFound;│ │1131 var patch = patch_record.event; │ │1132 patch.revision = evt.Patch.Revision.fromRecord(revision_id, revision_record); │ │1133 - try evt.consume(.server, .fork, .xit, .{}, io, allocator, &fork_repo, evt.events_ref, &.{.{ │ │1133 + try evt.consume(.{ .server = .{ .users_dir = users_dir } }, .fork, .xit, .{}, io, allocator, &fork_repo, evt.events_ref, &.{.{ │ │1134 .id = patch_hex, │ │1135 .timestamp = revision_timestamp + 1, │ │1136 .author = author, │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1272 .timestamp = timestamp + 7, │ │1273 }); │ │1274 } else if (status != .open) { │ │1275 - try evt.Patch.update(.server, .xit, .{}, io, allocator, target_repo, &patch_ids[i], .{ .status = status }, patch_author); │ │1275 + try evt.Patch.update(.{ .server = .{ .users_dir = users_dir } }, .xit, .{}, io, allocator, target_repo, &patch_ids[i], .{ .status = status }, patch_author);│ │1276 } │ │1277 } │ │1278 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1304 } }, │ │1305 }; │ │1306 } │ │1307 - try evt.consume(.server, .repo, .xit, .{}, io, allocator, target_repo, evt.events_ref, &comments); │ │1307 + try evt.consume(.{ .server = .{ .users_dir = users_dir } }, .repo, .xit, .{}, io, allocator, target_repo, evt.events_ref, &comments);│ │1308 │ │1309 // create divergent metadata edits on the next three patches │ │1310 var patch_arena = std.heap.ArenaAllocator.init(allocator); │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1364 theirs[2].author = .{ .name = "bob", .email = "bob@example.test" }; │ │1365 theirs[2].event.patch = theirs_values[2]; │ │1366 │ │1367 - try evt.consume(.server, .repo, .xit, .{}, io, allocator, target_repo, evt.events_ref, &ours); │ │1367 + try evt.consume(.{ .server = .{ .users_dir = users_dir } }, .repo, .xit, .{}, io, allocator, target_repo, evt.events_ref, &ours); │ │1368 try commitEventsAtRef(io, allocator, target_repo, other_ref, &theirs, seed_tip); │ │1369 { │ │1370 var merge = try target_repo.mergeAtRef(io, allocator, .{ .kind = .full, .action = .{ .new = .{ .source = &.{.{ .ref = other_ref }} } } }, evt.events_ref, null);│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1372 if (merge.result != .success) return error.MergeFailed; │ │1373 } │ │1374 try target_repo.removeBranch(io, .{ .name = other_ref.name }); │ │1375 - try evt.consume(.server, .repo, .xit, .{}, io, allocator, target_repo, evt.events_ref, &.{}); │ │1376 - try pch.writeBranchPatch(.server, .xit, .{}, io, allocator, target_repo, std.fmt.bytesToHex(evt.EventWithId.randomId(random), .lower), .{ │ │1375 + try evt.consume(.{ .server = .{ .users_dir = users_dir } }, .repo, .xit, .{}, io, allocator, target_repo, evt.events_ref, &.{}); │ │1376 + try pch.writeBranchPatch(.{ .server = .{ .users_dir = users_dir } }, .xit, .{}, io, allocator, target_repo, std.fmt.bytesToHex(evt.EventWithId.randomId(random), .lower), .{│ │1377 .title = "Merge the existing feature branch", │ │1378 .description = "This patch tracks the feature branch in this repo without creating a fork.", │ │1379 .labels = "feature", │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1383 │ │1384 // a push onto the branch that patch tracks, so the undo tab shows the │ │1385 // action and the patch refresh it sets off │ │1386 - try seedPush(io, allocator, target_repo, patch_author); │ │1387 - try pch.refreshBranches(.server, .xit, .{}, io, allocator, target_repo, null, null); │ │1386 + try seedPush(io, allocator, target_repo, users_dir, patch_author); │ │1387 + try pch.refreshBranches(.{ .server = .{ .users_dir = users_dir } }, .xit, .{}, io, allocator, target_repo, null, null);│ │1388 } │ │1389 │ │1390 // stand in for a client push, which the fixture has no server to receive: one │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯