╭ changed ────╮ │src/event.zig│ ╰─────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────╮ │← previous│ ╰──────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │924 // associate this moment with the index it will first appear at in the │ │925 // haxy history list. this will be important later so we can truncate │ │926 // that list if the user ever rebases starting at this object id. │ │898 - try haxy_moment.put(hash.hashInt(repo_opts.hash, "moment-index"), .{ .uint = try haxy_history.count() - 1 });│ │927 + const moment_index = try haxy_history.count() - 1; │ │928 + try haxy_moment.put(hash.hashInt(repo_opts.hash, moment_index_key), .{ .uint = moment_index }); │ │929 │ │930 // consume the event unless it's a merge commit │ │931 if (parent_oids.len <= 1) { │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │940 if (!role.allows(std.meta.activeTag(event_with_id.event))) return error.EventKindNotAllowed; │ │941 │ │942 const current_event_id = try parseEventId(&event_with_id.id); │ │943 + │ │944 + // associate the transaction with the events it writes. this is │ │945 + // used by the undo tab to link the events that were affected │ │946 + // by a given transaction. │ │947 + { │ │948 + const sets = try DB.HashMap(.read_write).init(try haxy_moment.putCursor(hash.hashInt(repo_opts.hash, moment_index_to_event_id_set_key)));│ │949 + const ids = try DB.SortedSet(.read_write).init(try sets.putCursor(momentIndexKey(repo_opts.hash, moment_index))); │ │950 + try ids.put(&orderKeyDesc(event_order, &current_event_id)); │ │951 + } │ │952 │ │953 // wrap the payload into the record `consume` stores, with its │ │954 // commit-derived fields; on update, `consume` preserves the │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯