svn_delete
Remove files or directories from Subversion version control. Specify paths, add commit messages, and optionally force deletion or keep local copies.
Instructions
Eliminar archivos del control de versiones
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| paths | Yes | Archivo(s) o directorio(s) a eliminar | |
| message | No | Mensaje para eliminación directa en repositorio | |
| force | No | Forzar eliminación | |
| keepLocal | No | Mantener copia local |
Implementation Reference
- tools/svn-service.ts:552-596 (handler)Core handler function in SvnService that executes the SVN 'delete' command, validates paths, processes options like force, keepLocal, message, normalizes paths, runs executeSvnCommand, and handles errors.async delete( paths: string | string[], options: SvnDeleteOptions = {} ): Promise<SvnResponse<string>> { try { const pathArray = Array.isArray(paths) ? paths : [paths]; // Validar todas las rutas for (const path of pathArray) { if (!validatePath(path)) { throw new SvnError(`Invalid path: ${path}`); } } const args = ['delete']; if (options.force) { args.push('--force'); } if (options.keepLocal) { args.push('--keep-local'); } if (options.message) { args.push('--message', options.message); } // Añadir rutas normalizadas args.push(...pathArray.map(p => normalizePath(p))); 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 delete files: ${error.message}`); } }
- index.ts:444-481 (registration)MCP server registration of the 'svn_delete' tool, including Zod input schema validation, wrapper handler that calls SvnService.delete, formats response with execution details.// 10. Eliminar archivos server.tool( "svn_delete", "Eliminar archivos del control de versiones", { paths: z.union([z.string(), z.array(z.string())]).describe("Archivo(s) o directorio(s) a eliminar"), message: z.string().optional().describe("Mensaje para eliminación directa en repositorio"), force: z.boolean().optional().default(false).describe("Forzar eliminación"), keepLocal: z.boolean().optional().default(false).describe("Mantener copia local") }, async (args) => { try { const options = { message: args.message, force: args.force, keepLocal: args.keepLocal }; const result = await getSvnService().delete(args.paths, options); const pathsArray = Array.isArray(args.paths) ? args.paths : [args.paths]; const deleteText = `🗑️ **Archivos Eliminados**\n\n` + `**Archivos:** ${pathsArray.join(', ')}\n` + `**Mantener Local:** ${args.keepLocal ? 'Sí' : 'No'}\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: deleteText }], }; } catch (error: any) { return { content: [{ type: "text", text: `❌ **Error:** ${error.message}` }], }; } } );
- common/types.ts:199-203 (schema)TypeScript interface defining the options structure for SVN delete operations: message, force, keepLocal.export interface SvnDeleteOptions { message?: string; force?: boolean; keepLocal?: boolean; }