╭ changed ───╮ │src/fork.zig│ ╰────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │227 if (!std.mem.eql(u8, patch.author_email orelse "", author.email)) return error.PatchDataUnavailable;│ │228 if (patch.event.status == .merged) return error.PatchAlreadyMerged; │ │229 } │ │230 - const posted = target_patch != null; │ │230 + const published = target_patch != null; │ │231 const title = if (target_patch) |patch| patch.event.title else fork_patch.event.title; │ │232 │ │233 // resolve the target and the newest fork revision │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────╮ │249 writer: *std.Io.Writer, │ │250 patch_id: [evt.event_id_size * 2]u8, │ │251 patch: evt.Patch.Record, │ │252 - posted: bool, │ │252 + published: bool, │ │253 target_oid: [hash.hexLen(repo_opts.hash)]u8,│ │254 target_ref: []const u8, │ │255 title: []const u8, │ ╰─────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │288 var head_tree_oid: [hash.hexLen(repo_opts.hash)]u8 = undefined; │ │289 var tree_entries: [2]evt.EventTreeEntry = undefined; │ │290 if (existing_revision) |latest| { │ │291 - if (ctx.posted) ctx.revision_id_maybe.* = latest.id; │ │291 + if (ctx.published) ctx.revision_id_maybe.* = latest.id; │ │292 } else { │ │293 var base_object = try obj.Object(.xit, repo_opts).initCommit(state.readOnly(), ctx.io, ctx.allocator, &base_oid);│ │294 defer base_object.deinit(); │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────╮ │334 event_count += 1; │ │335 ctx.revision_id_maybe.* = revision_id;│ │336 │ │337 - if (!ctx.posted) { │ │337 + if (!ctx.published) { │ │338 var patch = ctx.patch.event; │ │339 patch.revision = .{ │ │340 .id = revision_hex, │ ╰───────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────╮ │352 } │ │353 } │ │354 │ │355 - // posted patches keep only revisions in the fork │ │356 - if (ctx.posted and !ctx.patch.removed) { │ │355 + // published patches keep only revisions in the fork│ │356 + if (ctx.published and !ctx.patch.removed) { │ │357 events[event_count] = .{ │ │358 .id = ctx.patch_id, │ │359 .timestamp = ctx.timestamp, │ ╰─────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────╮ │385 .writer = writer, │ │386 .patch_id = id.*, │ │387 .patch = fork_patch, │ │388 - .posted = posted, │ │388 + .published = published, │ │389 .target_oid = target_oid,│ │390 .target_ref = target_ref,│ │391 .title = title, │ ╰──────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────╮ │400 try writer.flush(); │ │401 } │ │402 │ │403 - // best-effort update the posted patch so it has the new revision │ │403 + // best-effort update the published patch so it has the new revision │ │404 { │ │405 const revision_id = revision_id_maybe orelse return; │ │406 - if (!posted) return; │ │406 + if (!published) return; │ │407 var update_arena = std.heap.ArenaAllocator.init(allocator); │ │408 defer update_arena.deinit(); │ │409 const target_update_moment = evt.currentMoment(repo_opts, target_repo) catch return;│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │410 - const posted_patch = (evt.Patch.readById(evt.EventDB(repo_opts.hash), repo_opts.hash, target_update_moment, &update_arena, &patch_id) catch return) orelse return; │ │411 - if (posted_patch.removed) return; │ │410 + const published_patch = (evt.Patch.readById(evt.EventDB(repo_opts.hash), repo_opts.hash, target_update_moment, &update_arena, &patch_id) catch return) orelse return;│ │411 + if (published_patch.removed) return; │ │412 const fork_update_moment = evt.currentMoment(repo_opts, fork_repo) catch return; │ │413 const revision = (evt.PatchRev.readById(evt.EventDB(repo_opts.hash), repo_opts.hash, fork_update_moment, &update_arena, &revision_id) catch return) orelse return; │ │414 if (revision.removed) return; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────╮ │415 const selected = evt.Patch.Revision.fromRecord(revision_id, revision); │ │416 - if (posted_patch.event.revision) |current| { │ │416 + if (published_patch.event.revision) |current| { │ │417 if (evt.fieldEqual(evt.Patch.Revision, current, selected)) return; │ │418 } │ │419 - var patch = posted_patch.event; │ │419 + var patch = published_patch.event; │ │420 patch.revision = selected; │ │421 evt.consume(.repo, .xit, repo_opts, io, allocator, target_repo, evt.events_ref, &.{.{│ │422 .id = id.*, │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │424 .author = author, │ │425 .event = .{ .patch = patch }, │ │426 }}) catch |update_err| { │ │427 - serve_common.logError(io, error_writer, "failed to update posted patch {s}: {s}\n", .{ id, @errorName(update_err) }); │ │427 + serve_common.logError(io, error_writer, "failed to update published patch {s}: {s}\n", .{ id, @errorName(update_err) });│ │428 }; │ │429 } │ │430 } │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯