handle repo init errors
[?]
Sep 12, 2025, 2:30 PM
KF2LDB5YIXMXBZK6KJWJOLJL66TN2KDXPH3NKEGGCQ5EVOZB77BQCDependencies
- [2]
6YZAVBWUInitial commit - [3]
OQ6HSAWHshow record log - [4]
JE44NYHMdisplay log files diffs - [5]
OPXFZKEBview tests setup - [6]
ACDXXAX2refactor main's updates into smaller fns - [7]
FVA36HBVrestart repo manager task if it crashes - [8]
I56UGW7Umake record test, fix log update - [9]
UF5NJKAStest load repo - [10]
VOFP2YNQprettify - [11]
Z3GSXIORfix view tests - [12]
PTWZYQFRuse nav-scrollable for repo status - [13]
A6Z4O6RCactions menu - [14]
JZXYSIYDchannel selection! - [15]
WAOGSCOJvery nice refactor, wip adding channels logs - [16]
EJPSD5XOshared allowed actions conditions between update and view - [17]
AZ5D2LQUallow to set record description - [18]
PKLUHYE4allow to copy change hash - [19]
CULHFNIVadd error report view - [20]
U3EAZKHRallow to copy error report - [21]
DXAYDIMQupdate to latest pijul - [22]
3XRG4BB6rewritten nav-scrollable! - [23]
HOJZI52Yrename flowers_ui to inflorescence - [24]
KEPKF3WOunify diffs handling, simplify view - [25]
UR4J677Rnav for log changes and refactors - [26]
SWWE2R6Mdisplay basic repo stuff - [27]
6F7Q4ZLRavoid unused warns - [28]
7SSBM4UQview: refactor repo view - [29]
KWTBNTO3diffs selection and scrolling - [30]
YBJRDOTCmake all repo actions async - [31]
23SFYK4Qbig view refactor into a new crate - [32]
WH57EHNMupdate tests - [*]
VCNKFNUFapp init test
Change contents
- replacement in libflorescence/src/repo.rs at line 74
#[derive(Debug, Clone, strum::Display)]#[derive(Debug, strum::Display)] - edit in libflorescence/src/repo.rs at line 77
InitFailed(LoadError), - replacement in libflorescence/src/repo.rs at line 192
#[derive(Debug)]#[derive(Debug, Error)] - replacement in libflorescence/src/repo.rs at line 194
DoesntExist,NotPijulRepo,Inaccessible(std::io::Error),#[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
Err(_err) => {// let _ = msg_out_tx.send(MsgOut::CannotLoad{err, msg_in_rx}));Err(err) => {let _ = msg_out_tx.send(MsgOut::InitFailed(err)); - replacement in libflorescence/src/repo.rs at line 229
Ok(false) => return Err(LoadError::DoesntExist),Err(e) => return Err(LoadError::Inaccessible(e)),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
let repo = pijul::Repository::find_root(Some(path)).map_err(|_e| LoadError::NotPijulRepo)?;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
assert_matches!(result.unwrap_err(), repo::LoadError::DoesntExist);assert_matches!(result.unwrap_err(), repo::LoadError::DoesntExist(_)); - replacement in libflorescence/src/repo/test.rs at line 31
assert_matches!(result.unwrap_err(), repo::LoadError::NotPijulRepo);assert_matches!(result.unwrap_err(), repo::LoadError::NotPijulRepo(_)); - replacement in libflorescence/src/repo/test.rs at line 47
assert_matches!(result.unwrap_err(), repo::LoadError::Inaccessible(_));assert_matches!(result.unwrap_err(),repo::LoadError::Inaccessible(_, _)); - edit in justfile at line 44
cargo run --bin inflorescence-view-test-setup - replacement in justfile at line 69
cargo run --bin inflorescence-view-test-setup && \cargo run --bin inflorescence-view-test-setup - replacement in inflorescence_view/src/view.rs at line 54
// TODO: show report in load and other states// TODO: show report `SubState::SelectingId` - replacement in inflorescence_view/src/view.rs at line 56
SubState::Loading { .. } => el(text("Loading...")),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
let main = report::view(report, main, |report| {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
el(container(column(report.entries.iter().map(view_report_entry))).padding([4, 6]).class(theme::Container::Report),),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]))}) - replacement in inflorescence/src/test.rs at line 972
// Upate state with the msg received from task to init the repolet task = update(&mut state, msg.clone());let is_init = matches!(&msg, Msg::FromRepo(repo::MsgOut::Init(_))); // Upate state with the msg received from task to init the repolet task = update(&mut state, msg); - replacement in inflorescence/src/test.rs at line 976
if matches!(&msg, Msg::FromRepo(repo::MsgOut::Init(_))) {if is_init { - replacement in inflorescence/src/main.rs at line 75
#[derive(Debug, Clone)]#[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;taskTask::none() - edit in inflorescence/src/main.rs at line 639
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
/// 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
report.entries.iter().for_each(report.entries.iter().rev().for_each( - edit in iced_expl_widget/src/report.rs at line 325
}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,});