Plan for tree backups

This commit is contained in:
Dennis Schwerdel 2017-03-15 22:14:50 +01:00 committed by Dennis Schwerdel
parent 1a2ea29d24
commit 717fc7472d
2 changed files with 12 additions and 0 deletions

View File

@ -76,4 +76,15 @@ impl Repository {
try!(self.save_inode_at(&inode, path));
Ok(())
}
pub fn create_full_backup<P: AsRef<Path>>(&mut self, path: P) -> Result<Backup, &'static str> {
// Maintain a stack of folders still todo
// Maintain a map of path->inode entries
// Work on topmost stack entry
// If it is a file, create inode for it and put it in the map
// If it is a folder, list contents and put entries not in the map on the stack, folders last
// If it is a folder with no missing entries, create a directory inode, add it to the map, and remove all children from the map
// If stack is empty create a backup with the last inode as root
unimplemented!()
}
}

View File

@ -29,6 +29,7 @@ serde_impl!(FileType(u8) {
pub enum FileContents {
Inline(ByteBuf),
Chunked(Vec<Chunk>)
//TODO: ChunkedIndirect
}
serde_impl!(FileContents(u8) {
Inline(ByteBuf) => 0,