From be777bcc2dff7941e5f37b6543dd58cdbeebd015 Mon Sep 17 00:00:00 2001 From: "https://www.google.com/accounts/o8/id?id=AItOawmicVKRM8vJX4wPuAwlLEoS2cjmFXQkjkE" Date: Sun, 8 Dec 2013 15:23:36 +0000 Subject: [PATCH] Added a comment: pseudocode --- ..._0ba57952532d5ef1f2bbfb163faa3b2f._comment | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 doc/todo/New_special_remote_suggeston_-_clean_directory/comment_9_0ba57952532d5ef1f2bbfb163faa3b2f._comment diff --git a/doc/todo/New_special_remote_suggeston_-_clean_directory/comment_9_0ba57952532d5ef1f2bbfb163faa3b2f._comment b/doc/todo/New_special_remote_suggeston_-_clean_directory/comment_9_0ba57952532d5ef1f2bbfb163faa3b2f._comment new file mode 100644 index 0000000000..d96ac69870 --- /dev/null +++ b/doc/todo/New_special_remote_suggeston_-_clean_directory/comment_9_0ba57952532d5ef1f2bbfb163faa3b2f._comment @@ -0,0 +1,35 @@ +[[!comment format=mdwn + username="https://www.google.com/accounts/o8/id?id=AItOawmicVKRM8vJX4wPuAwlLEoS2cjmFXQkjkE" + nickname="Thomas" + subject="pseudocode" + date="2013-12-08T15:23:36Z" + content=""" +The implementation should really be nothing more than the following to be run from a regular git annex repository with a configures special plain directory remote: + + foreach(path : allAnnexedFiles) { + if(remote.exists(path) && remote.filesize(path) === expectedFilesize) goto finally; + + if(fileAvailableLocally(path)) { + copyFileToRemote(path); + goto finally; + } + + if(shouldCopyFromElsewhere && canCopyFileFromSomeOtherRemote(path)) { + copyFileFromSomeOtherRemoteToRemote(path); + } + + finally: + logThatFileExistsOnRemote(path); + } + + foreach(remotePath : filesInRemoteDir) { + if(fileIsAnnexed(remotePath) || fileIsIgnored(remotePath) continue; + + delete(remotePath); + } + +The above pseude code assumes +- that the no other process is working on the remote at the same time. +- that the remote is not trusted. +- that nobody expects changes done at the remote to propagate to other clones. +"""]]