dsh-vscode-mode 0.15.4 → 0.15.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/svn.ts CHANGED
@@ -1119,8 +1119,15 @@ export function createSvnRpc(deps: SvnRpcDeps): { handlers: Record<string, unkno
1119
1119
  const paths = [...new Set(args.paths.map(safeRel))]
1120
1120
  if (paths.some((path) => !path)) return { ok: false as const, error: '路径不合法' }
1121
1121
  try {
1122
+ // 分批并发(批 4,计划批准值):冲突面板一次请求上限 64 条,旧串行版在 64 冲突时要排队 64 次 svn 进程
1123
+ // (每次冷启动约 10~40ms,最坏累计 1~2s 阻塞面板)。readConflict 只跑 `svn status --xml`(只读,无写入竞争)。
1124
+ // 与 svn.fileSizes 的分批并发同型(见下方 BATCH = 16);分批 push 保持结果顺序不变。
1125
+ // @author ddj 2026年10月14号
1122
1126
  const states = []
1123
- for (const path of paths) states.push(await readConflict(scope.cwd, scope.root, path!))
1127
+ const BATCH = 4
1128
+ for (let start = 0; start < paths.length; start += BATCH) {
1129
+ states.push(...await Promise.all(paths.slice(start, start + BATCH).map((path) => readConflict(scope.cwd, scope.root, path!))))
1130
+ }
1124
1131
  return { ok: true as const, states }
1125
1132
  } catch (error) { return { ok: false as const, error: String(error) } }
1126
1133
  },