╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ─────────╮ │src/event/Repo.zig│ ╰──────────────────╯ ╭─────────────────────────────────────────────────────────────────╮ │25 pub const name_max_len = 32; │ │26 │ │27 // the moment keys `evt.merge` reads and writes for this kind│ │28 +pub const merge_policy: evt.MergePolicy = .target_wins; │ │29 pub const record_map_key = "event-id->repo"; │ │30 pub const id_set_key = "repo-id-set"; │ │31 pub const name_index_key = "name->repo-id"; │ ╰─────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────╮ │31 -pub const conflicts_key = "conflicted-repo-id->conflict";│ │32 -pub const id_to_field_to_oid_key = "repo-id->field->oid";│ │32 │ │33 pub fn validateName(name: []const u8) !void { │ │34 if (name.len == 0) return error.NameEmpty; │ ╰─────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────╮ │48 event_id: *const [evt.event_id_size]u8, │ │49 record_maybe: ?Record, │ │50 arena: *std.heap.ArenaAllocator, │ │52 - // the commit this event came from, recorded against every field it │ │53 - // changes. null from `merge`, which sets oids and conflicts itself.│ │54 - event_oid: ?[]const u8, │ │51 + _: ?[]const u8, │ │52 ) !void { │ │53 const repo_key = hash.hashInt(hash_kind, event_id); │ │54 │ ╰────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │58 const name_to_repo_id_cursor = try haxy_moment.putCursor(hash.hashInt(hash_kind, "name->repo-id")); │ │59 const name_to_repo_id = try DB.HashMap(.read_write).init(name_to_repo_id_cursor); │ │60 │ │64 - const conflicts_cursor = try haxy_moment.putCursor(hash.hashInt(hash_kind, conflicts_key)); │ │65 - const conflicts = try DB.SortedMap(.read_write).init(conflicts_cursor); │ │66 - │ │67 - const repo_id_to_field_to_oid_cursor = try haxy_moment.putCursor(hash.hashInt(hash_kind, id_to_field_to_oid_key));│ │68 - const repo_id_to_field_to_oid = try DB.HashMap(.read_write).init(repo_id_to_field_to_oid_cursor); │ │69 - │ │61 var existing_record_maybe: ?Record = null; │ │62 const existing_cursor_maybe = try event_id_to_repo.getCursor(repo_key); │ │63 if (existing_cursor_maybe) |existing_cursor| { │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ 91 const old_user_repos_cursor = try user_id_to_repo_id_set.putCursor(hash.hashInt(hash_kind, existing_record.event.user_id));│ │ 92 const old_user_repos = try DB.SortedSet(.read_write).init(old_user_repos_cursor); │ │ 93 _ = try old_user_repos.remove(&order_key); │ │103 - } │ │104 - │ │105 - // any event settles the conflict, since resolving in the ui may │ │106 - // keep our own values and so change nothing to detect │ │107 - if (event_oid != null or record_to_write.deleted) { │ │108 - _ = try conflicts.remove(&order_key); │ │ 94 } │ │ 95 } │ │ 96 │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │112 - try evt.writeOid(Self, DB, hash_kind, repo_id_to_field_to_oid, repo_key, if (existing_record_maybe) |existing| existing.event else null, record_to_write.event, event_oid);│ │113 - │ │ 97 const repo_cursor = try event_id_to_repo.putCursor(repo_key); │ │ 98 const repo = try DB.HashMap(.read_write).init(repo_cursor); │ │ 99 try evt.upsert(Record, DB, hash_kind, repo, record_to_write); │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────╮ │src/event/User.zig│ ╰──────────────────╯ ╭─────────────────────────────────────────────────────────────────╮ │36 pub const name_max_len = 32; │ │37 │ │38 // the moment keys `evt.merge` reads and writes for this kind│ │39 +pub const merge_policy: evt.MergePolicy = .target_wins; │ │40 pub const record_map_key = "event-id->user"; │ │41 pub const id_set_key = "user-id-set"; │ │42 pub const name_index_key = "name->user-id"; │ ╰─────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────╮ │42 -pub const conflicts_key = "conflicted-user-id->conflict"; │ │43 -pub const id_to_field_to_oid_key = "user-id->field->oid"; │ │43 │ │44 // resolves a commit's author email to its user at read time│ │45 pub const email_to_user_id_key = "email->user-id"; │ ╰────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────╮ │68 event_id: *const [evt.event_id_size]u8, │ │69 record_maybe: ?Record, │ │70 arena: *std.heap.ArenaAllocator, │ │72 - // the commit this event came from, recorded against every field it │ │73 - // changes. null from `merge`, which sets oids and conflicts itself.│ │74 - event_oid: ?[]const u8, │ │71 + _: ?[]const u8, │ │72 ) !void { │ │73 const user_key = hash.hashInt(hash_kind, event_id); │ │74 │ ╰────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │80 │ │81 const email_to_user_id_cursor = try haxy_moment.putCursor(hash.hashInt(hash_kind, email_to_user_id_key)); │ │82 const email_to_user_id = try DB.HashMap(.read_write).init(email_to_user_id_cursor); │ │86 - │ │87 - const conflicts_cursor = try haxy_moment.putCursor(hash.hashInt(hash_kind, conflicts_key)); │ │88 - const conflicts = try DB.SortedMap(.read_write).init(conflicts_cursor); │ │89 - │ │90 - const user_id_to_field_to_oid_cursor = try haxy_moment.putCursor(hash.hashInt(hash_kind, id_to_field_to_oid_key));│ │91 - const user_id_to_field_to_oid = try DB.HashMap(.read_write).init(user_id_to_field_to_oid_cursor); │ │83 │ │84 var existing_record_maybe: ?Record = null; │ │85 const existing_cursor_maybe = try event_id_to_user.getCursor(user_key); │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯