MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / legacy_changes

Function legacy_changes

atomic-core/tests/merge_test.rs:50–63  ·  view source on GitHub ↗

A legacy change store holding only provenance journal state, as in production.

(path: &Path)

Source from the content-addressed store, hash-verified

48
49/// A legacy change store holding only provenance journal state, as in production.
50fn legacy_changes(path: &Path) {
51 let db = Database::create(path).unwrap();
52 let txn = db.begin_write().unwrap();
53 {
54 let mut meta = txn.open_table(PROVENANCE_STORE_META).unwrap();
55 meta.insert("schema_version", 1).unwrap();
56 meta.insert("next_provenance_id", 3).unwrap();
57 let mut turns = txn.open_table(PROVENANCE_TURNS).unwrap();
58 turns.insert(1, b"turn one".as_slice()).unwrap();
59 turns.insert(2, b"turn two".as_slice()).unwrap();
60 txn.open_table(CHANGE_META).unwrap();
61 }
62 txn.commit().unwrap();
63}
64
65fn open_sources(paths: &[&Path]) -> LegacyDatabases {
66 let mut legacy = LegacyDatabases::new();

Calls 6

begin_writeMethod · 0.80
createFunction · 0.50
unwrapMethod · 0.45
insertMethod · 0.45
as_sliceMethod · 0.45
commitMethod · 0.45

Tested by

no test coverage detected