╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ──╮ │src/try.zig│ ╰───────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1197 try fork_repo.patchAll(io, allocator, null); │ │1198 try fork_repo.addConfig(io, allocator, .{ .name = "core.bare", .value = "true" }); │ │1199 try transaction(io, &fork_repo, Reindex{ .io = io, .allocator = allocator, .core = &fork_repo.core, .commits = false });│ │1200 - _ = try fork_repo.garbageCollect(io, allocator, .{}); │ │1200 + _ = try fork_repo.garbageCollect(io, allocator, .{}, null); │ │1201 try fork_dir.deleteFile(io, path); │ │1202 const revision_id = evt.EventWithId.randomId(random); │ │1203 const head_tree_oid = try commitTree(io, allocator, &fork_repo, &source_oid); │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─╮ │src/ui.zig│ ╰──────────╯ ╭────────────────────────────────────────────────────────────────────────────────╮ │435 pub const RepoUndoRoute = struct { │ │436 name: Array(repo_identity_max_len), │ │437 index: ?u64 = null, │ │438 - // the clear-history confirmation page, which has no selected entry│ │439 - clear: bool = false, │ │438 }; │ │439 │ │440 pub const RepoMembersRoute = struct { │ ╰────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │468 return .{ .repo_undo = .{ .name = Array(repo_identity_max_len).from(identity) orelse return null, .index = index } };│ │469 } │ │470 │ │473 - pub fn repoUndoClearRoute(identity: []const u8) ?RoutablePage { │ │474 - return .{ .repo_undo = .{ .name = Array(repo_identity_max_len).from(identity) orelse return null, .clear = true } }; │ │475 - } │ │476 - │ │471 pub const RepoEventsRoute = struct { │ │472 name: Array(repo_identity_max_len), │ │473 view: EventsView = .active, │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────╮ │1257 }, │ │1258 .repo_undo => |u| blk: { │ │1259 const prefix = try repoUrlPrefix(arena, u.name.slice()); │ │1266 - break :blk if (u.clear) │ │1267 - try arena.allocator().print("{s}/undo/clear", .{prefix}) │ │1268 - else if (u.index) |index| │ │1260 + break :blk if (u.index) |index| │ │1261 try arena.allocator().print("{s}/undo/{d}", .{ prefix, index })│ │1262 else │ │1263 try arena.allocator().print("{s}/undo", .{prefix}); │ ╰─────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────╮ │1782 const word = segments.next(); │ │1783 if (segments.next() != null) return null; │ │1784 const value = word orelse return repoUndoRoute(pair, null); │ │1793 - if (std.mem.eql(u8, value, "clear")) return repoUndoClearRoute(pair); │ │1785 return repoUndoRoute(pair, std.fmt.parseInt(u64, value, 10) catch return null);│ │1786 } │ │1787 if (std.mem.eql(u8, tab, "events")) { │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1921 a_p.comments_start == b.repo_patches.comments_start and │ │1922 std.mem.eql(u8, a_p.comment.slice(), b.repo_patches.comment.slice()), │ │1923 .repo_undo => |a_u| std.mem.eql(u8, a_u.name.slice(), b.repo_undo.name.slice()) and │ │1933 - a_u.index == b.repo_undo.index and │ │1934 - a_u.clear == b.repo_undo.clear, │ │1924 + a_u.index == b.repo_undo.index, │ │1925 .repo_events => |a_e| std.mem.eql(u8, a_e.name.slice(), b.repo_events.name.slice()) and│ │1926 a_e.view == b.repo_events.view and │ │1927 a_e.moment == b.repo_events.moment and │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ──────╮ │src/ui/Repo.zig│ ╰───────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────╮ │294 }; │ │295 if (route_thread_kind) |kind| if (repo.event.threadRole(kind) == null) return error.NotFound;│ │296 const undo_index = if (route == .repo_undo) route.repo_undo.index else null; │ │297 - const undo_clear = route == .repo_undo and route.repo_undo.clear; │ │298 - // only xit repos have undo history, so it's read in their branch below │ │297 + // only xit repos have undo history, so it's read in their branch below. │ │298 + // local mode leaves undo to xit itself. │ │299 var undo_data: ?Undo = null; │ │300 // only the owner sees the settings, which show the repo's hash kind │ │301 var settings: ?Settings = null; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │337 }; │ │338 } │ │339 // tabs switch in-page, so every tab's data is read here │ │340 - if (repo_kind == .xit and handle.canWrite()) { │ │340 + if (repo_kind == .xit and session.data.host_kind == .server and handle.canWrite()) { │ │341 undo_data = Undo.init(opened.self_repo_opts, arena, opened, session.haxy_moment, repo_identity.identity, undo_index, handle) catch |err| switch (err) {│ │342 error.OutOfMemory => return err, │ │343 else => .{ .identity = try arena.allocator().dupe(u8, repo_identity.identity), .handle = handle, .failure = @errorName(err) }, │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │398 }; │ │399 if (route == .repo_undo and undo_data == null) return error.NotFound; │ │400 if ((route == .repo_settings or route == .repo_members or route == .repo_branches) and settings == null) return error.NotFound;│ │401 - if (undo_data) |*undo| undo.clear = undo_clear; │ │401 discussions.repo_source = source; │ │402 issues.repo_source = source; │ │403 patches.repo_source = source; │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ───────────╮ │src/ui/Repo/Undo.zig│ ╰────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │45 next: ?u64 = null, │ │46 failure: ?[]const u8 = null, │ │47 handle: ui.RepoHandle, │ │48 -// the clear-history confirmation stands in for the list │ │49 -clear: bool = false, │ │48 │ │51 -// no history and no failure outside the clear form, which shows the empty message │ │49 +// no history and no failure, which shows the empty message │ │50 fn isEmpty(self: *const Self, session: *ui.Session) bool { │ │53 - return !self.clear and self.items.len == 0 and (session.data.undo_failure orelse self.failure) == null; │ │51 + return self.items.len == 0 and (session.data.undo_failure orelse self.failure) == null; │ │52 } │ │53 │ │54 pub fn init(comptime opts: rp.RepoOpts(.xit), arena: *std.heap.ArenaAllocator, repo: *rp.Repo(.xit, opts), haxy_moment: ?evt.AdminDB.HashMap(.read_only), identity: []const u8, selected: ?u64, handle: ui.RepoHandle) !Self {│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯