From 5dc2c61f1df30d2dd84fbba6d0e8895a62c3b2b5 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 16 Nov 2026 23:46:16 -0300 Subject: Export a session to a file of its own, and import one export-session [S] FILE writes session S (this run's by default, committed first), with the marks and clips that point into it, as session 0 of a new database: written beside FILE, synced, renamed over it. import FILE appends each session of such a file to this database, from "import ", its marks and clips renamed NAME@ (cut to 32 bytes). The copy is value by value, the same few lines for both, over whatever a session holds; sessions lists where one came from. test-import records test/past.script's session, exports it, imports it into another database and replays it there: the mark it carries is the State half a second in exactly, and two seconds in is frame 120's. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- test/session_export.script | 3 +++ test/session_import.script | 13 +++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 test/session_export.script create mode 100644 test/session_import.script (limited to 'test') diff --git a/test/session_export.script b/test/session_export.script new file mode 100644 index 0000000..a90587e --- /dev/null +++ b/test/session_export.script @@ -0,0 +1,3 @@ +# test-import (see build.zig): session 0 of test/past.script's database, +# written to a file of its own, as a playtester would send it. +console export-session 0 {file} diff --git a/test/session_import.script b/test/session_import.script new file mode 100644 index 0000000..bcc3126 --- /dev/null +++ b/test/session_import.script @@ -0,0 +1,13 @@ +# test-import: the session test/session_export.script wrote, imported into +# another database as its session 1, plays there as it did where it was +# recorded: half a second in is the mark's State exactly (the mark came +# with it, renamed), two seconds in is frame 120's. +console import {file} +console sessions +expect-log import one.xitdb +console play session 1 +console seek 499 +expect-snapshot probe@one.xitdb +expect-no-log diverged +console play session 1 at 2 +expect updates 121 -- cgit v1.3