SVN-like version control engine in Rust (library + CLI).
- SQLite working-copy database (
.vcrs/wc.db) with SVN-inspired tables:nodes(BASE/WORKING split)actual_node(text/prop mods, conflict markers, tree-conflicts)wc_lock,work_queuerevisions(numericrNmodel)ignore_rules,externals,file_props
- Commit/update/status/diff/revert with revision-aware behavior
- Out-of-date commit protection (
base rNvshead rN) - 3-way merge baseline with conflict artifacts:
.mine,.rOLD,.rNEW
- Properties (
prop-set,prop-get,prop-del) - Ignore rules (
ignore add/list) and externals metadata (externals set/list) - Log by range with verbose changed paths (
log -r N:M -v) - HTTP server on Actix (
serve-http) with SVN/WebDAV-compatible discovery/report and commit activity skeleton- supports
MKACTIVITY/CHECKOUT/PUT/PROPPATCH/MERGE - supports
svndiffdecode/apply inPUT(SVN\\0/\\1stream) - supports
update-reportreplay skeleton withtxdeltapayloads
- supports
Binary: vcrs
vcrs init .
vcrs checkout http://127.0.0.1:3690/svn/demo ./demo
vcrs switch http://127.0.0.1:3690/svn/other
vcrs pull
vcrs push
vcrs status
vcrs staged
vcrs diff
vcrs diff --path src/main.rs
vcrs cat src/main.rs@5
vcrs stage src/main.rs README.md
vcrs unstage README.md
vcrs stage-all
vcrs stage-clear
vcrs hunks src/main.rs
vcrs stage-hunks src/main.rs 0 2
vcrs unstage-hunks src/main.rs 2
vcrs commit -m "message" --author "you"
vcrs commit -m "message" --author "you" --all
vcrs commit -m "message" --author "you" --push
vcrs log --limit 20
vcrs log -r 1:10 -v
vcrs log -r 1:HEAD --include-merged
vcrs changed -r 7
vcrs blame src/main.rs
vcrs blame src/main.rs -r 7
vcrs update -r HEAD
vcrs revert [optional/path ...]
vcrs merge -r 7 [--dry-run] [--record-only]
vcrs lock path/to/file
vcrs unlock path/to/file
vcrs copy src/lib.rs src/lib_copy.rs
vcrs move src/old.rs src/new.rs
vcrs prop-set --path src/main.rs --name svn:eol-style --value LF
vcrs prop-get --path src/main.rs --name svn:eol-style
vcrs prop-del --path src/main.rs --name svn:eol-style
vcrs iprop-set --scope trunk --name svn:global-ignores --value target
vcrs iprop-list
vcrs changelist set src/main.rs ui
vcrs changelist clear src/main.rs
vcrs changelist list
vcrs ignore add "*.tmp"
vcrs ignore list
vcrs externals set vendor/lib https://example.com/svn/lib --revision 123
vcrs externals list
vcrs serve-http --repo . --host 127.0.0.1 --port 3690Common aliases:
vcrs checkout->vcrs covcrs status->vcrs stvcrs diff->vcrs divcrs commit->vcrs civcrs update->vcrs up
vcrs supports an explicit staging area stored in .vcrs/client-stage-index.json.
stage [paths ...]stages one or more changed pathsunstage [paths ...]removes paths from the staging areastage-allstages all current changesstage-clearclears the staging area completelystagedshows only staged changeshunks <path>lists per-file diff hunks and marks staged ones with*stage-hunks <path> <indices...>stages selected hunks for a fileunstage-hunks <path> <indices...>removes selected hunks from the staged setcommit -m ...commits staged changes by defaultcommit --all -m ...bypasses the staging area and commits all working-copy changescommit --push -m ...pushes after a successful commit
- Working copy and remotes:
init,checkout,switch,pull,push - Local file operations:
copy,move,revert,lock,unlock - Inspection:
status,staged,diff,cat,log,changed,blame,hunks - History and integration:
commit,update,merge - Properties and grouping:
prop-set,prop-get,prop-del,iprop-set,iprop-list,changelist set|clear|list - Metadata rules:
ignore add|list,externals set|list - Server mode:
serve-http
serve-http exposes a partial SVN/DAV compatibility layer intended as a foundation.
Read/discovery/report paths are implemented first; full interoperability with a stock svn client
for all write operations requires additional DeltaV/SVN wire semantics.
use version_control_rs::Client;
fn demo() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::discover(".")?;
let status = client.status()?;
if !status.is_empty() {
let commit = client.commit("sync", "alice")?;
println!("new revision: r{}", commit.revision);
}
Ok(())
}- Repository metadata is stored in
.vcrs/ - Content-addressed blobs (
blake3) are stored under.vcrs/objects/ - Commits are JSON documents under
.vcrs/commits/ - SQLite WC database:
.vcrs/wc.db - Numeric revisions are tracked in WC DB (
revisionstable) and linked to commit IDs.
Apache 2.0