svn_update
Update your local SVN working copy with the latest repository changes, handling conflicts and specifying target revisions as needed.
Instructions
Actualizar working copy desde el repositorio
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Ruta específica a actualizar | |
| revision | No | Revisión objetivo | |
| force | No | Forzar actualización | |
| ignoreExternals | No | Ignorar externals | |
| acceptConflicts | No | Como manejar conflictos |
Implementation Reference
- tools/svn-service.ts:386-429 (handler)The core handler function in SvnService that constructs and executes the 'svn update' command with options, validates paths, and returns the result.async update( path?: string, options: SvnUpdateOptions = {} ): Promise<SvnResponse<string>> { try { const args = ['update']; if (options.revision) { args.push('--revision', options.revision.toString()); } if (options.force) { args.push('--force'); } if (options.ignoreExternals) { args.push('--ignore-externals'); } if (options.acceptConflicts) { args.push('--accept', options.acceptConflicts); } 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 update: ${error.message}`); } }
- index.ts:323-358 (registration)MCP server.tool registration for 'svn_update', including input schema with Zod validation and thin wrapper handler that calls SvnService.update and formats output."svn_update", "Actualizar working copy desde el repositorio", { path: z.string().optional().describe("Ruta específica a actualizar"), revision: z.union([z.number(), z.literal("HEAD"), z.literal("BASE"), z.literal("COMMITTED"), z.literal("PREV")]).optional().describe("Revisión objetivo"), force: z.boolean().optional().default(false).describe("Forzar actualización"), ignoreExternals: z.boolean().optional().default(false).describe("Ignorar externals"), acceptConflicts: z.enum(["postpone", "base", "mine-conflict", "theirs-conflict", "mine-full", "theirs-full"]).optional().describe("Como manejar conflictos") }, async (args) => { try { const options = { revision: args.revision, force: args.force, ignoreExternals: args.ignoreExternals, acceptConflicts: args.acceptConflicts }; const result = await getSvnService().update(args.path, options); const updateText = `🔄 **Actualización Completada**\n\n` + `**Ruta:** ${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: updateText }], }; } catch (error: any) { return { content: [{ type: "text", text: `❌ **Error:** ${error.message}` }], }; } } );
- common/types.ts:173-178 (schema)TypeScript interface defining the options for the SVN update operation, used by the SvnService.update method.export interface SvnUpdateOptions { revision?: number | 'HEAD' | 'BASE' | 'COMMITTED' | 'PREV'; force?: boolean; ignoreExternals?: boolean; acceptConflicts?: 'postpone' | 'base' | 'mine-conflict' | 'theirs-conflict' | 'mine-full' | 'theirs-full'; }