Skip to content

Commit

Permalink
simplify the packing code
Browse files Browse the repository at this point in the history
  • Loading branch information
schacon committed Aug 11, 2009
1 parent ff25357 commit 3cc376e
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions dulwich/pack.py
Expand Up @@ -835,7 +835,6 @@ def write_pack_data(f, objects, num_objects, window=10, progress=None):
for sha, path in objects.itershas():
count = count + 1
progress("looking for cached data: %d.\r" % count)
print sha
progress("looking for cached data: %d.\n" % count)

# this gets a list of all the objects - actual backend walker calls here
Expand Down Expand Up @@ -870,22 +869,8 @@ def write_pack_data(f, objects, num_objects, window=10, progress=None):
f.write(struct.pack(">L", 2)) # Pack version
f.write(struct.pack(">L", num_objects)) # Number of objects in pack
for o, path in recency:
sha1 = o.sha().digest()
orig_t = o.type
raw = o.as_raw_string()
winner = raw
t = orig_t
#for i in range(offs[o]-window, window):
# if i < 0 or i >= len(offs): continue
# b = magic[i][4]
# if b.type != orig_t: continue
# base = b.as_raw_string()
# delta = create_delta(base, raw)
# if len(delta) < len(winner):
# winner = delta
# t = 6 if magic[i][2] == 1 else 7
offset, crc32 = write_pack_object(f, t, winner)
entries.append((sha1, offset, crc32))
offset, crc32 = write_pack_object(f, o.type, o.as_raw_string())
entries.append((o.sha().digest(), offset, crc32))
return entries, f.write_sha()


Expand Down

0 comments on commit 3cc376e

Please sign in to comment.