Skip to content

Commit 755bae5

Browse files
committed
Migrate to gleisbau 0.7.2
1 parent 32a9b69 commit 755bae5

4 files changed

Lines changed: 19 additions & 11 deletions

File tree

‎Cargo.lock‎

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ platform-dirs = "0.3"
3434
crossterm = {version = "0.29", optional = false}
3535
chrono = {version = "0.4", optional = false}
3636
textwrap = {version = "0.16", default-features = false, optional = false, features = ["unicode-width"]}
37-
gleisbau = "0.7.1"
37+
gleisbau = "0.7.2"

‎src/main.rs‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// TODO remove code once gleisbau API has stabilized
88
// Some of these features might return to the CLI tool (this application)
99
//mod config;
10-
//mod print;
10+
mod print;
1111

1212
use clap::ArgMatches;
1313
use clap::{crate_version, Arg, Command};
@@ -16,9 +16,9 @@ use gleisbau::config::{
1616
create_config, get_available_models, get_model, get_model_name, set_model,
1717
};
1818
use gleisbau::get_repo;
19-
use gleisbau::graph::GitGraph;
19+
use gleisbau::graph::Builder as GraphBuilder;
2020
use gleisbau::print::format::CommitFormat;
21-
use gleisbau::print::svg::print_svg;
21+
use crate::print::svg::print_svg;
2222
use gleisbau::print::unicode::print_unicode;
2323
use gleisbau::settings::{
2424
BranchOrder, BranchSettings, BranchSettingsDef, Characters, MergePatterns, Settings,
@@ -621,7 +621,14 @@ fn run(
621621
refspecs: Vec<String>,
622622
) -> Result<(), String> {
623623
let now = Instant::now();
624-
let graph = GitGraph::new(repository, settings, None, max_commits, refspecs)?;
624+
let mut graph_builder = GraphBuilder::new()
625+
.with_repository(repository)
626+
.with_settings(settings)
627+
.with_refspecs(refspecs);
628+
if let Some(max_commits) = max_commits {
629+
graph_builder = graph_builder.with_max_count(max_commits);
630+
}
631+
let graph = graph_builder.build()?;
625632

626633
let duration_graph = now.elapsed().as_micros();
627634

‎src/print/mod.rs‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
use gleisbau::graph::GitGraph;
44
use std::cmp::max;
55

6-
pub mod colors;
7-
pub mod format;
6+
// TODO remove code once gleisbau API has stabilized
7+
// Some of these features might return to the CLI tool (this application)
8+
//pub mod colors;
9+
//pub mod format;
810
pub mod svg;
9-
pub mod unicode;
11+
//pub mod unicode;
1012

1113
/// Find the index at which a between-branch connection
1214
/// has to deviate from the current branch's column.

0 commit comments

Comments
 (0)