Tuesday, 27 August 2013

Is There Any File Operation Queue Libraries

Is There Any File Operation Queue Libraries

Currently, I'm working on a TFS source download project for our project
branch build. We have many branches, but don't want to spend too much disk
space to hold all the source code. (Even for a single branch the source
code is too much.) So, we have an app to download source code from one TFS
branch.
Due to the svn-style of TFS, you cannot seamlessly switch between
branches. All source code need to be fetched before switching branch. Our
strategy is: update current workspace to branch point, and fetch change
set by change set.
However, this yield to many duplications, since the TFS downloading API
downloads the entire file, and if one file is modified several times, it
will be downloaded once and once again. (Situation is getting worth if
forward integration happens.)
What come into my mind is to queue all these download/delete file
operations, remove duplicated operations, and only apply the latest
operation to local disk.
I'm wondering if there's any library can do this, something like:
FOQueue.CreateFile(file1, (path) => DownloadFromTFS(path));
FOQueue.CreateFile(file2, (path) => DownloadFromTFS(path));
FOQueue.DeleteFile(file1); // OK, file1 will not be
downloaded
// since latest operation
is deletion.
FOQueue.CreateFile(file3, ...);
FOQueue.DeleteFolder(parentOfFile3); // file3 will not be
downloaded since
// its parent folder is
deleted.
FOQueue.Flush(); // Only file2 is downloaded.
Thanks in advance!

No comments:

Post a Comment