╭ changed ───────────────╮ │src/test/event/patch.zig│ ╰────────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────╮ │← previous│ ╰──────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │748 // merge the selected revision into the target │ │749 // │ │750 │ │751 - try evt.Patch.update(.xit, repo_opts, io, allocator, &target, &patch_id, .{ .status = .closed }, author); │ │751 + try evt.Patch.update(.local, .xit, repo_opts, io, allocator, &target, &patch_id, .{ .status = .closed }, author);│ │752 try std.testing.expectError(error.PatchClosed, pch.merge(repo_opts, io, allocator, repos_dir, &target, .{ │ │753 .id = patch_id_hex, │ │754 .revision = merge_revision, │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │755 .author = author, │ │756 .timestamp = 5, │ │757 })); │ │758 - try evt.Patch.update(.xit, repo_opts, io, allocator, &target, &patch_id, .{ .status = .open }, author); │ │758 + try evt.Patch.update(.local, .xit, repo_opts, io, allocator, &target, &patch_id, .{ .status = .open }, author);│ │759 │ │760 // run the cache scenario once; both lifecycle runs still perform a merge │ │761 if (merge_revision == .source) { │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │864 const state = Repo.State(.read_only){ .core = &target.core, .extra = .{ .moment = &moment } }; │ │865 try std.testing.expectError(error.ObjectNotFound, obj.Object(.xit, repo_opts).initCommit(state, io, allocator, source));│ │866 } │ │867 - const events_before = try target.readRef(io, evt.events_ref); │ │867 │ │868 // a target update invalidates the old result before refresh │ │869 { │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │879 try std.testing.expectEqualDeep(pch.Mergeability{}, try readMergeability(target, io, allocator, id, patch)); │ │880 try std.testing.expectError(error.MergeCheckUnavailable, pch.merge(repo_opts, io, allocator, repos_dir, target, input)); │ │881 try std.testing.expectError(error.MergeCheckUnavailable, pch.merge(repo_opts, io, allocator, repos_dir, target, squash_input)); │ │883 - pch.refreshMergeability(repo_opts, io, allocator, target, null); │ │882 + │ │883 + // local edits and server comments leave checks alone │ │884 + var edit = evt.Patch.Update{ .fields = .{ │ │885 + .title = "edit the answer", │ │886 + .tags = patch.tags, │ │887 + .description = patch.description, │ │888 + .target_branch = patch.target_branch, │ │889 + } }; │ │890 + try evt.Patch.update(.local, .xit, repo_opts, io, allocator, target, id, edit, author); │ │891 + try std.testing.expectEqualDeep(pch.Mergeability{}, try readMergeability(target, io, allocator, id, patch)); │ │892 + _ = try evt.Comment.create(.server, .xit, repo_opts, io, allocator, target, &input.id, &input.id, "reviewing the answer", author); │ │893 + try std.testing.expectEqualDeep(pch.Mergeability{}, try readMergeability(target, io, allocator, id, patch)); │ │894 + │ │895 + // a server patch edit refreshes its mergeability │ │896 + edit.fields.title = patch.title; │ │897 + try evt.Patch.update(.server, .xit, repo_opts, io, allocator, target, id, edit, author); │ │898 + const events_before = try target.readRef(io, evt.events_ref); │ │899 try std.testing.expectEqualDeep(pch.Mergeability{ .source = .conflict, .squash = .conflict }, try readMergeability(target, io, allocator, id, patch));│ │900 try expectMergeabilityShortBytes(try target.core.latestMoment(), id); │ │901 try std.testing.expectError(error.MergeConflict, pch.merge(repo_opts, io, allocator, repos_dir, target, input)); │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │929 { │ │930 try std.Io.Dir.renameAbsolute(draft_path, away_path, io); │ │931 defer std.Io.Dir.renameAbsolute(away_path, draft_path, io) catch {}; │ │917 - pch.refreshMergeability(repo_opts, io, allocator, target, id.*); │ │932 + try std.testing.expectError(error.PatchDataUnavailable, pch.merge(repo_opts, io, allocator, repos_dir, target, input));│ │933 try std.testing.expectEqualDeep(pch.Mergeability{}, try readMergeability(target, io, allocator, id, patch)); │ │934 try std.testing.expectEqual(events_before, try target.readRef(io, evt.events_ref)); │ │935 } │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯