╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ push.zig ─────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
410 const revision = (evt.PatchRev.readById(evt.EventDB(repo_opts.hash), repo_opts.hash, fork_update_moment, &update_arena, &revision_id) catch break :update) orelse break :update; 411 if (revision.removed) break :update; 412 const selected = evt.Patch.Revision.fromRecord(revision_id, revision); 413 if (published_patch.event.revision) |current| { 414 if (evt.fieldEqual(evt.Patch.Revision, current, selected)) break :update; 415 } 416 var patch = published_patch.event; 417 patch.revision = selected; 418 evt.consume(.server, .repo, .xit, repo_opts, io, allocator, target_repo, evt.events_ref, &.{.{ 419 .id = id.*, 420 .timestamp = timestamp, 421 .author = author, 422 .event = .{ .patch = patch }, 423 }}) catch |update_err| { 424 serve_common.logError(io, error_writer, "failed to update published patch {s}: {s}\n", .{ id, @errorName(update_err) }); 425 break :update; 426 }; 427 // consume also refreshed mergeability 428 refreshed = true; 429 } 430 431 if (!refreshed) pch.refreshMergeability(repo_opts, io, allocator, target_repo, patch_id); 432 sideband.run(io, .{ .complete_one = .writing_patch }) catch {}; 433 sideband.run(io, .{ .end = .writing_patch }) catch {}; 434 435 // the client may read either repo as soon as it gets the final response. 436 try response.finish(writer, null); 437 } 438