-
Notifications
You must be signed in to change notification settings - Fork 1.9k
feat: Add SVN commit support with GUI interface similar to Git commits #6117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
在Webview消息处理、扩展消息类型和UI组件中添加对SVN提交搜索的支持 - 新增SVN提交搜索功能及相关类型定义 - 扩展上下文菜单以支持SVN提交选项 - 添加SVN工具函数用于搜索和解析提交信息 - 在聊天文本区域集成SVN提交搜索功能
添加SVN集成调试功能,包括: 1. 新增debugSvn命令用于检查SVN安装和仓库状态 2. 实现SvnLogger用于记录调试信息 3. 增强现有SVN工具函数添加日志记录 4. 在package.json注册新命令
- 在mentionRegex中添加svn-changes匹配项 - 实现获取SVN工作状态的函数并添加调试日志 - 在parseMentions中处理svn-changes提及,返回工作目录变更信息 - 在processUserContentMentions中添加调试日志
当SVN工作目录中存在未跟踪文件时,现在会显示前3个文件的内容预览(针对小文件)或文件类型信息。这有助于开发者快速了解未跟踪文件的内容,而无需手动检查每个文件。
- 在提及解析中增加对SVN版本号的支持 - 添加获取SVN提交信息的工具函数 - 修改提及正则表达式以匹配SVN版本号 - 为SVN提及添加类型定义和格式化函数
将SVN调试相关的注释从中文翻译为英文,提高代码可读性
- 在文件搜索和检查点服务中排除.svn目录 - 改进SVN工具中的错误处理,确保错误信息正确显示
- 新增SVN错误处理类,提供更友好的错误提示和指导 - 改进调试命令的输出信息,包含仓库URL和工作副本路径 - 为常见SVN错误添加详细处理逻辑和用户引导 - 优化命令标题的国际化支持 - 简化提交信息解析逻辑,提高可读性
更新 packages/ipc、packages/evals 中的 node-ipc 依赖版本 同步更新 pnpm-lock.yaml 文件
- 新增svn.spec.ts文件,包含对SVN相关工具函数的单元测试 - 测试内容涵盖SVN安装检查、仓库验证、提交信息提取等功能 - 使用vitest框架进行测试,确保各功能模块的正确性和稳定性
return "Error: SVN not available or not an SVN repository" | ||
} | ||
|
||
const cleanRevision = revision.replace(/^r/i, "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In getSvnCommitInfoForMentions, the revision string is only cleaned using replace(/^r/i, "") but not fully validated. It would be safer to ensure the revision contains only digits before interpolating into the shell command to avoid potential command injection.
const cleanRevision = revision.replace(/^r/i, "") | |
const cleanRevision = revision.replace(/^r/i, ""); if (!/^\d+$/.test(cleanRevision)) throw new Error("Invalid revision"); |
- 在获取SVN提交信息的函数中新增版本号格式验证,确保输入的版本号为有效的数字格式 - 更新上下文菜单选项,新增对SVN类型的支持,确保用户在空查询时能够获取到完整的选项列表
- 我确保最初的两笔提交中与环境有关的改动导致的后续问题得到修复。比如roo-code\apps\vscode-e2e\src\types\global.d.ts和package.json - pnpm lint和pnpm test都成功
Hi! I've fixed the issue that caused CI to fail before:
|
Related GitHub Issue
Closes: #6100
Roo Code Task Context (Optional)
Description
This PR implements comprehensive SVN (Subversion) support for Roo Code, allowing users to work with SVN repositories alongside existing Git functionality. The implementation includes:
Key Features Implemented:
.svn
directories and integration with VS Code workspace@svn-changes
mentionr123
and123
format revision mentions with automatic commit info retrievalTechnical Implementation Details:
src/utils/svn.ts
with complete SVN command-line integrationSvnLogger
class for comprehensive debug logging with dedicated VS Code output channelSvnErrorHandler
with user-friendly error messages and guided troubleshootingExtensionMessage.ts
for webview communicationDesign Choices:
Test Procedure
Automated Testing:
✅ All 18 SVN tests pass successfully
Manual Testing Steps:
SVN Repository Detection:
debugSvn
command appears in Command PaletteSVN Commit Search:
@svn-commits
mention with revision number (e.g.,@svn-commits 123
)@svn-commits "bug fix"
)SVN Status Integration:
@svn-changes
mentionSVN Version References:
r123
or123
in chatDebug Functionality:
debugSvn
commandTesting Environment:
Pre-Submission Checklist
Screenshots / Videos
Main User Interface Changes:
debugSvn
command available in VS Code Command PaletteDocumentation Updates
Rationale: This feature integrates seamlessly with existing mention system (
@svn-changes
,@svn-commits
) and follows established patterns. ThedebugSvn
command is self-explanatory and appears in Command Palette. User-friendly error messages provide guidance when needed.Additional Notes
Verification of All Acceptance Criteria:
✅ AC1: SVN Repository Detection & Basic Integration - Implemented with workspace detection
✅ AC2: SVN Commit Search & History - Full XML parsing with revision and message search
✅ AC3: SVN Status & Change Detection - Real-time status via
@svn-changes
mention✅ AC4: Untracked Files Preview - Shows first 3 files with smart file detection
✅ AC5: SVN Version References & Mentions - Supports
r123
and123
formats✅ AC6: Debug & Diagnostics - Comprehensive
debugSvn
command with dedicated output channel✅ AC7: Error Handling - User-friendly messages with guided troubleshooting
✅ AC8: Test Coverage - 18 comprehensive test cases covering all functionality
✅ AC9: Integration Patterns - Follows existing mention and webview patterns
✅ AC10: Extension Activation - Proper workspace initialization and command registration
Performance Considerations:
Future Enhancements Ready:
Get in Touch
Discord Username: [charmmy_51908]
Important
Adds SVN support with commit search, status integration, and debugging capabilities, alongside comprehensive error handling and logging.
.svn
directory detection and integration into VS Code workspace.svn.ts
.@svn-changes
mention.r123
and123
revision mentions for automatic commit info retrieval.debugSvn
command for SVN debugging inregisterCommands.ts
.SvnErrorHandler
for user-friendly error messages and troubleshooting.SvnLogger
for comprehensive SVN debug logging.svn.spec.ts
to cover SVN functionalities.ChatTextArea.tsx
andContextMenu.tsx
to handle SVN mentions and display commit information..svn/
inexcludes.ts
andfile-search.ts
for file operations.This description was created by
for 0015192. You can customize this summary. It will automatically update as commits are pushed.