/
View dependency graph
Depends on
- dh-cargo (dh-sequence-cargo)
- rust-chrono (librust-chrono-0.4+default-dev)
- rust-lazy-regex (librust-lazy-regex-3+default-dev)
- rust-lazy-static (librust-lazy-static-1+default-dev)
- rust-once-cell (librust-once-cell-1+default-dev)
- rust-rowan (librust-rowan-0.16+default-dev)
- cargo, debhelper-compat, librust-proc-macro2-1+default-dev, librust-regex-1+default-dev, libstd-rust-dev, rustc
Used by
README (full)
Parsing and manipulation of patch files
This crate provides support for parsing and editing of unified diff files, as well as related files (e.g. quilt).
Features
- Traditional parsing: Parse patch files into structured data
- Lossless parsing (new): Parse patch files while preserving all formatting and whitespace using the
editmodule
Example
use patchkit::edit;
let patch_text = r#"--- a/file.txt
+++ b/file.txt
@@ -1,3 +1,3 @@
line 1
-line 2
+line 2 modified
line 3
"#;
let parsed = edit::parse(patch_text);
let patch = parsed.tree();
for patch_file in patch.patch_files() {
for hunk in patch_file.hunks() {
for line in hunk.lines() {
if let Some(text) = line.text() {
println!("{}", text);
}
}
}
}
| dir | .github/ |
| dir | debian/ |
| dir | examples/ |
| dir | src/ |
| dir | test_patches_data/ |
| file | .cargo_vcs_info.json |
| file | .codespellrc |
| file | .gitignore |
| file | Cargo.lock |
| file | Cargo.toml |
| file | Cargo.toml.orig |
| file | README.md |
| file | TODO |
| file | disperse.conf |
| file | logo.webp |