/
View dependency graph
Depends on
- dh-cargo (dh-sequence-cargo)
- rust-lazy-static (librust-lazy-static-1+default-dev)
- rust-pyo3 (librust-pyo3-0.28+default-dev)
- rust-rustc-hash (librust-rustc-hash-2+default-dev)
- cargo, debhelper-compat, libstd-rust-dev, rustc
README (full)
vcs-graph
Graph algorithms for version control systems.
vcs-graph provides building blocks used by version control tools: topological
sorting (including merge-aware sorting that preserves branch structure),
parent-map manipulation, least common ancestor queries, and related
operations. It is the Rust core behind the vcsgraph Python
package, originally extracted from the Breezy version control system.
Features
TopoSorter— iterative topological sort of a parent graph.MergeSorter— merge-aware topological sort that assigns revision numbers and tracks merge depth, suitable for rendering commit history.ParentMap/ChildMap— parent/child map types with utilities likeinvert_parent_mapandcollapse_linear_regions.ParentsProvidertrait withDictParentsProviderandStackedParentsProviderimplementations.- Optional
pyo3feature for exposing these types to Python.
Example
use std::collections::HashMap;
use vcs_graph::tsort::TopoSorter;
let graph: HashMap<&str, Vec<&str>> = HashMap::from([
("A", vec![]),
("B", vec!["A"]),
("C", vec!["A"]),
("D", vec!["B", "C"]),
]);
let sorted = TopoSorter::new(graph.into_iter()).sorted().unwrap();
// Parents always come before children.
License
GPL-2.0-or-later. See COPYING.txt in the repository root.
| dir | debian/ |
| dir | src/ |
| file | .cargo_vcs_info.json |
| file | Cargo.lock |
| file | Cargo.toml |
| file | Cargo.toml.orig |
| file | README.md |