Async Rust SVN client for Subversion svn://, svn+ssh://, and ra_svn workflows.
svn-rs is an async Subversion client library for Rust. It talks to
svnserve over svn://, optionally tunnels svn+ssh://, and exposes
ra_svn read, report/editor, lock, and commit APIs. It is not a working copy
implementation.
- Async-first
RaSvnClientandRaSvnSession - Subversion
svn://support, plus optionalsvn+ssh:// ra_svnread operations, report/editor drives, locks, revision property updates, and low-level commit support- Structured server errors with code, message, file, line, and command context
- Optional
serde,cyrus-sasl, andsshfeatures
[dependencies]
svn = "0.1"
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }Optional features:
svn = { version = "0.1", features = ["serde", "ssh", "cyrus-sasl"] }use std::time::Duration;
use svn::{RaSvnClient, SvnUrl};
#[tokio::main]
async fn main() -> svn::Result<()> {
let url = SvnUrl::parse("svn://example.com/repo")?;
let client = RaSvnClient::new(url, None, None)
.with_connect_timeout(Duration::from_secs(10))
.with_read_timeout(Duration::from_secs(30))
.with_write_timeout(Duration::from_secs(30));
let mut session = client.open_session().await?;
let head = session.get_latest_rev().await?;
println!("HEAD = {head}");
Ok(())
}- Read: revisions, files, directories, logs, locations, mergeinfo, properties, file revs, locks
- Report/editor flows:
update,switch,status,diff,replay,replay-range - Write: revision property changes, lock/unlock, and commit editor commands
Not included:
- Working copy management
- Native TLS for
svn:// - Full OpenSSH feature parity
Built-in svn:// mechanisms:
ANONYMOUSPLAINCRAM-MD5
cyrus-sasl enables Cyrus SASL auth and negotiated SASL security layers.
ssh enables svn+ssh:// by running svnserve -t over SSH.
Examples live in examples/:
readonlyget_filelistexportlog_retrycommitlockssshsasl
Run tests:
cargo test --all-featuresInterop tests against a real svnserve:
SVN_INTEROP=1 cargo test --all-features --test interop_svnserve -- --nocaptureAPI docs: https://docs.rs/svn