╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ push.zig ─────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭ find file ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╮ ╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╮ │ │ │http│ ssh │ │ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╯ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╯
472 const selected = evt.Patch.Revision.fromRecord(revision_id, revision); 473 if (published_patch.event.revision) |current| { 474 if (evt.fieldEqual(evt.Patch.Revision, current, selected)) break :update; 475 } 476 var patch = published_patch.event; 477 patch.revision = selected; 478 evt.consume(.{ .server = server }, .repo, .xit, repo_opts, io, allocator, target_repo, evt.events_ref, &.{.{ 479 .id = id.*, 480 .timestamp = timestamp, 481 .author = author, 482 .event = .{ .patch = patch }, 483 }}) catch |update_err| { 484 serve_common.logError(io, error_writer, "failed to update published patch {s}: {s}\n", .{ id, @errorName(update_err) }); 485 break :update; 486 }; 487 // consume also refreshed mergeability 488 refreshed = true; 489 } 490 491 if (!refreshed) pch.refreshMergeability(repo_opts, io, allocator, target_repo, server.users_dir, patch_id); 492 sideband.run(io, .{ .complete_one = .writing_patch }) catch {}; 493 sideband.run(io, .{ .end = .writing_patch }) catch {}; 494 495 // the client may read either repo as soon as it gets the final response. 496 try response.finish(writer, null); 497 } 498