╭ changed ───╮ │src/push.zig│ ╰────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭─────────────────────────────────────────────────────────────────────────────╮ │12 const fork = @import("fork.zig"); │ │13 const serve_common = @import("serve_common.zig"); │ │14 const ssh = @import("serve_ssh_protocol.zig"); │ │15 +const progress = @import("./progress.zig"); │ │16 │ │17 // prepare all reachable commits, including history received before patch│ │18 // generation was enabled. this shares the receive-pack transaction. │ ╰─────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────╮ │37 try iter.include(&oid); │ │38 } │ │39 } │ │39 - var progress = serve_common.SidebandProgress{ .response = response, .writer = writer };│ │40 - try xit.patch.writePatches(repo_opts, state, io, allocator, &iter, &progress); │ │40 + var sideband = progress.Sideband{ .response = response, .writer = writer }; │ │41 + try xit.patch.writePatches(repo_opts, state, io, allocator, &iter, &sideband); │ │42 } │ │43 │ │44 // the action a received push records │ ╰───────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │133 var updates = xit.net_server_receive_pack.AppliedRefUpdates.init(allocator); │ │134 defer updates.deinit(); │ │135 │ │135 - var progress = serve_common.SidebandProgress{ .response = &response, .writer = writer, .sess = sess };│ │136 + var sideband = progress.Sideband{ .response = &response, .writer = writer, .sess = sess }; │ │137 const Ctx = struct { │ │138 updates: *xit.net_server_receive_pack.AppliedRefUpdates, │ │139 core: *rp.Repo(.xit, repo_opts).Core, │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────╮ │146 response: *xit.net_server_receive_pack.Response, │ │147 repo_root_path: []const u8, │ │148 error_writer: *std.Io.Writer, │ │148 - progress: *serve_common.SidebandProgress, │ │149 + sideband: *progress.Sideband, │ │150 │ │151 pub fn run(ctx: @This(), cursor: *DB.Cursor(.read_write)) !void {│ │152 var moment = try DB.HashMap(.read_write).init(cursor.*); │ ╰──────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │155 var receive_options = ctx.options; │ │156 receive_options.applied_ref_updates = ctx.updates; │ │157 receive_options.deferred_response = ctx.response; │ │157 - try xit.net_server_receive_pack.run(.xit, repo_opts, state, ctx.io, ctx.allocator, ctx.reader, ctx.writer, receive_options, ctx.progress);│ │158 + try xit.net_server_receive_pack.run(.xit, repo_opts, state, ctx.io, ctx.allocator, ctx.reader, ctx.writer, receive_options, ctx.sideband);│ │159 try writeReceivedPatches(repo_opts, state, ctx.io, ctx.allocator, ctx.response, ctx.writer); │ │159 - if (ctx.progress.gone) return error.ClientGone; │ │160 + if (ctx.sideband.gone) return error.ClientGone; │ │161 │ │162 // a repo without an events branch has no events to consume. a │ │163 // no-op consume must not cancel here, since the push shares the │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │167 try pch.detectMerged(repo_opts, state, &ctx.core.db, &moment, ctx.io, ctx.allocator, ctx.repo_root_path, ctx.updates.items.items, ctx.error_writer);│ │168 │ │169 // the revisions the pushed branches cause belong to the push │ │169 - _ = try pch.refreshBranchesInTransaction(.server, repo_opts, state, &moment, ctx.io, ctx.allocator, ctx.updates.items.items, null, ctx.progress); │ │170 + _ = try pch.refreshBranchesInTransaction(.server, repo_opts, state, &moment, ctx.io, ctx.allocator, ctx.updates.items.items, null, ctx.sideband); │ │171 } │ │172 │ │172 - if (ctx.progress.gone) return error.ClientGone; │ │173 + if (ctx.sideband.gone) return error.ClientGone; │ │174 │ │175 // the indexes the pushed refs invalidate belong to the push too │ │175 - _ = try find.refreshInTransaction(repo_opts, state, &moment, ctx.io, ctx.allocator, ctx.progress); │ │176 - _ = try srch_cmmt.refreshInTransaction(repo_opts, state, &moment, ctx.io, ctx.allocator, ctx.updates.items.items, ctx.progress); │ │176 + _ = try find.refreshInTransaction(repo_opts, state, &moment, ctx.io, ctx.allocator, ctx.sideband); │ │177 + _ = try srch_cmmt.refreshInTransaction(repo_opts, state, &moment, ctx.io, ctx.allocator, ctx.updates.items.items, ctx.sideband); │ │178 │ │179 try writeUndo(repo_opts, state, ctx.io, ctx.allocator, ctx.author, ctx.updates.items.items); │ │180 } │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────╮ │199 .response = &response, │ │200 .repo_root_path = repo_root_path,│ │201 .error_writer = error_writer, │ │201 - .progress = &progress, │ │202 + .sideband = &sideband, │ │203 }, │ │204 ); │ │205 }; │ ╰──────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │209 return err; │ │210 }; │ │211 │ │211 - pch.refreshBranches(.server, .xit, repo_opts, io, allocator, repo, updates.items.items, &progress) catch |err| {│ │212 + pch.refreshBranches(.server, .xit, repo_opts, io, allocator, repo, updates.items.items, &sideband) catch |err| {│ │213 serve_common.logError(io, error_writer, "failed to refresh branch patches: {s}\n", .{@errorName(err)}); │ │213 - pch.refreshOpenMergeability(repo_opts, io, allocator, repo, null, &progress); │ │214 + pch.refreshOpenMergeability(repo_opts, io, allocator, repo, null, &sideband); │ │215 }; │ │216 try response.finish(writer, null); │ │217 } │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │261 var revision_id_maybe: ?[evt.event_id_size]u8 = null; │ │262 var response = xit.net_server_receive_pack.Response.init(allocator); │ │263 defer response.deinit(); │ │263 - var progress = serve_common.SidebandProgress{ .response = &response, .writer = writer, .sess = sess };│ │264 + var sideband = progress.Sideband{ .response = &response, .writer = writer, .sess = sess }; │ │265 │ │266 // execute a transaction that receives the push and materializes its revision │ │267 const result = blk: { │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────╮ │284 timestamp: u64, │ │285 newest: ?evt.PatchRev.WithId, │ │286 revision_id_maybe: *?[evt.event_id_size]u8, │ │286 - progress: *serve_common.SidebandProgress, │ │287 + sideband: *progress.Sideband, │ │288 │ │289 pub fn run(ctx: @This(), cursor: *DB.Cursor(.read_write)) !void {│ │290 // receive the branch update │ ╰──────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯