diff --git a/src/repository/backup.rs b/src/repository/backup.rs index 379d680..6b55c04 100644 --- a/src/repository/backup.rs +++ b/src/repository/backup.rs @@ -76,4 +76,15 @@ impl Repository { try!(self.save_inode_at(&inode, path)); Ok(()) } + + pub fn create_full_backup>(&mut self, path: P) -> Result { + // 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!() + } } diff --git a/src/repository/metadata.rs b/src/repository/metadata.rs index 118b7ff..1df5b34 100644 --- a/src/repository/metadata.rs +++ b/src/repository/metadata.rs @@ -29,6 +29,7 @@ serde_impl!(FileType(u8) { pub enum FileContents { Inline(ByteBuf), Chunked(Vec) + //TODO: ChunkedIndirect } serde_impl!(FileContents(u8) { Inline(ByteBuf) => 0,