tiny.sql.importHistoryPackBytes
Defined in sync.
Source
Source: lib/sql/src/sync.zig:1236
zig
pub fn importBytes(allocator: Allocator, target: *history_mod.History, bytes: []const u8) Error!Stats { var reader = ByteReader.init(bytes); var sections = try decodePackSections(allocator, &reader); defer sections.deinit(allocator); var stats = Stats{}; var index: usize = 0; while (index < sections.frame_count) : (index += 1) { const kind = try decodeFrameKind(try reader.readU32()); const payload = try reader.readBytes(); if (try target.importPackRecord(kind, payload)) stats.records += 1; } try reader.finish(); for (sections.commits) |commit_object| { const commit = version.Commit.init(commit_object.root, commit_object.parents); if (!version.same(commit.hash, commit_object.hash)) return error.InvalidPack; if (try target.importPackCommit(commit_object.root, commit_object.parents)) stats.commits += 1; } for (sections.refs) |ref_value| { try target.putRef(.{ .name = ref_value.name, .target = ref_value.target, }); stats.refs += 1; } try target.flushSync(); return stats;}Source: lib/sql/src/root.zig:143
zig
pub const importHistoryPackBytes = sync.importBytes;Complete call list
8 direct calls.
lib.sql.src.sync.ByteReader.finish[method] — private source atlib/sql/src/sync.zig:1524in nearest public ownertiny.sql.synclib.sql.src.sync.ByteReader.init[function] — private source atlib/sql/src/sync.zig:1520in nearest public ownertiny.sql.synclib.sql.src.sync.ByteReader.readBytes[method] — private source atlib/sql/src/sync.zig:1535in nearest public ownertiny.sql.synclib.sql.src.sync.ByteReader.readU32[method] — private source atlib/sql/src/sync.zig:1551in nearest public ownertiny.sql.synclib.sql.src.sync.decodeFrameKind[function] — private source atlib/sql/src/sync.zig:466in nearest public ownertiny.sql.synclib.sql.src.sync.decodePackSections[function] — private source atlib/sql/src/sync.zig:412in nearest public ownertiny.sql.synctiny.sql.Commit.init[function] atlib/sql/src/version.zig:432tiny.sql.version.same[function] atlib/sql/src/version.zig:498
Audit
| Definitions | 1 |
|---|---|
| Public names | 2 |
| Members | 0 |
| Version | 26.7.0 |
| Revision | daab053ee433 |