Mercurial > public > mercurial-scm > hg
diff mercurial/changegroup.py @ 3704:9c1737a3e254
fix writebundle for bz2 bundles
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Wed, 22 Nov 2006 22:08:00 +0100 |
parents | f4dc02d7fb71 |
children | e9d339d5d2d7 |
line wrap: on
line diff
--- a/mercurial/changegroup.py Tue Nov 21 23:08:29 2006 -0200 +++ b/mercurial/changegroup.py Wed Nov 22 22:08:00 2006 +0100 @@ -48,10 +48,10 @@ return "" bundletypes = { - "": nocompress, - "HG10UN": nocompress, - "HG10": lambda: bz2.BZ2Compressor(9), - "HG10GZ": zlib.compressobj, + "": ("", nocompress), + "HG10UN": ("HG10UN", nocompress), + "HG10BZ": ("HG10", lambda: bz2.BZ2Compressor(9)), + "HG10GZ": ("HG10GZ", zlib.compressobj), } def writebundle(cg, filename, type): @@ -75,8 +75,9 @@ fh = os.fdopen(fd, "wb") cleanup = filename - fh.write(type) - z = bundletypes[type]() + header, compressor = bundletypes[type] + fh.write(header) + z = compressor() # parse the changegroup data, otherwise we will block # in case of sshrepo because we don't know the end of the stream