Public: anyone can read this; the crew can change it.
The terminal's take-back is tested on a conflict #7240
Check · Review · Land · Live done — Landed and live in production.
mason/forge:mason/7228-the-terminal-s-pull-screen-offers-take-b → main 5 commits fork 3 threads · 3 unresolved
2 files
changed +15
−3
src/actions/revert_words.ts +2 −1
| @@ -1,6 +1,7 @@ | ||
| 1 | 1 | /** |
| 2 | 2 | * What a take-back refusal says (#7211): one place, so the studio's |
| 3 | * "take it back" button and the MCP `take_back` tool read the same. | |
| 3 | * "take it back" button, the MCP `take_back` tool and the terminal's | |
| 4 | * pull screen (#7228) read the same. | |
| 4 | 5 | */ |
| 5 | 6 | |
| 6 | 7 | import type { RevertPullError } from "./revert.ts"; |
test/tui-take-back.test.ts +13 −2
| @@ -1,8 +1,8 @@ | ||
| 1 | 1 | /** |
| 2 | 2 | * The terminal's pull screen takes back a shipped pull with `T` and a |
| 3 | 3 | * confirm, as the page does: absent on an open pull and to an agent, No |
| 4 | * changes nothing, Yes opens the revert pull, and a second take-back is | |
| 5 | * refused in the page's words. | |
| 4 | * changes nothing, Yes opens the revert pull, and a second take-back or | |
| 5 | * one that conflicts is refused in the page's words. | |
| 6 | 6 | */ |
| 7 | 7 | import { afterEach, beforeEach, expect, test } from "bun:test"; |
| 8 | 8 | import { mkdtemp, rm } from "node:fs/promises"; |
| @@ -161,6 +161,17 @@ test("a second take-back is refused as already taken back", async () => { | ||
| 161 | 161 | expect(again.text()).toContain("it has already been taken back"); |
| 162 | 162 | }); |
| 163 | 163 | |
| 164 | test("a take-back that no longer applies is refused naming the file, and leaves nothing", async () => { | |
| 165 | const first = await pullOf(true); | |
| 166 | await pullOf(true); | |
| 167 | const t = await open(first.number); | |
| 168 | await t.press("T", "right", "enter"); | |
| 169 | expect(t.text()).toContain( | |
| 170 | "That could not be taken back: it conflicts with the current code in code.txt.", | |
| 171 | ); | |
| 172 | expect(revertOf(app.db, repo.id, first.id)).toBeUndefined(); | |
| 173 | }); | |
| 174 | ||
| 164 | 175 | test("a guest and a read-only user are shown no key and press it for nothing", async () => { |
| 165 | 176 | const pull = await pullOf(true); |
| 166 | 177 | const made = await createUser(app.db, { |
new above
offline