╭ changed ───────────────╮ │src/test/event/patch.zig│ ╰────────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────╮ │← previous│ ╰──────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1082 // merge the selected revision into the target │ │1083 // │ │1084 │ │1085 - try evt.Patch.update(.server, .xit, repo_opts, io, allocator, &target, &patch_id, .{ .status = .closed }, author); │ │1085 + try evt.Patch.update(.{ .server = .{ .users_dir = users_dir } }, .xit, repo_opts, io, allocator, &target, &patch_id, .{ .status = .closed }, author);│ │1086 try std.testing.expectError(error.PatchClosed, pch.merge(repo_opts, io, allocator, users_dir, &target, .{ │ │1087 .id = patch_id_hex, │ │1088 .revision = merge_revision, │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1089 .author = author, │ │1090 .timestamp = 5, │ │1091 })); │ │1092 - try evt.Patch.update(.server, .xit, repo_opts, io, allocator, &target, &patch_id, .{ .status = .open }, author); │ │1092 + try evt.Patch.update(.{ .server = .{ .users_dir = users_dir } }, .xit, repo_opts, io, allocator, &target, &patch_id, .{ .status = .open }, author);│ │1093 │ │1094 // run the cache scenario once; both lifecycle runs still perform a merge │ │1095 if (merge_revision == .source) { │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1200 try std.testing.expectEqualDeep(clean, try readMergeability(target, io, allocator, id, patch));│ │1201 try expectMergeabilityShortBytes(try target.core.latestMoment(), id); │ │1202 const before = (try target.core.latestMoment()).cursor.slot(); │ │1203 - pch.refreshMergeability(repo_opts, io, allocator, target, id.*); │ │1203 + pch.refreshMergeability(repo_opts, io, allocator, target, users_dir, id.*); │ │1204 try std.testing.expectEqualDeep(before, (try target.core.latestMoment()).cursor.slot()); │ │1205 { │ │1206 var moment = try target.core.latestMoment(); │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1232 } }; │ │1233 try evt.Patch.update(.local, .xit, repo_opts, io, allocator, target, id, edit, author); │ │1234 try std.testing.expectEqualDeep(pch.Mergeability{}, try readMergeability(target, io, allocator, id, patch)); │ │1235 - _ = try evt.Comment.create(.server, .xit, repo_opts, io, allocator, target, &input.id, &input.id, "reviewing the answer", author); │ │1235 + _ = try evt.Comment.create(.{ .server = .{ .users_dir = users_dir } }, .xit, repo_opts, io, allocator, target, &input.id, &input.id, "reviewing the answer", author);│ │1236 try std.testing.expectEqualDeep(pch.Mergeability{}, try readMergeability(target, io, allocator, id, patch)); │ │1237 │ │1238 // a server patch edit refreshes its mergeability │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1239 edit.fields.title = patch.title; │ │1240 const before_edit = try target.core.db.rootCursor().count(); │ │1241 - try evt.Patch.update(.server, .xit, repo_opts, io, allocator, target, id, edit, author); │ │1241 + try evt.Patch.update(.{ .server = .{ .users_dir = users_dir } }, .xit, repo_opts, io, allocator, target, id, edit, author); │ │1242 try std.testing.expectEqual(before_edit + 1, try target.core.db.rootCursor().count()); │ │1243 const events_before = try target.readRef(io, evt.events_ref); │ │1244 try std.testing.expectEqualDeep(pch.Mergeability{ .source = .conflict, .squash = .conflict }, try readMergeability(target, io, allocator, id, patch));│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1255 defer detached.deinit(); │ │1256 } │ │1257 try target.removeBranch(io, .{ .name = "master" }); │ │1258 - pch.refreshOpenMergeability(repo_opts, io, allocator, target, null, null); │ │1258 + pch.refreshOpenMergeability(repo_opts, io, allocator, target, users_dir, null, null); │ │1259 try std.testing.expectEqualDeep(pch.Mergeability{}, try readMergeability(target, io, allocator, id, patch));│ │1260 try expectMergeabilityShortBytes(try target.core.latestMoment(), id); │ │1261 try target.addBranch(io, .{ .name = "master" }); │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1263 var restored = try target.switchDir(io, allocator, .{ .target = .{ .ref = .{ .kind = .head, .name = "master" } } });│ │1264 defer restored.deinit(); │ │1265 } │ │1266 - pch.refreshOpenMergeability(repo_opts, io, allocator, target, null, null); │ │1266 + pch.refreshOpenMergeability(repo_opts, io, allocator, target, users_dir, null, null); │ │1267 try std.testing.expectEqualDeep(clean, try readMergeability(target, io, allocator, id, patch)); │ │1268 │ │1269 // a missing fork disables merging without changing the accepted events │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1283 try std.testing.expectEqualDeep(pch.Mergeability{}, try readMergeability(target, io, allocator, id, patch));│ │1284 try std.testing.expectEqual(events_before, try target.readRef(io, evt.events_ref)); │ │1285 } │ │1286 - pch.refreshMergeability(repo_opts, io, allocator, target, id.*); │ │1286 + pch.refreshMergeability(repo_opts, io, allocator, target, users_dir, id.*); │ │1287 try std.testing.expectEqualDeep(clean, try readMergeability(target, io, allocator, id, patch)); │ │1288 │ │1289 // a changed revision is unknown even if its target has not moved │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯