From f9ff1acdf7cebf417a3c74d53f8e2d67cfbdbcc2 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Sat, 21 Nov 2026 02:03:46 -0300 Subject: layers: a file at a revision: the address path@rev and path@rev:line, resolved by a Look anywhere (a file really named so wins; the path must be a file), and At in a file's pane, open the file as jj has it at that revision in a pane named path@rev, coloured as its file (File.langPath), read-only (File.edit refuses a key's splice, edit.zig a whole text's; a bare Save says so); At in such a pane turns it to another revision in its place, bare it goes back to the file; what jj says is the session machine's: core/jj.zig runs it as a site of the step's tape (Site.jj: jj --ignore-working-copy file show, in the file's directory, the name a literal fileset), on an io of its own (the tape's spawns nothing: its allocator fails), its answer recorded, a replica replaying it and never running jj; jj's refusals in its words (At: Revision `x` doesn't exist, No such path, no jj); tests in a jj repository made in the test's directory: At's open, the read-only edits, the Look at a line, the turn in place, the refusals, and a client that replays the open of path@rev:2 ends with the session's digest; tui core-test 879/1037 (158 skipped); the tip gated whole: core-test 880/1038, shell-test 1080/1083, pane-test 183/184, behaviour-test 275/275 and --replay, process-test 0 of 145 failed, term 17/17, kitty 45/45, addons 5/5, consumer-test, both soaks diverged 0, unequal 0, unlisted 0, corpus through a client 22 scenes, daemon.py far, games, window-clients, clients x5, relink, launch, pair, gui, and --clients x2 on ReleaseSafe, macOS and FreeBSD cross-builds; daemon.py plain on ReleaseSafe times out at pair rows as main itself does (2 of 2 on main) Co-Authored-By: Claude Opus Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- core/Output.zig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'core/Output.zig') diff --git a/core/Output.zig b/core/Output.zig index c7bfde14..09ec2a51 100644 --- a/core/Output.zig +++ b/core/Output.zig @@ -38,6 +38,8 @@ pub const Origin = union(enum) { /// A query pane's +Preview (Query.zig): a file's text shown, not yet /// its pane; Enter promotes it to one where it stands. preview, + /// A file at a revision (jj.zig), its arg the revision. + revision, }; /// An output's argument is typed in the bounded one-line tag storage. @@ -163,6 +165,7 @@ pub fn traits(o: Origin) Traits { .kind => .{ .name = "", .steps = true, .locations = true }, .unsaved => .{ .name = config.unsaved_buffer, .doc = true }, .preview => .{ .name = config.preview_buffer, .doc = true }, + .revision => .{ .name = "", .doc = true }, // Named for its directory, not a `+` name in it. .dir => .{ .name = "", .doc = true }, .cmd => |b| builtins.registry.outputTraits(b) orelse unreachable, @@ -264,7 +267,7 @@ fn sortResults(arena: std.mem.Allocator, from: Origin, content: []u8, anchor: ?u => {}, else => return anchor, }, - .errors, .kind, .unsaved, .dir, .preview => return anchor, + .errors, .kind, .unsaved, .dir, .preview, .revision => return anchor, } if (content.len == 0) return anchor; const trailing_newline = content[content.len - 1] == '\n'; -- cgit v1.3