╭ changed ─────────╮ │src/event/Repo.zig│ ╰──────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────╮ │← previous│ ╰──────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────╮ │117 - try evt.upsert(@This(), DB, hash_kind, repo, event_to_write); │ │111 + try evt.upsert(Record, DB, hash_kind, repo, record_to_write); │ │112 │ │113 try name_to_repo_id.put(hash.hashInt(hash_kind, repo_path), .{ .bytes = event_id });│ │114 │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │118 if (existing_cursor_maybe == null) { │ │119 const repo_id_set_cursor = try haxy_moment.putCursor(hash.hashInt(hash_kind, "repo-id-set"));│ │120 const repo_id_set = try DB.SortedSet(.read_write).init(repo_id_set_cursor); │ │127 - const order_key = evt.orderKeyDesc(event_to_write.created_ts, event_id); │ │121 + const order_key = evt.orderKeyDesc(record_to_write.created_ts, event_id); │ │122 try repo_id_set.put(&order_key); │ │123 } │ │124 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │125 // each user's repos are a set ordered by creation time (newest first), so │ │126 // the user page paginates them the same way the home repos list does. │ │133 - const user_repos_cursor = try user_id_to_repo_id_set.putCursor(hash.hashInt(hash_kind, event.user_id)); │ │127 + const user_repos_cursor = try user_id_to_repo_id_set.putCursor(hash.hashInt(hash_kind, record.event.user_id));│ │128 const user_repos = try DB.SortedSet(.read_write).init(user_repos_cursor); │ │135 - const user_repo_order_key = evt.orderKeyDesc(event_to_write.created_ts, event_id); │ │129 + const user_repo_order_key = evt.orderKeyDesc(record_to_write.created_ts, event_id); │ │130 try user_repos.put(&user_repo_order_key); │ │131 } else { │ │132 if (try event_id_to_repo.getCursor(repo_key)) |existing_repo_cursor| { │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │133 const existing_repo = try DB.HashMap(.read_only).init(existing_repo_cursor); │ │140 - const existing_repo_event = try evt.read(@This(), DB, hash_kind, arena, existing_repo);│ │134 + const existing_repo_record = try evt.read(Record, DB, hash_kind, arena, existing_repo);│ │135 │ │142 - const existing_path = try existing_repo_event.indexKey(arena.allocator()); │ │136 + const existing_path = try existing_repo_record.indexKey(arena.allocator()); │ │137 _ = try name_to_repo_id.remove(hash.hashInt(hash_kind, existing_path)); │ │138 │ │139 // drop it from the ordered set using its recorded creation timestamp │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │140 const repo_id_set_cursor = try haxy_moment.putCursor(hash.hashInt(hash_kind, "repo-id-set")); │ │141 const repo_id_set = try DB.SortedSet(.read_write).init(repo_id_set_cursor); │ │148 - const order_key = evt.orderKeyDesc(existing_repo_event.created_ts, event_id); │ │142 + const order_key = evt.orderKeyDesc(existing_repo_record.created_ts, event_id); │ │143 _ = try repo_id_set.remove(&order_key); │ │144 │ │145 const user_id_to_repo_id_set_cursor = try haxy_moment.putCursor(hash.hashInt(hash_kind, "user-id->repo-id-set"));│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │146 const user_id_to_repo_id_set = try DB.HashMap(.read_write).init(user_id_to_repo_id_set_cursor);│ │147 │ │154 - const user_key = hash.hashInt(hash_kind, existing_repo_event.user_id); │ │148 + const user_key = hash.hashInt(hash_kind, existing_repo_record.event.user_id); │ │149 const user_repos_cursor = try user_id_to_repo_id_set.putCursor(user_key); │ │150 const user_repos = try DB.SortedSet(.read_write).init(user_repos_cursor); │ │151 _ = try user_repos.remove(&order_key); │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────╮ │160 // a repo plus its event id (the id is the on-disk repo directory name, so the│ │161 // caller can locate the working repo under <server>/repos/<hex event id>). │ │162 pub const RepoWithId = struct { │ │169 - repo: Self, │ │163 + repo: Record, │ │164 event_id: [evt.event_id_size]u8, │ │165 }; │ │166 │ ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │183 _ = try user_id_cursor.readBytes(&user_id); │ │184 │ │185 // "user-id/repo-name" -> repo event id │ │192 - const repo_path = try (Self{ .user_id = user_id[0..], .name = repo_name, .description = "" }).indexKey(arena.allocator()); │ │186 + const repo_path = try (Record{ .event = .{ .user_id = user_id[0..], .name = repo_name, .description = "" } }).indexKey(arena.allocator());│ │187 const name_to_repo_id_cursor = try haxy_moment.getCursor(hash.hashInt(hash_kind, "name->repo-id")) orelse return null; │ │188 const name_to_repo_id = try DB.HashMap(.read_only).init(name_to_repo_id_cursor); │ │189 const repo_id_cursor = try name_to_repo_id.getCursor(hash.hashInt(hash_kind, repo_path)) orelse return null; │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │194 const event_id_to_repo = try DB.HashMap(.read_only).init(event_id_to_repo_cursor); │ │195 const repo_cursor = try event_id_to_repo.getCursor(hash.hashInt(hash_kind, &repo_id)) orelse return null;│ │196 const repo_map = try DB.HashMap(.read_only).init(repo_cursor); │ │203 - return .{ .repo = try evt.read(@This(), DB, hash_kind, arena, repo_map), .event_id = repo_id }; │ │197 + return .{ .repo = try evt.read(Record, DB, hash_kind, arena, repo_map), .event_id = repo_id }; │ │198 } │ │199 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯