✨ feat(vscode): 摘修复识别 alembic 迁移,接不上发布分支链的高亮禁用不可摘

按 writing-alembic-migrations 的规矩判断:迁移的前任必须已在发布分支上,
且发布分支上该前任不能已有别的后继;根迁移接不上已有链、删迁移会断链也不可摘。
列表里带迁移的提交打「迁移」角标,不可摘的高亮警告色、禁用勾选并写明原因;
确认接口再校验一遍,绕过前端也摘不进去。

Claude-Session: https://claude.ai/code/session_01QWxLb6X8Vd2G5vHnp6R7qm
This commit is contained in:
cruldra committed 2026-09-08 11:44:24 +08:00
1 parent df0660cff7
commit 028195ab2b
8 files changed
+261 -26

No files matched your search

+4
View File
@@ -145,6 +145,10 @@ export function handleReleaseCherryPickConfirm(panel: KanbanWebviewPanel, shas:
if (!current)
throw new Error('尚无发布分支,先切新发布')
const commits = await listUnreleasedCommits({ cwd: root, devBranch: s.devBranch, current })
const wanted = new Set(shas)
const blocked = commits.find(c => wanted.has(c.sha) && c.migration?.blocked)
if (blocked)
throw new Error(`${blocked.sha.slice(0, 7)} ${blocked.subject}:${blocked.migration!.blocked}`)
const order = new Map(commits.map((c, i) => [c.sha, i]))
const ordered = [...shas].sort((a, b) => (order.get(b) ?? 0) - (order.get(a) ?? 0))
// 发布 worktree 走和实施 worktree 同一套目录模板,分支名里的 / 换成 - 当目录名。