Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add TODOs

  • Loading branch information...
commit 0282d98d1c2915f88122017044e35e4dc450466b 1 parent 99ad47b
@hbons authored
Showing with 24 additions and 7 deletions.
  1. +1 −1  Chunker.cs
  2. +22 −6 Index.cs
  3. +1 −0  Main.cs
View
2  Chunker.cs
@@ -62,7 +62,7 @@ public void FileToChunks (string [] source_file_paths)
int chunk_size = 1024 * 1024 * 4;
List <string> chunk_paths = new List<string> ();
- // TODO: threads
+ // TODO: threadpool
foreach (string source_file_path in source_file_paths) {
using (FileStream stream = File.OpenRead (source_file_path))
View
28 Index.cs
@@ -22,6 +22,7 @@
namespace Rainbows {
+ // TODO: all methods here need to block
public class Index {
public readonly string DatabasePath;
@@ -37,7 +38,7 @@ public Index (string database_path, string checkout_path)
public void Status ()
{
-
+ // TODO compare the checkout with the HEAD tree
}
@@ -56,25 +57,32 @@ public void Commit ()
};
chunker.ChunkingFinished += delegate {
- // - Walk the new tree and create blobs, trees
-
+ transfer_manager.QueueUpload ();
};
- chunker.FileToChunks (new string [] {"/Users/hbons/hp2.avi"});
+ // TODO: needs to block
+ chunker.FileToChunks (new string [] {"/Users/hbons/hp2.avi"});
- // - Update 'current' file
+ // TODO: Walk the new tree and create blobs, trees, commit
+ // - Update HEAD file
}
public void Checkout (string commit_hash)
{
+ Chunker chunker = new Chunker (DatabasePath,
+ new Cryptographer ("cGFzc3dvcmQAAAAAAAAAAA=="));
+ // TODO: walk the HEAD tree
+ //chunker.ChunksToFile (chunks, path);
}
public bool Push ()
{
+ // TODO: check if the remote HEAD doesn't conflict
+
return true;
}
@@ -89,6 +97,14 @@ public void PullAndRebase ()
string [] new_remote_objects = new string [0];
transfer_manager.DownloadObjects (new_remote_objects);
+
+ // TODO: rebase
+ }
+
+
+ public void CollectGarbage ()
+ {
+ // TODO: Remove all objects that are not in the current HEAD and are older than a week
}
@@ -142,7 +158,7 @@ public void Store (string file_name, string [] chunk_hashes)
byte [] buffer = Encoding.ASCII.GetBytes (chunk_hash + "\n");
stream.Write (buffer, 0, buffer.Length);
}
-
+
Console.WriteLine ("Created: " + file_store_path);
}
}
View
1  Main.cs
@@ -32,6 +32,7 @@ public static void Main (string [] args)
"/Users/hbons/SparkleShare/Rainbows");
index.Status ();
+ index.Commit ();
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.