handle repo init errors

[?]
Sep 12, 2025, 2:30 PM
KF2LDB5YIXMXBZK6KJWJOLJL66TN2KDXPH3NKEGGCQ5EVOZB77BQC

Dependencies

  • [2] 6YZAVBWU Initial commit
  • [3] OQ6HSAWH show record log
  • [4] JE44NYHM display log files diffs
  • [5] OPXFZKEB view tests setup
  • [6] ACDXXAX2 refactor main's updates into smaller fns
  • [7] FVA36HBV restart repo manager task if it crashes
  • [8] I56UGW7U make record test, fix log update
  • [9] UF5NJKAS test load repo
  • [10] VOFP2YNQ prettify
  • [11] Z3GSXIOR fix view tests
  • [12] PTWZYQFR use nav-scrollable for repo status
  • [13] A6Z4O6RC actions menu
  • [14] JZXYSIYD channel selection!
  • [15] WAOGSCOJ very nice refactor, wip adding channels logs
  • [16] EJPSD5XO shared allowed actions conditions between update and view
  • [17] AZ5D2LQU allow to set record description
  • [18] PKLUHYE4 allow to copy change hash
  • [19] CULHFNIV add error report view
  • [20] U3EAZKHR allow to copy error report
  • [21] DXAYDIMQ update to latest pijul
  • [22] 3XRG4BB6 rewritten nav-scrollable!
  • [23] HOJZI52Y rename flowers_ui to inflorescence
  • [24] KEPKF3WO unify diffs handling, simplify view
  • [25] UR4J677R nav for log changes and refactors
  • [26] SWWE2R6M display basic repo stuff
  • [27] 6F7Q4ZLR avoid unused warns
  • [28] 7SSBM4UQ view: refactor repo view
  • [29] KWTBNTO3 diffs selection and scrolling
  • [30] YBJRDOTC make all repo actions async
  • [31] 23SFYK4Q big view refactor into a new crate
  • [32] WH57EHNM update tests
  • [*] VCNKFNUF app init test

Change contents

  • replacement in libflorescence/src/repo.rs at line 74
    [15.583][15.583:623]()
    #[derive(Debug, Clone, strum::Display)]
    [15.583]
    [15.623]
    #[derive(Debug, strum::Display)]
  • edit in libflorescence/src/repo.rs at line 77
    [15.658]
    [15.658]
    InitFailed(LoadError),
  • replacement in libflorescence/src/repo.rs at line 192
    [4.263][9.909:926]()
    #[derive(Debug)]
    [3.252]
    [9.926]
    #[derive(Debug, Error)]
  • replacement in libflorescence/src/repo.rs at line 194
    [9.947][9.947:1016]()
    DoesntExist,
    NotPijulRepo,
    Inaccessible(std::io::Error),
    [9.947]
    [9.1016]
    #[error("The path to repository {0:?} doesn't exit")]
    DoesntExist(String),
    #[error("The path {0:?} doesn't contain a Pijul repository")]
    NotPijulRepo(String),
    #[error("The path to repository {0:?} is not accessible: {1}")]
    Inaccessible(String, std::io::Error),
  • replacement in libflorescence/src/repo.rs at line 220
    [9.1441][9.1441:1541]()
    Err(_err) => {
    // let _ = msg_out_tx.send(MsgOut::CannotLoad{err, msg_in_rx}));
    [9.1441]
    [9.1541]
    Err(err) => {
    let _ = msg_out_tx.send(MsgOut::InitFailed(err));
  • replacement in libflorescence/src/repo.rs at line 229
    [12.138][12.138:253]()
    Ok(false) => return Err(LoadError::DoesntExist),
    Err(e) => return Err(LoadError::Inaccessible(e)),
    [12.138]
    [12.253]
    Ok(false) => {
    return Err(LoadError::DoesntExist(
    path.to_string_lossy().to_string(),
    ))
    }
    Err(e) => {
    return Err(LoadError::Inaccessible(
    path.to_string_lossy().to_string(),
    e,
    ))
    }
  • replacement in libflorescence/src/repo.rs at line 241
    [12.259][12.259:364]()
    let repo = pijul::Repository::find_root(Some(path))
    .map_err(|_e| LoadError::NotPijulRepo)?;
    [12.259]
    [12.364]
    let repo = pijul::Repository::find_root(Some(path)).map_err(|_e| {
    LoadError::NotPijulRepo(path.to_string_lossy().to_string())
    })?;
  • replacement in libflorescence/src/repo/test.rs at line 23
    [9.2350][9.2350:2422]()
    assert_matches!(result.unwrap_err(), repo::LoadError::DoesntExist);
    [9.2350]
    [9.2422]
    assert_matches!(result.unwrap_err(), repo::LoadError::DoesntExist(_));
  • replacement in libflorescence/src/repo/test.rs at line 31
    [9.2595][9.2595:2668]()
    assert_matches!(result.unwrap_err(), repo::LoadError::NotPijulRepo);
    [9.2595]
    [10.284]
    assert_matches!(result.unwrap_err(), repo::LoadError::NotPijulRepo(_));
  • replacement in libflorescence/src/repo/test.rs at line 47
    [9.3246][9.3246:3326]()
    assert_matches!(result.unwrap_err(), repo::LoadError::Inaccessible(_));
    [9.3246]
    [9.3326]
    assert_matches!(
    result.unwrap_err(),
    repo::LoadError::Inaccessible(_, _)
    );
  • edit in justfile at line 44
    [2.450]
    [8.1052]
    cargo run --bin inflorescence-view-test-setup
  • replacement in justfile at line 69
    [5.141][5.141:200]()
    cargo run --bin inflorescence-view-test-setup && \
    [5.141]
    [11.19]
    cargo run --bin inflorescence-view-test-setup
  • replacement in inflorescence_view/src/view.rs at line 54
    [15.3942][19.176:226]()
    // TODO: show report in load and other states
    [15.3942]
    [15.3942]
    // TODO: show report `SubState::SelectingId`
  • replacement in inflorescence_view/src/view.rs at line 56
    [15.3970][15.3970:4030]()
    SubState::Loading { .. } => el(text("Loading...")),
    [15.3970]
    [15.4030]
    SubState::Loading { .. } => {
    let main = el(container(text("Loading..."))
    .width(Length::Fill)
    .height(Length::Fill));
    let actions_inner = column([]).spacing(4);
    let actions_inner =
    actions_inner.push(view_actions(allowed_actions));
    let actions = el(container(actions_inner)
    .class(theme::Container::ActionsBg)
    .width(Length::Fill)
    .height(Length::Shrink)
    .padding(Padding::from([2, 5])));
    let main = overlay_report(main, report, window_size);
    el(column([main, actions]))
    }
  • replacement in inflorescence_view/src/view.rs at line 965
    [19.327][19.327:380]()
    let main = report::view(report, main, |report| {
    [19.327]
    [19.380]
    let main = overlay_report(main, report, &window_size);
    el(column([main, actions]))
    }
    fn overlay_report<'a>(
    overlaid: Element<'a, Msg, Theme>,
    report: &'a report::Container,
    window_size: &iced::Size,
    ) -> Element<'a, Msg, Theme> {
    report::view(report, overlaid, |report| {
  • replacement in inflorescence_view/src/view.rs at line 994
    [19.1009][19.1009:1211]()
    el(
    container(column(report.entries.iter().map(view_report_entry)))
    .padding([4, 6])
    .class(theme::Container::Report),
    ),
    [19.1009]
    [19.1211]
    el(container(column(
    report.entries.iter().rev().map(view_report_entry),
    ))
    .padding([4, 6])
    .class(theme::Container::Report)),
  • replacement in inflorescence_view/src/view.rs at line 1003
    [19.1332][19.1332:1340](),[19.1340][13.2241:2274](),[14.7502][13.2241:2274](),[13.2241][13.2241:2274]()
    });
    el(column([main, actions]))
    [19.1332]
    [19.1341]
    })
  • replacement in inflorescence/src/test.rs at line 972
    [8.5211][8.5211:5335]()
    // Upate state with the msg received from task to init the repo
    let task = update(&mut state, msg.clone());
    [8.5211]
    [8.5335]
    let is_init = matches!(&msg, Msg::FromRepo(repo::MsgOut::Init(_))); // Upate state with the msg received from task to init the repo
    let task = update(&mut state, msg);
  • replacement in inflorescence/src/test.rs at line 976
    [8.5336][8.5336:5402]()
    if matches!(&msg, Msg::FromRepo(repo::MsgOut::Init(_))) {
    [8.5336]
    [8.5402]
    if is_init {
  • replacement in inflorescence/src/main.rs at line 75
    [18.1925][18.1925:1949]()
    #[derive(Debug, Clone)]
    [18.1925]
    [18.1949]
    #[derive(Debug)]
  • replacement in inflorescence/src/main.rs at line 165
    [7.226][7.226:321](),[7.321][17.9799:9873](),[17.9873][7.389:451](),[15.81092][7.389:451](),[7.389][7.389:451]()
    info!("Starting a new task to manage repo");
    let (task, repo_tx_in) =
    start_task_to_manage_repo(state.model.repo_path.clone());
    state.repo_tx_in = repo_tx_in;
    task
    [7.226]
    [16.24173]
    Task::none()
  • edit in inflorescence/src/main.rs at line 639
    [6.1008]
    [15.86299]
    repo::MsgOut::InitFailed(err) => {
    report::show_err(&mut state.model.report, err.to_string());
    Task::none()
    }
  • edit in iced_expl_widget/src/report.rs at line 26
    [19.8399]
    [19.8399]
    /// Entries in insert order. For display use reverse iterator to start with
    /// most recent ones.
  • replacement in iced_expl_widget/src/report.rs at line 310
    [20.1414][20.1414:1450]()
    report.entries.iter().for_each(
    [20.1414]
    [20.1450]
    report.entries.iter().rev().for_each(
  • edit in iced_expl_widget/src/report.rs at line 325
    [20.1802]
    [20.1802]
    }
    pub fn show_err(report: &mut Container, msg: String) {
    report.hidden = false;
    report.entries.push(Entry {
    level: Level::Error,
    msg,
    time: Timestamp::now(),
    is_read: false,
    });