From 717fc7472d8d51c87e679a08203f1e0e12ac7861 Mon Sep 17 00:00:00 2001 From: Dennis Schwerdel Date: Wed, 15 Mar 2017 22:14:50 +0100 Subject: [PATCH] Plan for tree backups --- src/repository/backup.rs | 11 +++++++++++ src/repository/metadata.rs | 1 + 2 files changed, 12 insertions(+) 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,