Skip to content

NavAI-B/svn-scm

 
 

Repository files navigation

Subversion source control for VS Code (Modified)

This is a modified version of johnstoncode.svn-scm with some additional features I need for my work, and the project dependencies have been updated to make building easier in newer versions of VSCode and Node.js.

What's Different

1. Ignore VSCode Exclude Rules

Two new settings allow you to bypass VSCode's built-in file exclusion rules, so SVN can manage files that VSCode or other tools normally hides:

  • svn.sourceControl.ignoreFilesExclude — Ignore VSCode's files.exclude settings. Useful when development tools (e.g., Unity) hide certain files (like .meta files) in the explorer but you still need to manage them in SVN.
  • svn.sourceControl.ignoreSearchExclude — Ignore VSCode's search.exclude settings.

2. SVN Command Hooks

A new simple hook system allows you to run custom commands before or after SVN operations. This is especially useful for tools like Unity that generate companion files (e.g., .meta files) that must be managed alongside the original files.

Setting: svn.hooks.commands

Each hook entry has:

  • hook — Timing + command name, e.g., preAdd, postAdd, preRemove, postRemove, preCommit, postCommit, preRevert, postRevert, preUpdate, postUpdate
  • command — The shell command to execute. Supports variable substitution.

Supported Variables:

Variable Description
$(svn) Full svn executable path
$(file) Full file path
$(fileName) File name with extension
$(fileBaseName) File name without extension
$(fileExt) File extension (with dot)
$(fileDir) Directory of the file
$(files) All file paths (space-separated, quoted)
$(cwd) Working directory

Example (Unity .meta file auto management):

"svn.hooks.commands": [
    {
        "hook": "postAdd",
        "command": "\"$(svn)\" add \"$(file).meta\""
    },
    {
        "hook": "preRemove",
        "command": "\"$(svn)\" del \"$(file).meta\""
    }
]

3. Localization (i18n)

Full Chinese (zh-cn) translation support for all settings and commands. VSCode will automatically display the appropriate language based on your locale setting.

4. AI Commit Message Generation

Generate commit messages using AI (GitHub Copilot or other VS Code Language Model providers). Click the ✨ button in the SCM title bar or run SVN: Generate Commit Message (AI) from the command palette.

Settings:

Setting Description
svn.ai.enabled Enable/disable AI commit message generation (default: true)
svn.ai.model Specify model in vendor/family format (e.g., copilot/gpt-4o). Leave empty for auto-select.
svn.ai.prompt Custom prompt template. Use {diff} for diff content and {language} for VS Code locale.

Commands:

  • SVN: Generate Commit Message (AI) — Generate and fill commit message
  • SVN: Select AI Model — Choose which language model to use

5. Staging Area (Virtual Changelist)

A Git-like staging workflow for SVN. Stage specific files before committing instead of using a file picker popup. Staged files are persisted across sessions.

Commands:

  • SVN: Stage — Stage a file for commit
  • SVN: Unstage — Unstage a file
  • SVN: Stage All — Stage all changes
  • SVN: Unstage All — Unstage all files

Behavior:

  • Commit uses staged files directly (no popup)
  • Staged files persist across VS Code sessions via workspace state

6. File Decoration & Status Badges

Colored status letters in the SCM view and explorer/editor tabs, consistent with Git behavior:

  • SCM View — Shows colored status letters (M, A, D, C, etc.) instead of SVG icons
  • Explorer & Editor Tabs — File decoration badges show SVN status with colors

7. SCM Graph Integration

Integrated with VS Code's built-in Source Control Graph view. Commit history is displayed directly in the SCM sidebar with full diff support.

8. Timeline Integration

File history is displayed in VS Code's native Timeline panel (Explorer sidebar). Right-click any SVN-managed file and select "Open Timeline" to view its commit history with:

  • Auto-follow editor — Timeline automatically updates when switching files
  • Pagination — Built-in scroll-to-load-more support
  • Diff viewing — Click any commit to open a diff view
  • Markdown tooltips — Rich hover information with author, date, message, and file stats
  • Context menu — Open specific revision, copy revision number, copy message

9. Incoming Changes View

Remote changes are shown in a dedicated Incoming Changes tree view under the SCM sidebar (instead of an SCM resource group), with:

  • Tree/List toggle — Switch between folder tree and flat list view (svn.incomingChanges.treeView)
  • Pull individual files — Update selected incoming changes without a full svn update
  • Refresh — Manually refresh incoming changes

GitHub Workflow Status (with branch) semantic-release

CodeQL Security Scan GitHub Security

Prerequisites

Note: This extension leverages your machine's SVN installation,
so you need to install SVN first.

Windows

If you use TortoiseSVN, make sure the option Command Line Tools is checked during installation and C:\Program Files\TortoiseSVN\bin is available in PATH.

Feedback & Contributing

  • Please report any bugs, suggestions or documentation requests via the Issues
  • Feel free to submit pull requests

Features

Checkout

You can checkout a SVN repository with the SVN: Checkout command in the Command Palette (Ctrl+Shift+P). You will be asked for the URL of the repository and the parent directory under which to put the local repository.


  • Source Control View
  • Quick Diffs in gutter
  • Status Bar
  • Create changelists
  • Add files
  • Revert edits
  • Remove files
  • Create branches
  • Switch branches
  • Create patches
  • Diff changes
  • Commit changes/changelists
  • See commit messages

Blame / Annotate

Right-click a file in the Explorer and select SVN: Blame (Annotate) to open an inline blame view in a new tab.

  • Line coloring — Each revision group gets a distinct background color for easy visual scanning
  • Revision & Author — Version numbers and author names displayed in the gutter area
  • Hover tooltips — Hover any line to see revision details with quick-action links
  • Trace history — Right-click to "Trace previous revision" or "Trace from previous revision" and navigate through blame history

Commands:

  • SVN: Blame (Annotate) — Open blame view for a file
  • SVN: Clear Blame — Close blame view
  • SVN: Trace Previous Revision — (Blame view only) Blame up to the selected line's revision
  • SVN: Trace From Previous Revision — (Blame view only) Blame up to one revision before the selected line's revision

Settings

Here are all of the extension settings with their default values. To change any of these, add the relevant Config key and value to your VSCode settings.json file. Alternatively search for the config key in the settings UI to change its value.

{
  // Whether auto refreshing is enabled
  "svn.autorefresh": true,

  // Select all files when commit changes
  "svn.commit.changes.selectedAll": true,

  // Check empty message before commit
  "svn.commit.checkEmptyMessage": true,

  // Set file to status resolved after fix conflicts
  "svn.conflicts.autoResolve": null,

  // Encoding of svn output if the output is not utf-8. When this parameter is null, the encoding is automatically detected. Example: 'windows-1252'.
  "svn.default.encoding": null,

  // The default location to checkout a svn repository.
  "svn.defaultCheckoutDirectory": null,

  // When a file is deleted, what SVN should do? `none` - Do nothing, `prompt` - Ask the action, `remove` - automatically remove from SVN
  "svn.delete.actionForDeletedFiles": "prompt"  // values: ["none","prompt","remove"],

  // Ignored files/rules for `svn.delete.actionForDeletedFiles`(Ex.: file.txt or **/*.txt)
  "svn.delete.ignoredRulesForDeletedFiles": [],

  // Controls whether to automatically detect svn externals.
  "svn.detectExternals": true,

  // Controls whether to automatically detect svn on ignored folders.
  "svn.detectIgnored": true,

  // Show diff changes using latest revision in the repository. Set false to use latest revision in local folder
  "svn.diff.withHead": true,

  // Whether svn is enabled
  "svn.enabled": true,

  // Try the experimental encoding detection
  "svn.experimental.detect_encoding": null,

  // Priority of encoding
  "svn.experimental.encoding_priority": [],

  // Url for the gravitar icon using the <AUTHOR>, <AUTHOR_MD5> and <SIZE> placeholders
  "svn.gravatar.icon_url": "https://www.gravatar.com/avatar/<AUTHOR_MD5>.jpg?s=<SIZE>&d=robohash",

  // Use garavatar icons in log viewers
  "svn.gravatars.enabled": true,

  // Ignores the warning when SVN is missing
  "svn.ignoreMissingSvnWarning": null,

  // List of SVN repositories to ignore.
  "svn.ignoreRepositories": null,

  // Ignores the warning when working copy is too old
  "svn.ignoreWorkingCopyIsTooOld": null,

  // Regex to detect path for 'branches' in SVN URL, 'null' to disable. Subpath use 'branches/[^/]+/([^/]+)(/.*)?' (Ex.: 'branches/...', 'versions/...')
  "svn.layout.branchesRegex": "branches/([^/]+)(/.*)?",

  // Regex group position for name of branch
  "svn.layout.branchesRegexName": 1,

  // Set true to show 'branches/<name>' and false to show only '<name>'
  "svn.layout.showFullName": true,

  // Regex group position for name of tag
  "svn.layout.tagRegexName": 1,

  // Regex to detect path for 'tags' in SVN URL, 'null' to disable. Subpath use 'tags/[^/]+/([^/]+)(/.*)?'. (Ex.: 'tags/...', 'stamps/...')
  "svn.layout.tagsRegex": "tags/([^/]+)(/.*)?",

  // Regex to detect path for 'trunk' in SVN URL, 'null' to disable. (Ex.: '(trunk)', '(main)')
  "svn.layout.trunkRegex": "(trunk)(/.*)?",

  // Regex group position for name of trunk
  "svn.layout.trunkRegexName": 1,

  // Number of commit messages to log
  "svn.log.length": 50,

  // Maximum depth to find subfolders using SVN
  "svn.multipleFolders.depth": 4,

  // Allow to find subfolders using SVN
  "svn.multipleFolders.enabled": null,

  // Folders to ignore using SVN
  "svn.multipleFolders.ignore": ["**/.git","**/.hg","**/vendor","**/node_modules"],

  // Path to the svn executable
  "svn.path": null,

  // Only show previous commits for a given user. Requires svn >= 1.8
  "svn.previousCommitsUser": null,

  // Refresh remote changes on refresh command
  "svn.refresh.remoteChanges": null,

  // Set the interval in seconds to check changed files on remote repository and show in statusbar. 0 to disable
  "svn.remoteChanges.checkFrequency": 300,

  // Show the output window when the extension starts
  "svn.showOutput": null,

  // Show the update message when update is run
  "svn.showUpdateMessage": true,

  // Set left click functionality on changes resource state
  "svn.sourceControl.changesLeftClick": "open diff"  // values: ["open","open diff"],

  // Combine the svn external in the main if is from the same server.
  "svn.sourceControl.combineExternalIfSameServer": null,

  // Allow to count unversioned files in status count
  "svn.sourceControl.countUnversioned": true,

  // Hide unversioned files in Source Control UI
  "svn.sourceControl.hideUnversioned": null,

  // Ignore unversioned files like .gitignore, Configuring this will overlook the default ignore rule
  "svn.sourceControl.ignore": [],

  // Changelists to ignore on commit
  "svn.sourceControl.ignoreOnCommit": ["ignore-on-commit"],

  // Changelists to ignore on status count
  "svn.sourceControl.ignoreOnStatusCount": ["ignore-on-commit"],

  // Set to ignore externals definitions on update (add --ignore-externals)
  "svn.update.ignoreExternals": true
}

About

SVN support for VS Code (Modified, more like Git extension)

Resources

License

Contributing

Stars

1 star

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages

  • TypeScript 96.2%
  • SCSS 2.6%
  • Other 1.2%