╭ changed ────╮ │src/patch.zig│ ╰─────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │16 │ │17 // the action a mergeability recheck records │ │18 pub const mergeability_undo_action = "haxy/mergeability"; │ │19 - │ │20 -// progress is optional and best effort: a failed report must not fail a refresh │ │21 -fn reportProgress(comptime repo_opts: rp.RepoOpts(.xit), io: std.Io, progress_ctx_maybe: ?repo_opts.ProgressCtx, event: rp.ProgressEvent) void {│ │22 - if (repo_opts.ProgressCtx != void) { │ │23 - if (progress_ctx_maybe) |progress_ctx| progress_ctx.run(io, event) catch {}; │ │24 - } │ │25 -} │ │19 │ │20 // whether a push moved this branch │ │21 fn branchUpdated(updates: []const xit.net_server_receive_pack.AppliedRefUpdate, branch: []const u8) bool { │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │266 │ │267 const total = patches.count(); │ │268 if (total > 0) { │ │276 - reportProgress(repo_opts, io, progress_ctx_maybe, .{ .text = "Updating patches" }); │ │277 - reportProgress(repo_opts, io, progress_ctx_maybe, .{ .start = .{ .kind = .writing_patch, .estimated_total_items = total } }); │ │269 + serve_common.reportProgress(repo_opts, io, progress_ctx_maybe, .{ .text = "Updating patches" }); │ │270 + serve_common.reportProgress(repo_opts, io, progress_ctx_maybe, .{ .start = .{ .kind = .writing_patch, .estimated_total_items = total } });│ │271 } │ │272 │ │273 var refreshed = false; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │274 for (patches.keys(), patches.values()) |id, record| { │ │282 - defer reportProgress(repo_opts, io, progress_ctx_maybe, .{ .complete_one = .writing_patch }); │ │275 + defer serve_common.reportProgress(repo_opts, io, progress_ctx_maybe, .{ .complete_one = .writing_patch });│ │276 │ │277 // a branch patch opens no fork, so its checks need no lock of their own │ │278 var checks: MergeCheckInputs(repo_opts) = .{}; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │286 }; │ │287 refreshed = true; │ │288 } │ │296 - if (total > 0) reportProgress(repo_opts, io, progress_ctx_maybe, .{ .end = .writing_patch }); │ │289 + if (total > 0) serve_common.reportProgress(repo_opts, io, progress_ctx_maybe, .{ .end = .writing_patch });│ │290 return refreshed; │ │291 } │ │292 │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │544 } │ │545 │ │546 // start progress reporting after the patch count is known │ │554 - reportProgress(repo_opts, io, progress_ctx_maybe, .{ .text = "Checking mergeability" }); │ │555 - reportProgress(repo_opts, io, progress_ctx_maybe, .{ .start = .{ .kind = .writing_patch, .estimated_total_items = ids.items.len } }); │ │547 + serve_common.reportProgress(repo_opts, io, progress_ctx_maybe, .{ .text = "Checking mergeability" }); │ │548 + serve_common.reportProgress(repo_opts, io, progress_ctx_maybe, .{ .start = .{ .kind = .writing_patch, .estimated_total_items = ids.items.len } });│ │549 │ │550 // refresh each collected patch independently │ │551 for (ids.items) |id| { │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │552 refreshMergeability(repo_opts, io, allocator, target_repo, id); │ │560 - reportProgress(repo_opts, io, progress_ctx_maybe, .{ .complete_one = .writing_patch }); │ │553 + serve_common.reportProgress(repo_opts, io, progress_ctx_maybe, .{ .complete_one = .writing_patch });│ │554 } │ │555 │ │556 // finish progress reporting after all patches have been visited │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────╮ │564 - reportProgress(repo_opts, io, progress_ctx_maybe, .{ .end = .writing_patch }); │ │557 + serve_common.reportProgress(repo_opts, io, progress_ctx_maybe, .{ .end = .writing_patch });│ │558 } │ │559 │ │560 fn refreshMergeCheck( │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────╯