From 4ab3332f3485fc55ef4703b4063aacbfd7c815b4 Mon Sep 17 00:00:00 2001 From: lwt <215586800@qq.com> Date: Thu, 18 Jun 2026 14:38:44 +0800 Subject: [PATCH] Use remote SVN URL for repository browsing --- server/svn-service.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/server/svn-service.js b/server/svn-service.js index 3332808..4b4bb13 100644 --- a/server/svn-service.js +++ b/server/svn-service.js @@ -444,7 +444,7 @@ async function handleSvnAction(options, repo, action, body = {}) { result = await runRepoSvn(options, repo, withDepth(args, body), { cwd: options.svnRoot, timeoutMs: 10 * 60 * 1000 }); break; case "info": - result = await runRepoSvn(options, repo, ["info", resolveAnyTarget(options, repo, target)]); + result = await runRepoSvn(options, repo, ["info", body.target ? resolveAnyTarget(options, repo, target) : repo.url], { cwd: options.svnRoot }); break; case "status": args = ["status", resolveLocalTarget(options, repo, target)]; @@ -461,10 +461,10 @@ async function handleSvnAction(options, repo, action, body = {}) { result = await runRepoSvn(options, repo, args, { timeoutMs: 10 * 60 * 1000 }); break; case "log": - args = ["log", resolveAnyTarget(options, repo, target), "-l", String(parseIntValue(body.limit, 30, 1, 300))]; + args = ["log", body.target ? resolveAnyTarget(options, repo, target) : repo.url, "-l", String(parseIntValue(body.limit, 30, 1, 300))]; if (body.revision) args.push("-r", limitText(body.revision, 80)); if (parseBoolean(body.verbose, false)) args.push("-v"); - result = await runRepoSvn(options, repo, args); + result = await runRepoSvn(options, repo, args, { cwd: isRemoteTarget(args[1]) ? options.svnRoot : undefined }); break; case "diff": args = ["diff", resolveLocalTarget(options, repo, target)]; @@ -541,7 +541,8 @@ async function handleSvnAction(options, repo, action, body = {}) { result = await runRepoSvn(options, repo, args); break; case "list": - result = await runRepoSvn(options, repo, ["list", resolveAnyTarget(options, repo, target || repo.url)]); + args = ["list", body.target ? resolveAnyTarget(options, repo, target) : repo.url]; + result = await runRepoSvn(options, repo, args, { cwd: isRemoteTarget(args[1]) ? options.svnRoot : undefined }); break; case "blame": result = await runRepoSvn(options, repo, ["blame", resolveLocalTarget(options, repo, requireValue(target, "Target"))]); @@ -563,11 +564,11 @@ async function handleSvnAction(options, repo, action, body = {}) { break; } case "export": { - const source = resolveAnyTarget(options, repo, body.source || target || repo.url); + const source = resolveAnyTarget(options, repo, body.source || body.target || repo.url); const destination = resolveExportPath(options, body.destination || `${repo.id}-${Date.now()}`); args = ["export", source, destination]; if (parseBoolean(body.force, true)) args.push("--force"); - result = await runRepoSvn(options, repo, args, { timeoutMs: 10 * 60 * 1000 }); + result = await runRepoSvn(options, repo, args, { cwd: isRemoteTarget(source) ? options.svnRoot : undefined, timeoutMs: 10 * 60 * 1000 }); break; } default: {