svn_checkout
Check out SVN repositories by specifying URL, destination path, revision, depth, and options to force checkout or ignore externals.
Instructions
Hacer checkout de un repositorio SVN
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| depth | No | Profundidad del checkout | |
| force | No | Forzar checkout | |
| ignoreExternals | No | Ignorar externals | |
| path | No | Directorio destino | |
| revision | No | Revisión específica | |
| url | Yes | URL del repositorio SVN |
Implementation Reference
- tools/svn-service.ts:331-381 (handler)Core handler logic for svn_checkout: builds svn checkout command arguments with options and executes via executeSvnCommandasync checkout( url: string, path?: string, options: SvnCheckoutOptions = {} ): Promise<SvnResponse<string>> { try { if (!validateSvnUrl(url)) { throw new SvnError(`Invalid SVN URL: ${url}`); } const args = ['checkout']; if (options.revision) { args.push('--revision', options.revision.toString()); } if (options.depth) { args.push('--depth', options.depth); } if (options.force) { args.push('--force'); } if (options.ignoreExternals) { args.push('--ignore-externals'); } args.push(url); if (path) { if (!validatePath(path)) { throw new SvnError(`Invalid path: ${path}`); } args.push(normalizePath(path)); } const response = await executeSvnCommand(this.config, args); return { success: true, data: cleanOutput(response.data as string), command: response.command, workingDirectory: response.workingDirectory, executionTime: response.executionTime }; } catch (error: any) { throw new SvnError(`Failed to checkout: ${error.message}`); } }
- index.ts:281-319 (registration)MCP server registration of svn_checkout tool, defining input schema with zod and thin async handler that calls SvnService.checkoutserver.tool( "svn_checkout", "Hacer checkout de un repositorio SVN", { url: z.string().describe("URL del repositorio SVN"), path: z.string().optional().describe("Directorio destino"), revision: z.union([z.number(), z.literal("HEAD")]).optional().describe("Revisión específica"), depth: z.enum(["empty", "files", "immediates", "infinity"]).optional().describe("Profundidad del checkout"), force: z.boolean().optional().default(false).describe("Forzar checkout"), ignoreExternals: z.boolean().optional().default(false).describe("Ignorar externals") }, async (args) => { try { const options = { revision: args.revision, depth: args.depth, force: args.force, ignoreExternals: args.ignoreExternals }; const result = await getSvnService().checkout(args.url, args.path, options); const checkoutText = `📥 **Checkout Completado**\n\n` + `**URL:** ${args.url}\n` + `**Destino:** ${args.path || 'Directorio actual'}\n` + `**Comando:** ${result.command}\n` + `**Tiempo de Ejecución:** ${formatDuration(result.executionTime || 0)}\n\n` + `**Resultado:**\n\`\`\`\n${result.data}\n\`\`\``; return { content: [{ type: "text", text: checkoutText }], }; } catch (error: any) { return { content: [{ type: "text", text: `❌ **Error:** ${error.message}` }], }; } } );
- common/types.ts:180-185 (schema)TypeScript interface defining SvnCheckoutOptions used in the checkout handlerexport interface SvnCheckoutOptions { revision?: number | 'HEAD'; depth?: 'empty' | 'files' | 'immediates' | 'infinity'; force?: boolean; ignoreExternals?: boolean; }