error handling for repo actions

[?]
Sep 16, 2025, 6:39 PM
IFQPVMBD552DZ3B5HCM6W6MI2SB6576ZYJNU5KVA3O4YPZAUEFHAC

Dependencies

  • [2] 6YZAVBWU Initial commit
  • [3] KLR5FRIB add fs state read/write of repos
  • [4] SWWE2R6M display basic repo stuff
  • [5] UB2ITZJS refresh changed files on FS changes
  • [6] EC3TVL4X add untracked files
  • [7] KT5UYXGK fix selection after adding file, add changed file diffs
  • [8] ELG3UDT6 allow to rm added files
  • [9] W7IUT3ZV start recording impl
  • [10] YBJRDOTC make all repo actions async
  • [11] A5YBC77V record!
  • [12] UCBNZULE make changed files paths optional (no path for root)
  • [13] 4WO3ZJM2 show untracked files' contents
  • [14] W4LFX7IH group diffs by file name
  • [15] PTFDJ567 add untracked files encoding
  • [16] AMPZ2BXK show changed files diffs (only Edit atm)
  • [17] RPCIGCNS add replacement diff details
  • [18] Y6LXBCJB update toolchain and rust edition
  • [19] OQ6HSAWH show record log
  • [20] WI2BVQ6J rm client lib crate
  • [21] AHWWRC73 navigate log entries
  • [22] JE44NYHM display log files diffs
  • [23] ONRCENKT rm unnecessary state from repo's internal state
  • [24] 4ELJZGRJ load and store all change diffs at once
  • [25] VCNKFNUF app init test
  • [26] ACDXXAX2 refactor main's updates into smaller fns
  • [27] I56UGW7U make record test, fix log update
  • [28] X6AK4QPX finish recording test
  • [29] YYKXNBFL test: add untracked file
  • [30] 5CYU7UT7 test: rm added file
  • [31] ESMM3FEL test selection reindexing
  • [32] UF5NJKAS test load repo
  • [33] SWDPAGF6 test channel name
  • [34] KQ3P3QRL update comments
  • [35] FL2ULDJN test record
  • [36] 2LWMGRUM test diff
  • [37] QYDWH7KB test add and rm
  • [38] 5FVZF7XX test changed files
  • [39] B6YUTY3Q test untracked files
  • [40] F542TMBE test log
  • [41] DXAYDIMQ update to latest pijul
  • [42] KWTBNTO3 diffs selection and scrolling
  • [43] PTWZYQFR use nav-scrollable for repo status
  • [44] JZXYSIYD channel selection!
  • [45] 5ZRDYL6K fork channel, fix recording esc key
  • [46] OJPGHVC3 entire log!
  • [47] WAOGSCOJ very nice refactor, wip adding channels logs
  • [48] WH57EHNM update tests
  • [49] PSKE5G36 view description of change
  • [50] AZ5D2LQU allow to set record description
  • [51] KF2LDB5Y handle repo init errors
  • [52] KMB6FND3 test view update fn rather than direct fn calls
  • [53] ZIUHKVJK update tests
  • [54] OC6DLIZ3 test record when nothing to record
  • [55] I2AG42PA new cols layout
  • [56] XHWLKCLD auto-scroll past skip sections on load
  • [57] PKLUHYE4 allow to copy change hash
  • [58] A6Z4O6RC actions menu
  • [59] YK3MOJJL chonky refactor, wip other channels logs & diffs

Change contents

  • replacement in libflorescence/src/testing.rs at line 79
    [33.671][36.55:102]()
    repo::add(&mut repo, DEFAULT_IGNORE_FILE);
    [33.671]
    [33.749]
    repo::add(&mut repo, DEFAULT_IGNORE_FILE).unwrap();
  • replacement in libflorescence/src/testing.rs at line 85
    [34.323][50.5:73]()
    repo::record(&internal, "Initialized".to_string(), None, skey);
    [34.323]
    [25.1856]
    repo::record(&internal, "Initialized".to_string(), None, skey).unwrap();
  • replacement in libflorescence/src/testing.rs at line 87
    [25.1857][47.5:68]()
    let log = repo::get_log(&internal.repo, None, None, None);
    [25.1857]
    [35.98]
    let log = repo::get_log(&internal.repo, None, None, None).unwrap();
  • replacement in libflorescence/src/repo.rs at line 77
    [47.658][51.40:67]()
    InitFailed(LoadError),
    [47.658]
    [47.658]
    InitFailed(String),
  • replacement in libflorescence/src/repo.rs at line 79
    [47.674][47.674:696]()
    state: State,
    [47.674]
    [47.696]
    state: anyhow::Result<State>,
  • edit in libflorescence/src/repo.rs at line 83
    [47.759]
    [47.759]
    result: anyhow::Result<()>,
  • edit in libflorescence/src/repo.rs at line 87
    [47.808]
    [47.808]
    result: anyhow::Result<()>,
  • replacement in libflorescence/src/repo.rs at line 92
    [47.884][47.884:913]()
    diffs: ChangedFiles,
    [47.884]
    [47.913]
    diffs: anyhow::Result<ChangedFiles>,
  • replacement in libflorescence/src/repo.rs at line 94
    [47.920][47.920:946]()
    LoadedEntireLog(Log),
    [47.920]
    [47.946]
    LoadedEntireLog(anyhow::Result<Log>),
  • replacement in libflorescence/src/repo.rs at line 97
    [47.999][47.999:1017]()
    log: Log,
    [47.999]
    [47.1017]
    log: anyhow::Result<Log>,
  • replacement in libflorescence/src/repo.rs at line 212
    [41.262][32.1082:1127](),[32.1082][32.1082:1127]()
    Ok((mut internal_state, state)) => {
    [41.262]
    [32.1127]
    Ok((mut internal_state, Ok(state))) => {
  • edit in libflorescence/src/repo.rs at line 221
    [32.1431]
    [32.1431]
    }
    Ok((_, Err(err))) => {
    let _ = msg_out_tx.send(MsgOut::InitFailed(err.to_string()));
  • replacement in libflorescence/src/repo.rs at line 226
    [51.401][51.401:463]()
    let _ = msg_out_tx.send(MsgOut::InitFailed(err));
    [51.401]
    [32.1541]
    let _ = msg_out_tx.send(MsgOut::InitFailed(err.to_string()));
  • replacement in libflorescence/src/repo.rs at line 231
    [43.9][43.9:81]()
    pub fn load(path: &Path) -> Result<(InternalState, State), LoadError> {
    [43.9]
    [43.81]
    pub fn load(
    path: &Path,
    ) -> Result<(InternalState, anyhow::Result<State>), LoadError> {
  • replacement in libflorescence/src/repo.rs at line 273
    [10.1911][23.353:383]()
    let state: State;
    [10.1911]
    [23.383]
    let state: anyhow::Result<State>;
  • replacement in libflorescence/src/repo.rs at line 289
    [27.225][23.612:666](),[10.2442][23.612:666](),[23.666][27.226:281](),[27.281][23.715:746](),[23.715][23.715:746]()
    internal_state = spawn_blocking(move || {
    add(&mut internal_state, &path_clone);
    internal_state
    [27.225]
    [10.2549]
    let result: anyhow::Result<()>;
    (internal_state, result) = spawn_blocking(move || {
    let result = add(&mut internal_state, &path_clone);
    (internal_state, result)
  • replacement in libflorescence/src/repo.rs at line 296
    [10.2606][27.282:356]()
    let _ = msg_out_tx.send(MsgOut::AddedUntrackedFile { path });
    [10.2606]
    [10.2606]
    let _ =
    msg_out_tx.send(MsgOut::AddedUntrackedFile { result, path });
  • replacement in libflorescence/src/repo.rs at line 301
    [27.400][23.747:801](),[10.2657][23.747:801](),[23.801][27.401:455](),[27.455][23.849:880](),[23.849][23.849:880]()
    internal_state = spawn_blocking(move || {
    rm(&mut internal_state, &path_clone);
    internal_state
    [27.400]
    [10.2763]
    let result: anyhow::Result<()>;
    (internal_state, result) = spawn_blocking(move || {
    let result = rm(&mut internal_state, &path_clone);
    (internal_state, result)
  • replacement in libflorescence/src/repo.rs at line 308
    [10.2820][27.456:525]()
    let _ = msg_out_tx.send(MsgOut::RmedAddedFile { path });
    [10.2820]
    [10.2820]
    let _ = msg_out_tx.send(MsgOut::RmedAddedFile { result, path });
  • replacement in libflorescence/src/repo.rs at line 311
    [50.151][27.526:556](),[11.760][27.526:556]()
    let state: State;
    [50.151]
    [27.556]
    let state: anyhow::Result<State>;
  • replacement in libflorescence/src/repo.rs at line 313
    [27.619][50.152:208](),[50.208][27.620:730](),[23.985][27.620:730]()
    record(&internal_state, msg, desc, sk);
    // Update state after making a record
    let state = get_state(&internal_state);
    [27.619]
    [27.730]
    let state = |internal_state: &InternalState| {
    record(internal_state, msg, desc, sk)?;
    // Update state after making a record
    get_state(internal_state)
    };
    let state = state(&internal_state);
  • replacement in libflorescence/src/repo.rs at line 329
    [24.185][24.185:222]()
    let diffs: ChangedFiles;
    [24.185]
    [23.1017]
    let diffs: anyhow::Result<ChangedFiles>;
  • edit in libflorescence/src/repo.rs at line 331
    [23.1080][24.223:328]()
    let change =
    internal_state.repo.changes.get_change(&hash).unwrap();
  • replacement in libflorescence/src/repo.rs at line 332
    [24.356][23.1257:1331](),[22.668][23.1257:1331]()
    changed_files(&change, &internal_state.repo.changes);
    [24.356]
    [23.1332]
    get_change_diffs(hash, &internal_state).context(format!(
    "Getting change with the hash {}",
    hash_to_string(&hash)
    ));
  • replacement in libflorescence/src/repo.rs at line 344
    [44.198][44.198:228]()
    let state: State;
    [44.198]
    [44.228]
    let state: anyhow::Result<State>;
  • replacement in libflorescence/src/repo.rs at line 346
    [44.291][44.291:409]()
    switch_to_channel(&mut internal_state, name);
    let state = get_state(&internal_state);
    [44.291]
    [44.409]
    let state = |internal_state: &mut InternalState| {
    switch_to_channel(internal_state, name)?;
    get_state(internal_state)
    };
    let state = state(&mut internal_state);
  • replacement in libflorescence/src/repo.rs at line 361
    [45.70][45.70:100]()
    let state: State;
    [45.70]
    [45.100]
    let state: anyhow::Result<State>;
  • replacement in libflorescence/src/repo.rs at line 363
    [45.163][45.163:276]()
    fork_channel(&mut internal_state, name);
    let state = get_state(&internal_state);
    [45.163]
    [45.276]
    let state = |internal_state: &mut InternalState| {
    fork_channel(internal_state, name)?;
    get_state(internal_state)
    };
    let state = state(&mut internal_state);
  • replacement in libflorescence/src/repo.rs at line 378
    [46.97][46.97:123]()
    let log: Log;
    [46.97]
    [46.123]
    let log: anyhow::Result<Log>;
  • replacement in libflorescence/src/repo.rs at line 389
    [47.1851][47.1851:1877]()
    let log: Log;
    [47.1851]
    [47.1877]
    let log: anyhow::Result<Log>;
  • replacement in libflorescence/src/repo.rs at line 411
    [42.471][23.1569:1616](),[23.1569][23.1569:1616]()
    fn get_state(state: &InternalState) -> State {
    [23.1569]
    [23.1616]
    fn get_state(state: &InternalState) -> anyhow::Result<State> {
  • replacement in libflorescence/src/repo.rs at line 416
    [23.1773][23.1773:1814](),[23.1814][44.570:617](),[44.617][23.1814:1890](),[23.1814][23.1814:1890](),[23.1890][13.264:325](),[9.295][13.264:325]()
    let channel = current_channel(repo);
    let other_channels = other_channels(repo);
    let diff = diff(repo);
    let untracked_files = untracked_files(repo);
    let changed_files = changed_files(&diff, &repo.changes);
    [23.1773]
    [19.301]
    let channel = current_channel(repo)?;
    let other_channels = other_channels(repo)?;
    let diff = diff(repo)?;
    let untracked_files = untracked_files(repo)?;
    let changed_files = changed_files(&diff, &repo.changes)?;
  • replacement in libflorescence/src/repo.rs at line 422
    [19.359][47.2459:2519](),[46.460][23.1931:1943](),[27.850][23.1931:1943](),[47.2519][23.1931:1943](),[23.1931][23.1931:1943]()
    let log = get_log(repo, Some(&channel), offset, limit);
    State {
    [19.359]
    [23.1943]
    let log = get_log(repo, Some(&channel), offset, limit)?;
    Ok(State {
  • replacement in libflorescence/src/repo.rs at line 430
    [19.414][4.893:899](),[47.2544][4.893:899](),[4.893][4.893:899]()
    }
    [47.2544]
    [5.7]
    })
  • replacement in libflorescence/src/repo.rs at line 437
    [4.1020][10.3221:3278](),[10.3278][44.643:719]()
    fn current_channel(repo: &pijul::Repository) -> String {
    let txn = repo.pristine.txn_begin().unwrap();
    txn.current_channel()
    [4.1020]
    [4.1232]
    fn current_channel(repo: &pijul::Repository) -> anyhow::Result<String> {
    let txn = repo.pristine.txn_begin()?;
    Ok(txn
    .current_channel()
  • replacement in libflorescence/src/repo.rs at line 442
    [4.1275][4.1275:1296]()
    .to_string()
    [4.1275]
    [44.720]
    .to_string())
  • replacement in libflorescence/src/repo.rs at line 446
    [44.774][44.774:885]()
    fn other_channels(repo: &pijul::Repository) -> Vec<String> {
    let txn = repo.pristine.txn_begin().unwrap();
    [44.774]
    [44.885]
    fn other_channels(repo: &pijul::Repository) -> anyhow::Result<Vec<String>> {
    let txn = repo.pristine.txn_begin()?;
  • replacement in libflorescence/src/repo.rs at line 449
    [44.960][44.960:999]()
    txn.channels("")
    .unwrap()
    [44.960]
    [44.999]
    let channels = txn
    .channels("")?
  • replacement in libflorescence/src/repo.rs at line 457
    [44.1205][44.1205:1224]()
    .collect()
    [44.1205]
    [4.1296]
    .collect();
    Ok(channels)
  • replacement in libflorescence/src/repo.rs at line 461
    [4.1299][44.1225:1289]()
    fn switch_to_channel(state: &mut InternalState, name: String) {
    [4.1299]
    [44.1289]
    fn switch_to_channel(
    state: &mut InternalState,
    name: String,
    ) -> anyhow::Result<()> {
  • replacement in libflorescence/src/repo.rs at line 466
    [44.1317][44.1317:1420]()
    let current_channel = current_channel(repo);
    let txn = repo.pristine.arc_txn_begin().unwrap();
    [44.1317]
    [44.1420]
    let current_channel = current_channel(repo)?;
    let txn = repo.pristine.arc_txn_begin()?;
  • replacement in libflorescence/src/repo.rs at line 470
    [44.1454][44.1454:1470]()
    return;
    [44.1454]
    [44.1470]
    return Ok(());
  • replacement in libflorescence/src/repo.rs at line 475
    [44.1590][44.1590:1646]()
    txn.load_channel(&current_channel).unwrap()
    [44.1590]
    [44.1646]
    txn.load_channel(&current_channel)?
  • replacement in libflorescence/src/repo.rs at line 478
    [44.1696][44.1696:1770]()
    && has_unrecorded_changes(txn.clone(), channel.clone(), repo)
    [44.1696]
    [44.1770]
    && has_unrecorded_changes(txn.clone(), channel.clone(), repo)?
  • replacement in libflorescence/src/repo.rs at line 481
    [44.1859][44.1859:1879]()
    return;
    [44.1859]
    [44.1879]
    return Ok(());
  • replacement in libflorescence/src/repo.rs at line 485
    [44.1896][44.1896:1949](),[44.1949][45.447:474]()
    txn.write().set_current_channel(&name).unwrap();
    txn.commit().unwrap();
    [44.1896]
    [45.474]
    txn.write().set_current_channel(&name)?;
    txn.commit()?;
    Ok(())
  • replacement in libflorescence/src/repo.rs at line 490
    [45.477][45.477:536]()
    fn fork_channel(state: &mut InternalState, name: String) {
    [45.477]
    [45.536]
    fn fork_channel(state: &mut InternalState, name: String) -> anyhow::Result<()> {
  • replacement in libflorescence/src/repo.rs at line 492
    [45.564][45.564:801](),[45.801][44.1949:1976](),[44.1949][44.1949:1976]()
    let current_channel = current_channel(repo);
    let mut txn = repo.pristine.mut_txn_begin().unwrap();
    let channel = txn.load_channel(&current_channel).unwrap().unwrap();
    let _fork = txn.fork(&channel, name.trim()).unwrap();
    txn.commit().unwrap();
    [45.564]
    [44.1976]
    let current_channel = current_channel(repo)?;
    let mut txn = repo.pristine.mut_txn_begin()?;
    let channel = txn
    .load_channel(&current_channel)?
    .context("Loading current channel")?;
    let _fork = txn.fork(&channel, name.trim())?;
    txn.commit()?;
    Ok(())
  • replacement in libflorescence/src/repo.rs at line 552
    [50.320][50.320:324]()
    ) {
    [50.320]
    [9.361]
    ) -> anyhow::Result<()> {
  • replacement in libflorescence/src/repo.rs at line 554
    [9.389][11.871:912](),[11.912][9.431:485](),[9.431][9.431:485]()
    let channel = current_channel(repo);
    let txn = repo.pristine.arc_txn_begin().unwrap();
    [9.389]
    [9.485]
    let channel = current_channel(repo)?;
    let txn = repo.pristine.arc_txn_begin()?;
  • replacement in libflorescence/src/repo.rs at line 557
    [9.486][11.913:984]()
    let channel = txn.read().load_channel(&channel).unwrap().unwrap();
    [9.486]
    [9.561]
    let channel = txn
    .read()
    .load_channel(&channel)?
    .context("Loading current channel")?;
  • replacement in libflorescence/src/repo.rs at line 563
    [9.646][9.646:708]()
    let (h, c) = txn.read().hash_from_prefix(h).unwrap();
    [9.646]
    [9.708]
    let (h, c) = txn.read().hash_from_prefix(h)?;
  • replacement in libflorescence/src/repo.rs at line 566
    [9.743][9.743:834]()
    .get_changeset(txn.read().changes(&*channel.read()), &c)
    .unwrap()
    [9.743]
    [9.834]
    .get_changeset(txn.read().changes(&*channel.read()), &c)?
  • replacement in libflorescence/src/repo.rs at line 588
    [11.1312][11.1312:1476]()
    txn.write()
    .apply_root_change_if_needed(
    &repo.changes,
    &channel,
    rand::thread_rng(),
    )
    .unwrap();
    [11.1312]
    [11.1476]
    txn.write().apply_root_change_if_needed(
    &repo.changes,
    &channel,
    rand::thread_rng(),
    )?;
  • replacement in libflorescence/src/repo.rs at line 595
    [11.1526][11.1526:1873]()
    state
    .record(
    txn.clone(),
    pijul::Algorithm::default(),
    false,
    &pijul::DEFAULT_SEPARATOR,
    channel.clone(),
    &repo.working_copy,
    &repo.changes,
    "",
    1, // std::thread::available_parallelism()?.get(),
    )
    .unwrap();
    [11.1526]
    [11.1873]
    state.record(
    txn.clone(),
    pijul::Algorithm::default(),
    false,
    &pijul::DEFAULT_SEPARATOR,
    channel.clone(),
    &repo.working_copy,
    &repo.changes,
    "",
    1, // std::thread::available_parallelism()?.get(),
    )?;
  • replacement in libflorescence/src/repo.rs at line 615
    [11.2093][11.2093:2248]()
    .map(|rec| rec.globalize(&*txn_).unwrap())
    .collect();
    let contents = Arc::try_unwrap(rec.contents).unwrap().into_inner();
    [11.2093]
    [11.2248]
    .map(|rec| {
    let res = rec.globalize(&*txn_)?;
    Ok(res)
    })
    .collect::<anyhow::Result<Vec<_>>>()?;
    let contents = Arc::into_inner(rec.contents)
    .context(
    "Failed to get unique strong reference on change contents",
    )?
    .into_inner();
  • replacement in libflorescence/src/repo.rs at line 632
    [11.2424][11.2424:2453]()
    )
    .unwrap();
    [11.2424]
    [11.2453]
    )?;
  • replacement in libflorescence/src/repo.rs at line 640
    [11.2685][11.2685:3043]()
    let hash = repo
    .changes
    .save_change(&mut change, |change, hash| {
    change.unhashed = Some(serde_json::json!({
    "signature": sk.sign_raw(&hash.to_bytes()).unwrap(),
    }));
    Ok::<_, pijul::changestore::filesystem::Error>(())
    })
    .unwrap();
    [11.2685]
    [9.1096]
    let hash = repo.changes.save_change(&mut change, |change, hash| {
    change.unhashed = Some(serde_json::json!({
    "signature": sk.sign_raw(&hash.to_bytes()).unwrap(),
    }));
    Ok::<_, pijul::changestore::filesystem::Error>(())
    })?;
  • replacement in libflorescence/src/repo.rs at line 647
    [9.1097][11.3044:3142]()
    txn_.apply_local_change(&channel, &change, &hash, &rec.updatables)
    .unwrap();
    [9.1097]
    [11.3142]
    txn_.apply_local_change(&channel, &change, &hash, &rec.updatables)?;
  • replacement in libflorescence/src/repo.rs at line 650
    [11.3230][11.3230:3279]()
    std::fs::create_dir_all(&path).unwrap();
    [11.3230]
    [11.3279]
    std::fs::create_dir_all(&path)?;
  • replacement in libflorescence/src/repo.rs at line 654
    [11.3336][11.3336:3421]()
    .duration_since(std::time::SystemTime::UNIX_EPOCH)
    .unwrap()
    [11.3336]
    [11.3421]
    .duration_since(std::time::SystemTime::UNIX_EPOCH)?
  • replacement in libflorescence/src/repo.rs at line 662
    [11.3755][11.3755:3848]()
    .duration_since(std::time::SystemTime::UNIX_EPOCH)
    .unwrap()
    [11.3755]
    [11.3848]
    .duration_since(std::time::SystemTime::UNIX_EPOCH)?
  • replacement in libflorescence/src/repo.rs at line 668
    [11.3983][11.3983:4010]()
    txn.commit().unwrap();
    [11.3983]
    [9.1170]
    txn.commit()?;
    Ok(())
  • replacement in libflorescence/src/repo.rs at line 672
    [9.1173][10.3328:3372](),[10.3372][4.1393:1447](),[4.1393][4.1393:1447]()
    fn diff(repo: &pijul::Repository) -> Diff {
    let txn = repo.pristine.arc_txn_begin().unwrap();
    [9.1173]
    [4.1447]
    fn diff(repo: &pijul::Repository) -> anyhow::Result<Diff> {
    let txn = repo.pristine.arc_txn_begin()?;
  • replacement in libflorescence/src/repo.rs at line 680
    [4.1582][4.1582:1659]()
    let channel = txn.write().open_or_create_channel(&cur_channel).unwrap();
    [4.1582]
    [4.1659]
    let channel = txn.write().open_or_create_channel(&cur_channel)?;
  • replacement in libflorescence/src/repo.rs at line 683
    [4.1709][4.1709:2058]()
    state
    .record(
    txn.clone(),
    pijul::Algorithm::default(),
    false,
    &pijul::DEFAULT_SEPARATOR,
    channel.clone(),
    &repo.working_copy,
    &repo.changes,
    "",
    std::thread::available_parallelism().unwrap().get(),
    )
    .unwrap();
    [4.1709]
    [4.2058]
    state.record(
    txn.clone(),
    pijul::Algorithm::default(),
    false,
    &pijul::DEFAULT_SEPARATOR,
    channel.clone(),
    &repo.working_copy,
    &repo.changes,
    "",
    std::thread::available_parallelism()?.get(),
    )?;
  • replacement in libflorescence/src/repo.rs at line 700
    [4.2193][4.2193:2271]()
    .map(|rec| rec.globalize(&*txn_).unwrap())
    .collect()
    [4.2193]
    [4.2271]
    .map(|rec| {
    let res = rec.globalize(&*txn_)?;
    Ok(res)
    })
    .collect::<anyhow::Result<Vec<_>>>()?
  • replacement in libflorescence/src/repo.rs at line 707
    [4.2279][4.2279:2357]()
    let contents = std::sync::Arc::try_unwrap(rec.contents)
    .unwrap()
    [4.2279]
    [4.2357]
    let contents = std::sync::Arc::into_inner(rec.contents)
    .context("Failed to get unique strong reference on change contents")?
  • replacement in libflorescence/src/repo.rs at line 718
    [4.2556][4.2556:2577]()
    )
    .unwrap();
    [4.2556]
    [4.2577]
    )?;
  • replacement in libflorescence/src/repo.rs at line 725
    [4.2770][4.2770:2798]()
    )
    .unwrap()
    [4.2770]
    [4.2798]
    )?
  • replacement in libflorescence/src/repo.rs at line 729
    [4.2883][4.2883:2894]()
    change
    [4.2883]
    [4.2894]
    Ok(change)
  • replacement in libflorescence/src/repo.rs at line 733
    [10.3438][33.2900:2964](),[33.2964][7.635:762](),[10.3498][7.635:762](),[7.635][7.635:762]()
    pub fn add(repo: &mut pijul::Repository, file_path_str: &str) {
    let txn = repo.pristine.arc_txn_begin().unwrap();
    let repo_path = CanonicalPathBuf::canonicalize(&repo.path).unwrap();
    [10.3438]
    [12.38]
    pub fn add(
    repo: &mut pijul::Repository,
    file_path_str: &str,
    ) -> anyhow::Result<()> {
    let txn = repo.pristine.arc_txn_begin()?;
    let repo_path = CanonicalPathBuf::canonicalize(&repo.path)?;
  • replacement in libflorescence/src/repo.rs at line 745
    [7.866][7.866:983]()
    let path = CanonicalPathBuf::canonicalize(full_path).unwrap();
    let meta = std::fs::metadata(&path).unwrap();
    [7.866]
    [7.983]
    let path = CanonicalPathBuf::canonicalize(full_path)?;
    let meta = std::fs::metadata(&path)?;
  • replacement in libflorescence/src/repo.rs at line 761
    [8.148][7.1474:1523](),[10.3809][7.1474:1523](),[7.1474][7.1474:1523]()
    if !txn.is_tracked(&path_str).unwrap() {
    [10.3809]
    [7.1523]
    if !txn.is_tracked(&path_str)? {
  • replacement in libflorescence/src/repo.rs at line 763
    [7.1590][18.121:179]()
    panic!("Failed to track file with: {e}");
    [7.1590]
    [7.1640]
    bail!("Failed to track file with: {e}");
  • replacement in libflorescence/src/repo.rs at line 766
    [10.3888][10.3888:3965]()
    panic!("Won't add file \"{path_str}\" as it's already tracked");
    [10.3888]
    [7.1654]
    bail!("Won't add file \"{path_str}\" as it's already tracked");
  • replacement in libflorescence/src/repo.rs at line 769
    [8.155][8.155:182]()
    txn.commit().unwrap();
    [8.155]
    [8.182]
    txn.commit()?;
    Ok(())
  • replacement in libflorescence/src/repo.rs at line 774
    [10.4031][10.4031:4090]()
    fn rm(repo: &mut pijul::Repository, file_path_str: &str) {
    [10.4031]
    [10.4090]
    fn rm(repo: &mut pijul::Repository, file_path_str: &str) -> anyhow::Result<()> {
  • replacement in libflorescence/src/repo.rs at line 776
    [10.4137][8.243:301](),[8.243][8.243:301]()
    let mut txn = repo.pristine.mut_txn_begin().unwrap();
    [10.4137]
    [10.4138]
    let mut txn = repo.pristine.mut_txn_begin()?;
  • replacement in libflorescence/src/repo.rs at line 779
    [10.4265][8.527:616](),[8.527][8.527:616]()
    if txn.is_tracked(&path_str).unwrap() {
    txn.remove_file(&path_str).unwrap();
    [10.4265]
    [7.1664]
    if txn.is_tracked(&path_str)? {
    txn.remove_file(&path_str)?;
  • replacement in libflorescence/src/repo.rs at line 782
    [7.1670][7.1670:1697]()
    txn.commit().unwrap();
    [7.1670]
    [7.1697]
    txn.commit()?;
    Ok(())
    }
    fn get_change_diffs(
    hash: ChangeHash,
    internal_state: &InternalState,
    ) -> anyhow::Result<ChangedFiles> {
    let change = internal_state.repo.changes.get_change(&hash)?;
    changed_files(&change, &internal_state.repo.changes)
  • replacement in libflorescence/src/repo.rs at line 794
    [7.1700][14.260:335]()
    fn changed_files(diff: &Diff, repo_changes: &FileSystem) -> ChangedFiles {
    [7.1700]
    [14.335]
    fn changed_files(
    diff: &Diff,
    repo_changes: &FileSystem,
    ) -> anyhow::Result<ChangedFiles> {
  • replacement in libflorescence/src/repo.rs at line 874
    [16.553][13.1089:1202](),[13.1089][13.1089:1202]()
    get_change_contents(repo_changes, change, &diff.contents)
    .unwrap();
    [16.553]
    [16.554]
    get_change_contents(repo_changes, change, &diff.contents)?;
  • replacement in libflorescence/src/repo.rs at line 892
    [17.574][17.574:687]()
    get_change_contents(repo_changes, change, &diff.contents)
    .unwrap();
    [17.574]
    [17.687]
    get_change_contents(repo_changes, change, &diff.contents)?;
  • replacement in libflorescence/src/repo.rs at line 900
    [17.969][17.969:1014]()
    )
    .unwrap();
    [17.969]
    [17.1014]
    )?;
  • replacement in libflorescence/src/repo.rs at line 947
    [14.3130][14.3130:3142]()
    changes
    [14.3130]
    [6.574]
    Ok(changes)
  • replacement in libflorescence/src/repo.rs at line 950
    [6.577][6.577:842]()
    fn untracked_files(repo: &pijul::Repository) -> BTreeSet<String> {
    let repo_path = CanonicalPathBuf::canonicalize(&repo.path).unwrap();
    let txn = repo.pristine.arc_txn_begin().unwrap();
    let threads = std::thread::available_parallelism().unwrap().get();
    [6.577]
    [6.842]
    fn untracked_files(
    repo: &pijul::Repository,
    ) -> anyhow::Result<BTreeSet<String>> {
    let repo_path = CanonicalPathBuf::canonicalize(&repo.path)?;
    let txn = repo.pristine.arc_txn_begin()?;
    let threads = std::thread::available_parallelism()?.get();
  • replacement in libflorescence/src/repo.rs at line 968
    [6.1243][6.1243:1582]()
    )
    .unwrap()
    .filter_map(move |path| {
    let (path, _) = path.unwrap();
    use path_slash::PathExt;
    let path_str = path.to_slash_lossy();
    if !txn_.read().is_tracked(&path_str).unwrap() {
    Some(path_str.into_owned())
    } else {
    None
    [6.1243]
    [6.1582]
    )?
    .filter_map(move |path| match path {
    Err(e) => Some(Err(anyhow::Error::from(e))),
    Ok((path, _)) => {
    use path_slash::PathExt;
    let path_str = path.to_slash_lossy();
    let is_tracked = match txn_.read().is_tracked(&path_str) {
    Ok(is_tracked) => is_tracked,
    Err(e) => return Some(Err(anyhow::Error::from(e))),
    };
    if !is_tracked {
    Some(Ok(path_str.into_owned()))
    } else {
    None
    }
  • replacement in libflorescence/src/repo.rs at line 993
    [19.507][19.507:528]()
    ) -> Vec<LogEntry> {
    [19.507]
    [19.528]
    ) -> anyhow::Result<Vec<LogEntry>> {
  • replacement in libflorescence/src/repo.rs at line 997
    [19.620][19.620:670]()
    let txn = repo.pristine.txn_begin().unwrap();
    [19.620]
    [19.670]
    let txn = repo.pristine.txn_begin()?;
  • replacement in libflorescence/src/repo.rs at line 1004
    [19.789][19.789:857]()
    let channel = txn.load_channel(&cur_channel).unwrap().unwrap();
    [19.789]
    [19.857]
    let channel = txn
    .load_channel(&cur_channel)?
    .context("Loading current channel")?;
  • replacement in libflorescence/src/repo.rs at line 1010
    [19.911][19.911:1005]()
    let mut reverse_log =
    txn.reverse_log(&channel.read(), None).unwrap().peekable();
    [19.911]
    [19.1005]
    let mut reverse_log = txn.reverse_log(&channel.read(), None)?.peekable();
  • replacement in libflorescence/src/repo.rs at line 1013
    [19.1044][19.1044:1067]()
    return vec![];
    [19.1044]
    [19.1067]
    return Ok(vec![]);
  • replacement in libflorescence/src/repo.rs at line 1018
    [19.1132][22.904:1029]()
    let (_, (hash, _mrk)) = pr.unwrap();
    let cid = pijul::GraphTxnT::get_internal(&txn, hash).unwrap().unwrap();
    [19.1132]
    [19.1251]
    let (_, (hash, _mrk)) = pr?;
    let cid = pijul::GraphTxnT::get_internal(&txn, hash)?
    .context("Getting log change ID")?;
  • replacement in libflorescence/src/repo.rs at line 1028
    [19.1549][19.1549:1627]()
    )
    .unwrap()
    == Some(cid);
    [19.1549]
    [19.1627]
    )? == Some(cid);
  • replacement in libflorescence/src/repo.rs at line 1039
    [20.484][42.528:600]()
    let entry = mk_log_entry(repo, ChangeHash::from(hash));
    [20.484]
    [19.2025]
    let entry = mk_log_entry(repo, ChangeHash::from(hash))?;
  • replacement in libflorescence/src/repo.rs at line 1050
    [19.2226][19.2226:2238]()
    entries
    [19.2226]
    [19.2238]
    Ok(entries)
  • replacement in libflorescence/src/repo.rs at line 1053
    [19.2241][42.601:675](),[42.675][22.1179:1295](),[22.1179][22.1179:1295]()
    fn mk_log_entry(repo: &pijul::Repository, hash: ChangeHash) -> LogEntry {
    let header = repo.changes.get_header(&hash).unwrap();
    let files = repo.changes.get_changes(&hash).unwrap();
    [19.2241]
    [21.341]
    fn mk_log_entry(
    repo: &pijul::Repository,
    hash: ChangeHash,
    ) -> anyhow::Result<LogEntry> {
    let header = repo.changes.get_header(&hash)?;
    let files = repo.changes.get_changes(&hash)?;
  • replacement in libflorescence/src/repo.rs at line 1066
    [49.120][19.2375:2390](),[21.539][19.2375:2390](),[19.2375][19.2375:2390]()
    LogEntry {
    [49.120]
    [22.1296]
    Ok(LogEntry {
  • replacement in libflorescence/src/repo.rs at line 1071
    [21.560][19.2448:2454](),[19.2448][19.2448:2454]()
    }
    [21.560]
    [19.2454]
    })
  • replacement in libflorescence/src/repo.rs at line 1181
    [44.2180][44.2180:2192]()
    ) -> bool {
    [44.2180]
    [44.2192]
    ) -> anyhow::Result<bool> {
  • replacement in libflorescence/src/repo.rs at line 1183
    [44.2244][44.2244:2583]()
    state
    .record(
    txn,
    libpijul::Algorithm::default(),
    false,
    &libpijul::DEFAULT_SEPARATOR,
    channel,
    &repo.working_copy,
    &repo.changes,
    "",
    std::thread::available_parallelism().unwrap().get(),
    )
    .unwrap();
    [44.2244]
    [44.2583]
    state.record(
    txn,
    libpijul::Algorithm::default(),
    false,
    &libpijul::DEFAULT_SEPARATOR,
    channel,
    &repo.working_copy,
    &repo.changes,
    "",
    std::thread::available_parallelism()?.get(),
    )?;
  • replacement in libflorescence/src/repo.rs at line 1196
    [44.2656][44.2656:2684]()
    !rec.actions.is_empty()
    [44.2656]
    [44.2684]
    Ok(!rec.actions.is_empty())
  • replacement in libflorescence/src/repo/test.rs at line 66
    [48.27][32.3625:3640](),[32.3625][32.3625:3640]()
    } = state;
    [48.27]
    [32.3640]
    } = state.unwrap();
  • replacement in libflorescence/src/repo/test.rs at line 89
    [41.747][33.3425:3498](),[33.3425][33.3425:3498]()
    assert_eq!(repo::current_channel(&repo), libpijul::DEFAULT_CHANNEL);
    [41.747]
    [33.3498]
    assert_eq!(
    repo::current_channel(&repo).unwrap(),
    libpijul::DEFAULT_CHANNEL
    );
  • replacement in libflorescence/src/repo/test.rs at line 96
    [33.3623][33.3623:3687]()
    assert_eq!(repo::current_channel(&repo), new_channel_name);
    [33.3623]
    [35.410]
    assert_eq!(repo::current_channel(&repo).unwrap(), new_channel_name);
  • replacement in libflorescence/src/repo/test.rs at line 105
    [35.582][47.2714:2777]()
    let log = repo::get_log(&internal.repo, None, None, None);
    [35.582]
    [35.635]
    let log = repo::get_log(&internal.repo, None, None, None).unwrap();
  • replacement in libflorescence/src/repo/test.rs at line 116
    [50.574][50.574:632]()
    repo::record(&internal, msg.to_string(), None, skey);
    [50.574]
    [35.862]
    repo::record(&internal, msg.to_string(), None, skey).unwrap();
  • replacement in libflorescence/src/repo/test.rs at line 118
    [35.863][47.2778:2841]()
    let log = repo::get_log(&internal.repo, None, None, None);
    [35.863]
    [35.916]
    let log = repo::get_log(&internal.repo, None, None, None).unwrap();
  • replacement in libflorescence/src/repo/test.rs at line 138
    [36.528][38.44:87]()
    let diff = repo::diff(&internal.repo);
    [36.528]
    [38.87]
    let diff = repo::diff(&internal.repo).unwrap();
  • replacement in libflorescence/src/repo/test.rs at line 145
    [36.743][38.126:169]()
    let diff = repo::diff(&internal.repo);
    [36.743]
    [38.169]
    let diff = repo::diff(&internal.repo).unwrap();
  • replacement in libflorescence/src/repo/test.rs at line 152
    [38.249][38.249:325]()
    let changed_files = repo::changed_files(&diff, &internal.repo.changes);
    [38.249]
    [38.325]
    let changed_files =
    repo::changed_files(&diff, &internal.repo.changes).unwrap();
  • replacement in libflorescence/src/repo/test.rs at line 169
    [39.189][39.189:254]()
    let untracked_files = repo::untracked_files(&internal.repo);
    [39.189]
    [39.254]
    let untracked_files = repo::untracked_files(&internal.repo).unwrap();
  • replacement in libflorescence/src/repo/test.rs at line 176
    [39.423][39.423:488]()
    let untracked_files = repo::untracked_files(&internal.repo);
    [39.423]
    [39.488]
    let untracked_files = repo::untracked_files(&internal.repo).unwrap();
  • replacement in libflorescence/src/repo/test.rs at line 187
    [37.195][38.609:652]()
    let diff = repo::diff(&internal.repo);
    [37.195]
    [38.652]
    let diff = repo::diff(&internal.repo).unwrap();
  • replacement in libflorescence/src/repo/test.rs at line 194
    [37.406][37.406:451]()
    repo::add(&mut internal.repo, new_file);
    [37.406]
    [37.451]
    repo::add(&mut internal.repo, new_file).unwrap();
  • replacement in libflorescence/src/repo/test.rs at line 196
    [37.452][38.691:734]()
    let diff = repo::diff(&internal.repo);
    [37.452]
    [38.734]
    let diff = repo::diff(&internal.repo).unwrap();
  • replacement in libflorescence/src/repo/test.rs at line 203
    [37.649][37.649:693]()
    repo::rm(&mut internal.repo, new_file);
    [37.649]
    [37.693]
    repo::rm(&mut internal.repo, new_file).unwrap();
  • replacement in libflorescence/src/repo/test.rs at line 205
    [37.694][37.694:738]()
    let adiff = repo::diff(&internal.repo);
    [37.694]
    [37.738]
    let adiff = repo::diff(&internal.repo).unwrap();
  • replacement in libflorescence/src/repo/test.rs at line 215
    [40.215][47.2842:2909]()
    let mut log = repo::get_log(&internal.repo, None, None, None);
    [40.215]
    [40.272]
    let mut log = repo::get_log(&internal.repo, None, None, None).unwrap();
  • replacement in libflorescence/src/repo/test.rs at line 222
    [40.450][47.2910:2984]()
    let mut log = repo::get_log(&internal.repo, None, None, Some(limit));
    [40.450]
    [40.514]
    let mut log =
    repo::get_log(&internal.repo, None, None, Some(limit)).unwrap();
  • replacement in libflorescence/src/repo/test.rs at line 228
    [40.615][47.2985:3060]()
    let mut log = repo::get_log(&internal.repo, None, Some(offset), None);
    [40.615]
    [40.680]
    let mut log =
    repo::get_log(&internal.repo, None, Some(offset), None).unwrap();
  • edit in libflorescence/src/prelude.rs at line 1
    [3.2377]
    [15.14]
    #[doc(inline)]
    pub use anyhow::{bail, Context};
  • edit in libflorescence/Cargo.toml at line 25
    [3.5596]
    [20.685]
    [dependencies.anyhow]
    workspace = true
  • replacement in inflorescence/src/test.rs at line 139
    [27.3362][27.3362:3453]()
    Msg::FromRepo(repo::MsgOut::AddedUntrackedFile { path }) if path == file_to_record
    [27.3362]
    [27.3453]
    Msg::FromRepo(repo::MsgOut::AddedUntrackedFile { result:_, path }) if path == file_to_record
  • replacement in inflorescence/src/test.rs at line 252
    [28.1245][28.1245:1336]()
    Msg::FromRepo(repo::MsgOut::AddedUntrackedFile { path }) if path == file_to_record
    [28.1245]
    [28.1336]
    Msg::FromRepo(repo::MsgOut::AddedUntrackedFile {result:_, path }) if path == file_to_record
  • replacement in inflorescence/src/test.rs at line 559
    [29.2098][31.215:280]()
    Msg::FromRepo(repo::MsgOut::AddedUntrackedFile { path })
    [29.2098]
    [31.280]
    Msg::FromRepo(repo::MsgOut::AddedUntrackedFile { result:_, path })
  • replacement in inflorescence/src/test.rs at line 608
    [30.630][31.319:379]()
    Msg::FromRepo(repo::MsgOut::RmedAddedFile { path })
    [30.630]
    [31.379]
    Msg::FromRepo(repo::MsgOut::RmedAddedFile { result:_, path })
  • edit in inflorescence/src/main.rs at line 637
    [26.932]
    [26.932]
    let report_err = |state: &mut State, err: String| {
    report::show_err(&mut state.model.report, err);
    Task::none()
    };
  • replacement in inflorescence/src/main.rs at line 644
    [26.1008][51.2823:2973]()
    repo::MsgOut::InitFailed(err) => {
    report::show_err(&mut state.model.report, err.to_string());
    Task::none()
    }
    [26.1008]
    [47.86299]
    repo::MsgOut::InitFailed(err) => report_err(state, err.to_string()),
  • replacement in inflorescence/src/main.rs at line 648
    [47.86393][47.86393:86458](),[47.86458][27.7884:8019](),[26.1078][27.7884:8019](),[27.8088][26.1078:1200](),[26.1078][26.1078:1200](),[26.1200][46.47127:47201](),[46.47201][47.86459:86593]()
    } => repo_refreshed(state, repo_state, invalidate_logs),
    repo::MsgOut::AddedUntrackedFile { path: _ } => Task::none(),
    repo::MsgOut::RmedAddedFile { path: _ } => Task::none(),
    repo::MsgOut::GotChangeDiffs { hash, diffs } => {
    repo_got_change_diffs(state, hash, diffs)
    }
    repo::MsgOut::LoadedEntireLog(log) => got_entire_log(state, log),
    repo::MsgOut::LoadedOtherChannelLog { channel, log } => {
    loaded_other_channel_log(state, channel, log)
    }
    [47.86393]
    [26.1200]
    } => match repo_state {
    Ok(repo_state) => {
    repo_refreshed(state, repo_state, invalidate_logs)
    }
    Err(err) => report_err(state, err.to_string()),
    },
    repo::MsgOut::AddedUntrackedFile { result, path: _ } => match result {
    Ok(()) => Task::none(),
    Err(err) => report_err(state, err.to_string()),
    },
    repo::MsgOut::RmedAddedFile { result, path: _ } => match result {
    Ok(()) => Task::none(),
    Err(err) => report_err(state, err.to_string()),
    },
    repo::MsgOut::GotChangeDiffs { hash, diffs } => match diffs {
    Ok(diffs) => repo_got_change_diffs(state, hash, diffs),
    Err(err) => report_err(state, err.to_string()),
    },
    repo::MsgOut::LoadedEntireLog(log) => match log {
    Ok(log) => got_entire_log(state, log),
    Err(err) => report_err(state, err.to_string()),
    },
    repo::MsgOut::LoadedOtherChannelLog { channel, log } => match log {
    Ok(log) => loaded_other_channel_log(state, channel, log),
    Err(err) => report_err(state, err.to_string()),
    },
  • edit in Cargo.toml at line 31
    [11.5587]
    [6.8720]
    [workspace.dependencies.anyhow]
    version = "1"
  • edit in Cargo.lock at line 2795
    [2.44936]
    [32.4391]
    "anyhow",