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

Function build_origin

atomic-repository/tests/view_manifest_test.rs:43–64  ·  view source on GitHub ↗

Build the canonical fixture: `dev` (shared) with two changes, and a draft `orange` forked from it with three more changes on top.

()

Source from the content-addressed store, hash-verified

41/// Build the canonical fixture: `dev` (shared) with two changes, and a
42/// draft `orange` forked from it with three more changes on top.
43fn build_origin() -> (Repository, TempDir, PathBuf, Vec<Hash>) {
44 let (mut repo, temp, root) = init_repo();
45
46 write_and_add(&repo, &root, "base.txt", "base\n");
47 let c1 = record(&repo, "initial");
48 write_and_add(&repo, &root, "map.txt", "map\n");
49 let c2 = record(&repo, "concepts");
50
51 // Fork a draft the way session views are created: copy of the log,
52 // Draft scope, parented on dev.
53 repo.create_view_from("orange", "dev").expect("fork draft");
54 repo.switch_view("orange").expect("switch to draft");
55
56 write_and_add(&repo, &root, "tracks.txt", "A -> B\n");
57 let c3 = record(&repo, "inbound track");
58 write_and_add(&repo, &root, "rules.txt", "numbers\n");
59 let c4 = record(&repo, "key concepts");
60 fs::write(root.join("tracks.txt"), "A -> B -> C\n").expect("modify");
61 let c5 = record(&repo, "math");
62
63 (repo, temp, root, vec![c1, c2, c3, c4, c5])
64}
65
66/// Copy every change file referenced by a manifest into another repository's
67/// store (stands in for the `?store` / `?change` transfer).

Calls 6

writeFunction · 0.85
create_view_fromMethod · 0.80
switch_viewMethod · 0.80
init_repoFunction · 0.70
write_and_addFunction · 0.70
recordFunction · 0.70

Tested by

no test coverage detected