Skip to content

Commit 5ae210f

Browse files
committed
Migrate to gleisbau 0.7.2
1 parent 8247c1e commit 5ae210f

4 files changed

Lines changed: 20 additions & 14 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: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,16 @@
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

12+
use crate::print::svg::print_svg;
1213
use clap::ArgMatches;
1314
use clap::{crate_version, Arg, Command};
1415
use git2::Repository;
15-
use gleisbau::config::{
16-
create_config, get_available_models, get_model, get_model_name, set_model,
17-
};
16+
use gleisbau::config::{create_config, get_available_models, get_model, get_model_name, set_model};
1817
use gleisbau::get_repo;
19-
use gleisbau::graph::GitGraph;
18+
use gleisbau::graph::Builder as GraphBuilder;
2019
use gleisbau::print::format::CommitFormat;
21-
use gleisbau::print::svg::print_svg;
2220
use gleisbau::print::unicode::print_unicode;
2321
use gleisbau::settings::{
2422
BranchOrder, BranchSettings, BranchSettingsDef, Characters, MergePatterns, Settings,
@@ -621,7 +619,14 @@ fn run(
621619
refspecs: Vec<String>,
622620
) -> Result<(), String> {
623621
let now = Instant::now();
624-
let graph = GitGraph::new(repository, settings, None, max_commits, refspecs)?;
622+
let mut graph_builder = GraphBuilder::new()
623+
.with_repository(repository)
624+
.with_settings(settings)
625+
.with_refspecs(refspecs);
626+
if let Some(max_commits) = max_commits {
627+
graph_builder = graph_builder.with_max_count(max_commits);
628+
}
629+
let graph = graph_builder.build()?;
625630

626631
let duration_graph = now.elapsed().as_micros();
627632

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)