╭ changed ───────────────╮ │src/test/event/patch.zig│ ╰────────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │970 } │ │971 try std.testing.expectError(error.NotFound, evt.currentMoment(repo_opts, &target)); │ │972 │ │973 + // draft mergeability checks leave the target repo untouched │ │974 + const before_draft_check = (try target.core.latestMoment()).cursor.slot(); │ │975 + pch.refreshMergeability(repo_opts, io, allocator, &target, patch_id); │ │976 + try std.testing.expectEqualDeep(before_draft_check, (try target.core.latestMoment()).cursor.slot());│ │977 + │ │978 // │ │979 // publish another draft before its first push │ │980 // │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1093 // merge the selected revision into the target │ │1094 // │ │1095 │ │1091 - try evt.Patch.update(.local, .xit, repo_opts, io, allocator, &target, &patch_id, .{ .status = .closed }, author); │ │1096 + try evt.Patch.update(.server, .xit, repo_opts, io, allocator, &target, &patch_id, .{ .status = .closed }, author);│ │1097 try std.testing.expectError(error.PatchClosed, pch.merge(repo_opts, io, allocator, repos_dir, &target, .{ │ │1098 .id = patch_id_hex, │ │1099 .revision = merge_revision, │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1100 .author = author, │ │1101 .timestamp = 5, │ │1102 })); │ │1098 - try evt.Patch.update(.local, .xit, repo_opts, io, allocator, &target, &patch_id, .{ .status = .open }, author); │ │1103 + try evt.Patch.update(.server, .xit, repo_opts, io, allocator, &target, &patch_id, .{ .status = .open }, author);│ │1104 │ │1105 // run the cache scenario once; both lifecycle runs still perform a merge │ │1106 if (merge_revision == .source) { │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1177 } │ │1178 │ │1179 fn expectMergeabilityShortBytes(moment: Repo.DB.HashMap(.read_only), id: *const [evt.event_id_size]u8) !void { │ │1175 - const checks = try Repo.DB.HashMap(.read_only).init((try moment.getCursor(hash.hashInt(repo_opts.hash, "patch-id->mergeability"))) orelse return error.NotFound); │ │1180 + try std.testing.expectEqual(null, try moment.getCursor(hash.hashInt(repo_opts.hash, evt.Patch.patch_id_to_mergeability_key))); │ │1181 + const haxy_moment = try evt.currentMomentFromRepoMoment(repo_opts.hash, moment); │ │1182 + const checks = try Repo.DB.HashMap(.read_only).init((try haxy_moment.getCursor(hash.hashInt(repo_opts.hash, evt.Patch.patch_id_to_mergeability_key))) orelse return error.NotFound);│ │1183 const entry = try Repo.DB.HashMap(.read_only).init((try checks.getCursor(hash.hashInt(repo_opts.hash, id))) orelse return error.NotFound); │ │1184 const result = try Repo.DB.HashMap(.read_only).init((try entry.getCursor(hash.hashInt(repo_opts.hash, "result"))) orelse return error.NotFound); │ │1185 for ([_][]const u8{ "source", "squash" }) |field| { │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯