svn_update
Update your SVN working copy from the repository by specifying a path, target revision, and conflict resolution options. Manage externals and force updates as needed.
Instructions
Actualizar working copy desde el repositorio
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| acceptConflicts | No | Como manejar conflictos | |
| force | No | Forzar actualización | |
| ignoreExternals | No | Ignorar externals | |
| path | No | Ruta específica a actualizar | |
| revision | No | Revisión objetivo |
Implementation Reference
- tools/svn-service.ts:386-429 (handler)Core implementation of svn update command execution in SvnService class, handling arguments, validation, and svn command execution.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:322-358 (registration)MCP server.tool registration for 'svn_update' tool, defining input schema with Zod and wrapper handler that calls SvnService.update and formats response.server.tool( "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 input options for svn_update, used by the handler and Zod schema.export interface SvnUpdateOptions { revision?: number | 'HEAD' | 'BASE' | 'COMMITTED' | 'PREV'; force?: boolean; ignoreExternals?: boolean; acceptConflicts?: 'postpone' | 'base' | 'mine-conflict' | 'theirs-conflict' | 'mine-full' | 'theirs-full'; }