Codumentor logo Codumentor

SVN Plugin

The SVN plugin adds Subversion repository support: it checks out (or updates) SVN working copies before ingestion and registers an SCM adapter for branch listing and switching.

Requirements

The svn CLI must be installed as a system package. It cannot be installed via pip/uv.

Ubuntu/Debian:  sudo apt-get install subversion
Fedora/RHEL:    sudo dnf install subversion
macOS:          brew install subversion
Windows:        winget install TortoiseSVN.TortoiseSVN  (or SlikSVN / VisualSVN)

A RuntimeError with installation instructions is raised at runtime if svn is not found.

Configuration

Plugin registration

plugins:
  - module: codumentor.plugins.svn
    class: SvnPlugin

Repository entries

Add SVN repos to the repos list with scm: svn:

repos:
  - scm: svn
    url: https://svn.example.com/repos/myproject
    name: myproject

  # With authentication
  - scm: svn
    url: https://svn.example.com/repos/internal
    name: internal
    options:
      username: ${SVN_USER}
      password: ${SVN_PASS}

  # Pinned to a specific revision
  - scm: svn
    url: https://svn.example.com/repos/legacy
    name: legacy
    commit: "4200"

Options

OptionDescription
usernameSVN username. Supports ${ENV_VAR} expansion.
passwordSVN password. Supports ${ENV_VAR} expansion.
revisionRevision to check out (alternative to commit).

commit (top-level repo field) or options.revision both pin the working copy to a specific revision.

What the plugin does

Checkout/update — Before ingestion, the plugin runs svn checkout for new working copies or svn update for existing ones. A 300-second timeout applies.

Branch listing — Discovers trunk (or Trunk) and all entries under branches/ via svn list. Returns names relative to the project prefix (e.g. trunk, branches/feature-x).

Branch switching — Runs svn switch <url> to update the working copy to a different branch.

Branch diff — Uses svn diff --summarize between two refs to return lists of modified, added, and deleted files.

Multi-project repos — Supports SVN repositories where multiple projects share a single repository root (e.g. https://svn.example.com/front/WS/FrontWS1.3.1/trunk). The plugin derives the project prefix automatically and exposes short branch names.

Credentials

Credentials supplied via options.username/options.password are passed to every SVN network command with --username/--password. SVN also caches credentials in ~/.subversion/auth/ after the first successful checkout, so subsequent operations work even without re-supplying them.

Troubleshooting

RuntimeError: The 'svn' command-line tool is not installed — Install subversion via your OS package manager (see Requirements above).

SVN command failed — Check the error message for authentication failures or network issues. Verify the url is reachable and credentials are correct.

Branch list shows only ["trunk"] — The svn list call for branches/ may have failed (network issue or non-standard layout). Check logs for list_branches failed warnings.