Show More
@@ -48,10 +48,10 b' class nocompress(object):' | |||
|
48 | 48 | return "" |
|
49 | 49 | |
|
50 | 50 | bundletypes = { |
|
51 | "": nocompress, | |
|
52 | "HG10UN": nocompress, | |
|
53 |
"HG10" |
|
|
54 | "HG10GZ": zlib.compressobj, | |
|
51 | "": ("", nocompress), | |
|
52 | "HG10UN": ("HG10UN", nocompress), | |
|
53 | "HG10BZ": ("HG10", lambda: bz2.BZ2Compressor(9)), | |
|
54 | "HG10GZ": ("HG10GZ", zlib.compressobj), | |
|
55 | 55 | } |
|
56 | 56 | |
|
57 | 57 | def writebundle(cg, filename, type): |
@@ -75,8 +75,9 b' def writebundle(cg, filename, type):' | |||
|
75 | 75 | fh = os.fdopen(fd, "wb") |
|
76 | 76 | cleanup = filename |
|
77 | 77 | |
|
78 | fh.write(type) | |
|
79 | z = bundletypes[type]() | |
|
78 | header, compressor = bundletypes[type] | |
|
79 | fh.write(header) | |
|
80 | z = compressor() | |
|
80 | 81 | |
|
81 | 82 | # parse the changegroup data, otherwise we will block |
|
82 | 83 | # in case of sshrepo because we don't know the end of the stream |
@@ -332,7 +332,7 b' def bundle(ui, repo, fname, dest=None, *' | |||
|
332 | 332 | cg = repo.changegroupsubset(o, revs, 'bundle') |
|
333 | 333 | else: |
|
334 | 334 | cg = repo.changegroup(o, 'bundle') |
|
335 | changegroup.writebundle(cg, fname, "HG10") | |
|
335 | changegroup.writebundle(cg, fname, "HG10BZ") | |
|
336 | 336 | |
|
337 | 337 | def cat(ui, repo, file1, *pats, **opts): |
|
338 | 338 | """output the latest or given revisions of files |
@@ -1324,7 +1324,7 b' def incoming(ui, repo, source="default",' | |||
|
1324 | 1324 | if fname or not other.local(): |
|
1325 | 1325 | # create a bundle (uncompressed if other repo is not local) |
|
1326 | 1326 | cg = other.changegroup(incoming, "incoming") |
|
1327 | type = other.local() and "HG10" or "HG10UN" | |
|
1327 | type = other.local() and "HG10BZ" or "HG10UN" | |
|
1328 | 1328 | fname = cleanup = changegroup.writebundle(cg, fname, type) |
|
1329 | 1329 | # keep written bundle? |
|
1330 | 1330 | if opts["bundle"]: |
General Comments 0
You need to be logged in to leave comments.
Login now