{"draft":null,"from":185,"to":186,"files":[{"path":"client/test/client.test.ts","added":40,"removed":0,"diff":"--- a/client/test/client.test.ts\n+++ b/client/test/client.test.ts\n@@ -824,6 +824,46 @@\n \t\t);\n \t});\n \n+\tit(\"shows and exports a version without earlier ones, refuses one a kept version builds on, and leaves shared alone\", async () => {\n+\t\tconst { name, folders } = await project({ \"a.txt\": \"a\\n\", \"b.txt\": \"b\\n\" }, \"alice\", \"bob\");\n+\t\tconst [alice, bob] = [folders.alice!, folders.bob!];\n+\t\twrite(alice, { \"a.txt\": \"a, changed\\n\" });\n+\t\tassert.equal((await avcs(alice, \"push\", \"-m\", \"change a\")).exit, 0);\n+\t\twrite(alice, { \"b.txt\": \"b, changed\\n\" });\n+\t\tassert.equal((await avcs(alice, \"push\", \"-m\", \"change b\")).exit, 0);\n+\t\twrite(alice, { \"a.txt\": \"a, changed again\\n\" });\n+\t\tassert.equal((await avcs(alice, \"push\", \"-m\", \"change a again\")).exit, 0);\n+\t\tconst before = shared(name);\n+\n+\t\tconst shown = await text(bob, \"show\", \"2\", \"--without\", \"1\");\n+\t\tassert.equal(shown.exit, 0, shown.stderr);\n+\t\tassert.match(\n+\t\t\tshown.stdout,\n+\t\t\t/^Version 2 of shared without version 1:\\n {2}version 1 by alice: change a\\nCompared with version 2: 1 file, 1 line added, 1 removed\\.\\nThe files hash to [0-9a-f]{64}; the same ask gives the same hash\\. Shared doesn't change\\./,\n+\t\t);\n+\t\tassert.match(shown.stdout, /-a, changed\\n\\+a\\n/);\n+\t\tassert.equal((await text(bob, \"show\", \"2:a.txt\", \"--without\", \"1\")).stdout, \"a\\n\");\n+\t\tassert.equal((await text(bob, \"show\", \"2:b.txt\", \"--without\", \"1\")).stdout, \"b, changed\\n\");\n+\n+\t\tconst refused = await text(bob, \"show\", \"3\", \"--without\", \"1\");\n+\t\tassert.equal(refused.exit, 2);\n+\t\tassert.equal(\n+\t\t\trefused.stdout,\n+\t\t\t\"Version 3 of shared can't leave out version 1: versions it keeps build on it.\\n  version 3 by alice: change a again\\n    builds on version 1 (a.txt)\\nLeaving those out too works: abso show 3 --without 1,3\\n\",\n+\t\t);\n+\t\tconst out = join(temp(), \"without\");\n+\t\tconst blocked = await avcs(bob, \"export\", out, \"--version\", \"3\", \"--without\", \"1\");\n+\t\tassert.equal(blocked.exit, 2);\n+\t\tassert.deepEqual(blocked.json.suggestion, [1, 3]);\n+\t\tconst exported = await avcs(bob, \"export\", out, \"--version\", \"3\", \"--without\", \"1,3\");\n+\t\tassert.equal(exported.exit, 0, exported.out);\n+\t\tassert.deepEqual(exported.json.without, [1, 3]);\n+\t\tassert.equal(readFileSync(join(out, \"a.txt\"), \"utf8\"), \"a\\n\");\n+\t\tassert.equal(readFileSync(join(out, \"b.txt\"), \"utf8\"), \"b, changed\\n\");\n+\t\tassert.deepEqual(shared(name), before, \"shared doesn't change\");\n+\t\tassert.equal((await text(bob, \"show\", \"3\", \"--without\", \"x\")).exit, 1);\n+\t});\n+\n \tit(\"refuses a push that builds on lines a drop took out, plainly, with exit 2\", async () => {\n \t\tconst { folders } = await project({ \"a.txt\": \"one\\ntwo\\n\" }, \"alice\", \"bob\");\n \t\tconst [alice, bob] = [folders.alice!, folders.bob!];"}],"unmatched":[]}