fix(M02): 재적용 뒤 복사본 「고침」 을 끔 — 살린 입력값 · 고른 자재는 「값있음」 으로 따로 알림 · 목록 줄에도 반영 (PLAN 26-2b)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BU9gbNE3aWFUvE61pS2WGt
This commit is contained in:
@@ -118,6 +118,7 @@ def list_items(project_root: str | Path) -> list[dict[str, Any]]:
|
||||
"원본없음": changed is None,
|
||||
"구조물": manifest.get("구조물") or [],
|
||||
"고침": bool(manifest.get("고침")),
|
||||
"값있음": bool(manifest.get("값있음")),
|
||||
}
|
||||
)
|
||||
return out
|
||||
@@ -257,9 +258,13 @@ def reapply(project_root: str | Path, folder: str) -> dict[str, Any]:
|
||||
]
|
||||
source = version_of(source_files(files))
|
||||
stamp = now_text()
|
||||
fresh = {**manifest, "판": source, "원본판": source, "가져온날": stamp}
|
||||
# 원본을 다시 가져왔으니 시트 고침은 없음 — 살린 입력값 · 고른 자재는 `값있음` 으로 따로 알림
|
||||
kept = bool(files[VALUES_FILE] or files[PICKS_FILE])
|
||||
fresh = {**manifest, "판": source, "원본판": source, "가져온날": stamp, "고침": False}
|
||||
fresh["값있음"] = kept
|
||||
fresh.pop("고친날", None)
|
||||
atomic_write_json(target / MANIFEST_NAME, fresh)
|
||||
return {"폴더": folder, "가져온날": stamp, "원본판": source, "덮임": covered}
|
||||
return {"폴더": folder, "가져온날": stamp, "원본판": source, "덮임": covered, "값있음": kept}
|
||||
|
||||
|
||||
refresh = reapply # 25-1b 옛 이름(새로 가져오기)
|
||||
|
||||
@@ -128,6 +128,7 @@ def test_지정하면_새_파일까지_복사(world):
|
||||
"원본없음": False,
|
||||
"구조물": ["pipe@40.0"],
|
||||
"고침": False,
|
||||
"값있음": False,
|
||||
}
|
||||
]
|
||||
|
||||
@@ -522,3 +523,19 @@ def test_새_항목_길_회사_없으면_409(world, monkeypatch):
|
||||
assert client.post("/api/projects/p1/items/new", json=body).status_code == 409
|
||||
save_as = client.post("/api/projects/p1/items/f1/save-as", json={"경로": ["a"], "이름": "b"})
|
||||
assert save_as.status_code == 409
|
||||
|
||||
|
||||
def test_재적용_뒤_고침은_꺼지고_값있음만_남음(world):
|
||||
root = world["root"]
|
||||
_save(root, [_pipe()])
|
||||
_memo(root, FOLDER, "x")
|
||||
assert copies.list_items(root)[0]["고침"] is True
|
||||
got = copies.reapply(root, FOLDER)
|
||||
assert got["값있음"] is False
|
||||
row = copies.list_items(root)[0]
|
||||
assert row["고침"] is False and row["값있음"] is False
|
||||
_fill_values(root) # 입력값 씀 — 고침 켜짐
|
||||
assert copies.list_items(root)[0]["고침"] is True
|
||||
assert copies.reapply(root, FOLDER)["값있음"] is True
|
||||
row = copies.list_items(root)[0]
|
||||
assert row["고침"] is False and row["값있음"] is True
|
||||
|
||||
Reference in New Issue
Block a user