https://github.com/freaky/rust-svnlook
A Rust interface to the svnlook command
https://github.com/freaky/rust-svnlook
Last synced: 10 months ago
JSON representation
A Rust interface to the svnlook command
- Host: GitHub
- URL: https://github.com/freaky/rust-svnlook
- Owner: Freaky
- License: mit
- Created: 2018-12-17T15:59:01.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-04-18T03:21:17.000Z (about 6 years ago)
- Last Synced: 2025-01-13T07:32:08.882Z (over 1 year ago)
- Language: Rust
- Size: 43 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# NAME
`rust-svnlook` - a Rusty interface to the `svnlook` command
## SYNOPSIS
```rust
// Equivalent to svnlook::Svnlook::from("svnlook").repository("/path/to/repo");
let repo = svnlook::Repository::from("/path/to/repo");
let latest = repo.youngest()?;
for rev in 1..latest {
let info = repo.info(rev)?;
let changed = repo.changed(rev)?;
println!(
"Revision r{}, by {} at {}",
info.revision, info.committer, info.date
);
for change in changed {
let change = change?;
print!(" {:.8}: ", change.status);
if let svnlook::SvnStatus::Copied(from) = change.status {
print!("{}@r{} -> ", from.path.display(), from.revision);
}
println!("{}", change.path.display());
println!("File contents:");
println!("==============================");
std::io::copy(&mut repo.cat(rev, change.path)?, std::io::stdout())?;
println!("==============================");
}
println!("Revision diff:");
println!("==============================");
std::io::copy(&mut repo.diff().revision(rev).spawn()?, std::io::stdout())?;
println!("==============================");
}
```
## DESCRIPTION
`rust-svnlook` provides a (hopefully) robust, typed, and convenient interface
to examining a local Subversion repository using the `svnlook` command.
The `changed` command offers a streaming iterator, converting lines read from
svnlook into structs. `diff` and `cat` provide a streaming `BufRead`
implementation.
Both check the command exits successfully on EOF to minimise the risk of missing
an erroring command, and can be dropped safely at any point: unlike `Command`,
their `Drop` implementation will reap the child process and silently swallow
any error.
## SEE ALSO
* [Apache Subversion](https://subversion.apache.org/)
* [svnlook](http://svnbook.red-bean.com/en/1.7/svn.ref.svnlook.html)
* At least it isn't [CVS](https://www.nhs.uk/conditions/cyclical-vomiting-syndrome/)
## AUTHORS
Thomas Hurst