Added a comment: pseudocode

This commit is contained in:
https://www.google.com/accounts/o8/id?id=AItOawmicVKRM8vJX4wPuAwlLEoS2cjmFXQkjkE 2013-12-08 15:23:36 +00:00 committed by admin
parent f62dc8e294
commit be777bcc2d

View file

@ -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.
"""]]