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