╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ───╮ │src/push.zig│ ╰────────────╯ ╭─────────────────────────────────────────────────────────────────────╮ │33 .end => |kind| { │ │34 if (kind != .writing_patch) return; │ │35 }, │ │36 + // each phase names itself before reporting its count│ │37 + .text => |text| { │ │38 + self.label = text; │ │39 + return; │ │40 + }, │ │41 else => return, │ │42 } │ │43 if (self.total == 0) return; │ ╰─────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────╮ │119 │ │120 var updates = xit.net_server_receive_pack.AppliedRefUpdates.init(allocator);│ │121 defer updates.deinit(); │ │122 + │ │123 + var progress = PushProgress{ .response = &response, .writer = writer }; │ │124 const Ctx = struct { │ │125 updates: *xit.net_server_receive_pack.AppliedRefUpdates, │ │126 core: *rp.Repo(.xit, repo_opts).Core, │ ╰─────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────╮ │133 response: *xit.net_server_receive_pack.Response, │ │134 repo_root_path: []const u8, │ │135 error_writer: *std.Io.Writer, │ │136 + progress: *PushProgress, │ │137 │ │138 pub fn run(ctx: @This(), cursor: *DB.Cursor(.read_write)) !void {│ │139 var moment = try DB.HashMap(.read_write).init(cursor.*); │ ╰──────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │153 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);│ │154 │ │155 // the revisions the pushed branches cause belong to the push │ │148 - _ = try pch.refreshBranchesInTransaction(.server, repo_opts, state, &moment, ctx.io, ctx.allocator, ctx.updates.items.items, null); │ │156 + _ = try pch.refreshBranchesInTransaction(.server, repo_opts, state, &moment, ctx.io, ctx.allocator, ctx.updates.items.items, null, ctx.progress); │ │157 } │ │158 try writeUndo(repo_opts, state, ctx.io, ctx.allocator, ctx.author); │ │159 } │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────╮ │178 .response = &response, │ │179 .repo_root_path = repo_root_path,│ │180 .error_writer = error_writer, │ │181 + .progress = &progress, │ │182 }, │ │183 ); │ │184 }; │ ╰──────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │188 return err; │ │189 }; │ │190 │ │182 - var progress = PushProgress{ .response = &response, .writer = writer, .label = "Updating patches" }; │ │191 pch.refreshBranches(.server, .xit, repo_opts, io, allocator, repo, updates.items.items, &progress) catch |err| {│ │192 serve_common.logError(io, error_writer, "failed to refresh branch patches: {s}\n", .{@errorName(err)}); │ │185 - pch.refreshOpenMergeability(repo_opts, io, allocator, repo, null); │ │193 + pch.refreshOpenMergeability(repo_opts, io, allocator, repo, null, &progress); │ │194 }; │ │195 find.refresh(repo_opts, io, allocator, repo) catch |err| { │ │196 serve_common.logError(io, error_writer, "failed to refresh file index: {s}\n", .{@errorName(err)}); │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ───────────────╮ │src/test/event/patch.zig│ ╰────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │199 response.sideband = true; │ │200 var output = std.Io.Writer.Allocating.init(allocator); │ │201 defer output.deinit(); │ │202 - var progress = push.PushProgress{ .response = &response, .writer = &output.writer, .label = "Updating patches" };│ │202 + var progress = push.PushProgress{ .response = &response, .writer = &output.writer }; │ │203 const before_refresh = try repo.core.db.rootCursor().count(); │ │204 try pch.refreshBranches(.server, .xit, opts, io, allocator, &repo, null, &progress); │ │205 try std.testing.expectEqual(before_refresh + 1, try repo.core.db.rootCursor().count()); │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │206 - try std.testing.expect(std.mem.indexOf(u8, output.written(), "Updating patches: 100% (1/1)\n") != null); │ │206 + try std.testing.expect(std.mem.indexOf(u8, output.written(), "Checking mergeability: 100% (1/1)\n") != null);│ │207 │ │208 // closed patches skip source updates and contribute no progress │ │209 try evt.Patch.update(.server, .xit, opts, io, allocator, &repo, &id, .{ .status = .closed }, author); │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1243 defer detached.deinit(); │ │1244 } │ │1245 try target.removeBranch(io, .{ .name = "master" }); │ │1246 - pch.refreshOpenMergeability(repo_opts, io, allocator, target, null); │ │1246 + pch.refreshOpenMergeability(repo_opts, io, allocator, target, null, null); │ │1247 try std.testing.expectEqualDeep(pch.Mergeability{}, try readMergeability(target, io, allocator, id, patch));│ │1248 try expectMergeabilityShortBytes(try target.core.latestMoment(), id); │ │1249 try target.addBranch(io, .{ .name = "master" }); │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1251 var restored = try target.switchDir(io, allocator, .{ .target = .{ .ref = .{ .kind = .head, .name = "master" } } });│ │1252 defer restored.deinit(); │ │1253 } │ │1254 - pch.refreshOpenMergeability(repo_opts, io, allocator, target, null); │ │1254 + pch.refreshOpenMergeability(repo_opts, io, allocator, target, null, null); │ │1255 try std.testing.expectEqualDeep(clean, try readMergeability(target, io, allocator, id, patch)); │ │1256 │ │1257 // a missing fork disables merging without changing the accepted events │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯