Use remote SVN URL for repository browsing

This commit is contained in:
lwt
2026-06-18 14:38:44 +08:00
parent 7650fd5bfb
commit 4ab3332f34
+7 -6
View File
@@ -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: {