feat: support SVN auth and project credentials

- add username/password fields to project dialog and model
- pass optional auth to SVN info/status/log/diff/update/commit services
- centralize SVN CLI auth flags in SvnService and fix header text

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
liumangmang
2026-02-04 17:54:16 +08:00
parent 610793f276
commit 52c099e0ba
11 changed files with 198 additions and 27 deletions

View File

@@ -25,7 +25,7 @@ public class DiffService extends SvnService {
* @throws InterruptedException 中断异常
* @throws TimeoutException 超时异常
*/
public String getDiff(String workingDirectory, String filePath)
public String getDiff(String workingDirectory, String filePath, String username, String password)
throws IOException, InterruptedException, TimeoutException {
logger.debug("获取差异: {}", workingDirectory);
@@ -34,6 +34,7 @@ public class DiffService extends SvnService {
}
List<String> args = new ArrayList<>();
addAuthArgs(args, username, password);
if (filePath != null && !filePath.isEmpty()) {
args.add(filePath);
}
@@ -57,8 +58,23 @@ public class DiffService extends SvnService {
* @throws InterruptedException 中断异常
* @throws TimeoutException 超时异常
*/
public String getDiff(String workingDirectory)
public String getDiff(String workingDirectory)
throws IOException, InterruptedException, TimeoutException {
return getDiff(workingDirectory, null);
return getDiff(workingDirectory, null, null, null);
}
/**
* 获取指定文件的差异(不带认证信息)
*
* @param workingDirectory 工作目录
* @param filePath 文件路径null表示所有文件
* @return 差异内容
* @throws IOException IO异常
* @throws InterruptedException 中断异常
* @throws TimeoutException 超时异常
*/
public String getDiff(String workingDirectory, String filePath)
throws IOException, InterruptedException, TimeoutException {
return getDiff(workingDirectory, filePath, null, null);
}
}