|
@@ -20,10 +20,10 @@
|
|
import os, sys, tempfile, struct
|
|
import os, sys, tempfile, struct
|
|
from dulwich.server import Backend, TCPGitServer
|
|
from dulwich.server import Backend, TCPGitServer
|
|
from dulwich.repo import Repo
|
|
from dulwich.repo import Repo
|
|
-from dulwich.pack import PackData, Pack
|
|
|
|
|
|
+from dulwich.pack import PackData, Pack, write_pack_data
|
|
|
|
|
|
import sha
|
|
import sha
|
|
-from dulwich.pack import write_pack_object
|
|
|
|
|
|
+
|
|
class PackWriteWrapper(object):
|
|
class PackWriteWrapper(object):
|
|
|
|
|
|
def __init__(self, write):
|
|
def __init__(self, write):
|
|
@@ -121,17 +121,7 @@ class GitBackend(Backend):
|
|
|
|
|
|
progress("counting objects: %d, done.\n" % len(sha_queue))
|
|
progress("counting objects: %d, done.\n" % len(sha_queue))
|
|
|
|
|
|
- w = PackWriteWrapper(write)
|
|
|
|
- w.write("PACK")
|
|
|
|
- w.write(struct.pack(">L", 2))
|
|
|
|
- w.write(struct.pack(">L", len(sha_queue)))
|
|
|
|
-
|
|
|
|
- for t, sha in sha_queue:
|
|
|
|
- ty, obj = self.repo.get_object(sha).as_raw_string()
|
|
|
|
- write_pack_object(w, t, obj)
|
|
|
|
-
|
|
|
|
- # send sha1 of pack
|
|
|
|
- write(w.digest)
|
|
|
|
|
|
+ write_pack_data(write, (self.repo.get_object(sha).as_raw_string() for sha in sha_queue))
|
|
|
|
|
|
progress("how was that, then?\n")
|
|
progress("how was that, then?\n")
|
|
|
|
|