allow to rm added files
[?]
Feb 15, 2025, 6:25 PM
ELG3UDT6OJFEYSJR7HZEC65IUWBMGPPPCXEW3CDW5T74R6KC5LIACDependencies
- [2]
6YZAVBWUInitial commit - [3]
WT3GA27Padd cursor with selection - [4]
UB2ITZJSrefresh changed files on FS changes - [5]
EC3TVL4Xadd untracked files - [6]
KT5UYXGKfix selection after adding file, add changed file diffs - [7]
SWWE2R6Mdisplay basic repo stuff - [8]
KLR5FRIBadd fs state read/write of repos
Change contents
- replacement in justfile at line 33
doc_check:doc-check: - replacement in crates/libflowers_client/src/repo.rs at line 68
state.untracked_files = untracked_files(&state);state.untracked_files = untracked_files(state); - replacement in crates/libflowers_client/src/repo.rs at line 167
let path = if let Ok(path) =path.as_path().strip_prefix(&repo_path.as_path()){path} else {return;};let path_str = path_slash::PathExt::to_slash_lossy(path);let path_str = path_slash::PathExt::to_slash_lossy(path.as_path()); - edit in crates/libflowers_client/src/repo.rs at line 173
}txn.commit().unwrap();}pub fn rm(repo: &mut pijul::Repository, path_str: &str) {let mut txn = repo.pristine.mut_txn_begin().unwrap();let full_path = {let mut p = repo.path.clone();p.push(path_str);p};let path = full_path.canonicalize().unwrap();let path_str = path_slash::PathExt::to_slash_lossy(path.as_path());if txn.is_tracked(&path_str).unwrap() {txn.remove_file(&path_str).unwrap(); - edit in crates/flowers_ui/src/main.rs at line 85
RmAddedFile, - edit in crates/flowers_ui/src/main.rs at line 270
Message::RmAddedFile => {if let Some(cursor::Selection::ChangedFile { ix, path }) =state.cursor.selection.as_ref(){let file = state.repo.changed_files.iter().nth(*ix).unwrap();if let repo::ChangedFileDiff::Add = &file.diff {repo::rm(&mut state.repo.state, path);let file = file.clone();// Remove from changed fileslet removed = state.repo.changed_files.remove(&file);debug_assert!(removed,"{:?} not found in {:?}",file, state.repo.changed_files);// Update untracked filesstate.repo.untracked_files.insert(file.path);// Select the next changed file, if anystate.cursor.selection =if state.repo.changed_files.is_empty() {None} else {let ix = cmp::min(*ix,state.repo.changed_files.len() - 1,);Some(changed_file_selection(state, ix))};}}} - edit in crates/flowers_ui/src/main.rs at line 314
"x" => Some(Message::RmAddedFile),