export only the files touched by each change
Dependencies
- [2]
R3XMFPCYimport and export marks - [3]
T3IX7GG7Pass deletions and renames to Git - [4]
QWLMNP5Fnew ChangeStore implementation - [5]
FIIUZR4LInclude file content - [*]
ATRA7XTTRIIR: factor out Repository struct - [*]
D467LQZ6Load identities - [*]
TQBJZLD7RIIR: hello, world
Change contents
- edit in src/repo.rs at line 1
use std::collections::BTreeSet; - edit in src/repo.rs at line 24
use libpijul::DepsTxnT;use libpijul::GraphTxnT;use libpijul::Hash; - replacement in src/repo.rs at line 248
pub fn get_files(&mut self) -> Result<FileSet, Box<dyn Error>> {pub fn get_files(&mut self, change: Hash) -> Result<FileSet, Box<dyn Error>> { - replacement in src/repo.rs at line 252
libpijul::output::output_repository_no_pending(&fs,&self.change_store,&self.txn,&self.channel,"",false,None,1,0,)?;let mut touched_paths = BTreeSet::new();let txn = self.txn.read();if let Some(int) = txn.get_internal(&change.into())? {for inode in txn.iter_rev_touched(int)? {let (int_, inode) = inode?;if int_ < int {continue;} else if int_ > int {break;}if let Some((path, _)) = libpijul::fs::find_path(&self.change_store,&*txn,&*self.channel.read(),false,*inode,)? {touched_paths.insert(path);} else {touched_paths.clear();break;}}}if touched_paths.is_empty() {touched_paths.insert(String::from(""));}std::mem::drop(txn); - edit in src/repo.rs at line 282
let mut last: Option<&str> = None;for path in touched_paths.iter() {match last {Some(last_path) => {// If `last_path` is a prefix (in the path sense) of `path`, skip.if last_path.len() < path.len() {let (pre_last, post_last) = path.split_at(last_path.len());if pre_last == last_path && post_last.starts_with("/") {continue;}}}_ => (),}libpijul::output::output_repository_no_pending(&fs,&self.change_store,&self.txn,&self.channel,path,true,None,1,0,)?;last = Some(path);} - replacement in src/main.rs at line 43
let files = sandbox.get_files().unwrap();let files = sandbox.get_files(changes[i].hash).unwrap();